aboutsummaryrefslogtreecommitdiffstats
path: root/testapps/basicProjectWithAidl/src
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2011-01-30 16:18:36 -0800
committerXavier Ducrohet <xav@android.com>2011-01-30 16:55:51 -0800
commit5e39089070b438ba090ac4dee83aaf71dc69ce90 (patch)
treea51bca7a341ffffefc271b0bb84f721f6c1ddbaf /testapps/basicProjectWithAidl/src
parentee0afac0a60af6f3f186e5bbb3f773b4c0eb56a4 (diff)
downloadsdk-5e39089070b438ba090ac4dee83aaf71dc69ce90.zip
sdk-5e39089070b438ba090ac4dee83aaf71dc69ce90.tar.gz
sdk-5e39089070b438ba090ac4dee83aaf71dc69ce90.tar.bz2
Refactor aidl handling in its own class.
It extends a new base class that will serve as a base class for the one handling renderscript files. Change-Id: Ibef0c4b9a792fe52bf7b70bf5d24f76a15cb65c9
Diffstat (limited to 'testapps/basicProjectWithAidl/src')
-rw-r--r--testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/ITest.aidl7
-rw-r--r--testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Main.java15
-rw-r--r--testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Rect.aidl5
-rw-r--r--testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Rect.java52
4 files changed, 79 insertions, 0 deletions
diff --git a/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/ITest.aidl b/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/ITest.aidl
new file mode 100644
index 0000000..cb7a314
--- /dev/null
+++ b/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/ITest.aidl
@@ -0,0 +1,7 @@
+package com.android.tests.basicprojectwithaidl;
+
+interface ITest {
+ Rect getRect();
+
+}
+
diff --git a/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Main.java b/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Main.java
new file mode 100644
index 0000000..eaed510
--- /dev/null
+++ b/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Main.java
@@ -0,0 +1,15 @@
+package com.android.tests.basicprojectwithaidl;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class Main extends Activity
+{
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+ }
+}
diff --git a/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Rect.aidl b/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Rect.aidl
new file mode 100644
index 0000000..734cf77
--- /dev/null
+++ b/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Rect.aidl
@@ -0,0 +1,5 @@
+package com.android.tests.basicprojectwithaidl;
+
+// Declare Rect so AIDL can find it and knows that it implements
+// the parcelable protocol.
+parcelable Rect; \ No newline at end of file
diff --git a/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Rect.java b/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Rect.java
new file mode 100644
index 0000000..8e16926
--- /dev/null
+++ b/testapps/basicProjectWithAidl/src/com/android/tests/basicprojectwithaidl/Rect.java
@@ -0,0 +1,52 @@
+package com.android.tests.basicprojectwithaidl;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Rect implements Parcelable {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+
+ public static final Parcelable.Creator<Rect> CREATOR = new Parcelable.Creator<Rect>() {
+ public Rect createFromParcel(Parcel in) {
+ return new Rect(in);
+ }
+
+ public Rect[] newArray(int size) {
+ return new Rect[size];
+ }
+ };
+
+ public Rect() {
+ }
+
+ private Rect(Parcel in) {
+ readFromParcel(in);
+ }
+
+ public void writeToParcel(Parcel out) {
+ out.writeInt(left);
+ out.writeInt(top);
+ out.writeInt(right);
+ out.writeInt(bottom);
+ }
+
+ public void readFromParcel(Parcel in) {
+ left = in.readInt();
+ top = in.readInt();
+ right = in.readInt();
+ bottom = in.readInt();
+ }
+
+ public int describeContents() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public void writeToParcel(Parcel arg0, int arg1) {
+ // TODO Auto-generated method stub
+
+ }
+}