Bug 885298 - warning: redundant cast to android.os.IInterface in ISelfBrailleService.java. r=kats
authorMax Li <maxli@maxli.ca>
Fri, 21 Jun 2013 14:27:38 -0400
changeset 136319 6d6b5492ef0612a2928e469d1122f64b3ba7d434
parent 136318 8903e0f5611a77910a107c4e32b4caa48c51c83d
child 136320 e92898159905ce3dfb840d528da41b0f84223634
push id24880
push userphilringnalda@gmail.com
push dateTue, 25 Jun 2013 04:54:35 +0000
treeherdermozilla-central@bc569033125a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs885298
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 885298 - warning: redundant cast to android.os.IInterface in ISelfBrailleService.java. r=kats
mobile/android/base/Makefile.in
mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.aidl
mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.java
mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/WriteData.aidl
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -39,20 +39,16 @@ UTIL_JAVA_FILES := \
   util/INIParser.java \
   util/INISection.java \
   util/JSONUtils.java \
   util/StringUtils.java \
   util/ThreadUtils.java \
   util/UiAsyncTask.java \
   $(NULL)
 
-AIDL_AUTOGEN_FILES = \
-  braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.java \
-  $(NULL)
-
 FENNEC_JAVA_FILES = \
   ANRReporter.java \
   ActivityHandlerHelper.java \
   AlertNotification.java \
   AlignRightLinkPreference.java \
   AllCapsTextView.java \
   AndroidImport.java \
   AndroidImportPreference.java \
@@ -173,16 +169,17 @@ FENNEC_JAVA_FILES = \
   TextSelectionHandle.java \
   ThumbnailHelper.java \
   TouchEventInterceptor.java \
   UpdateServiceHelper.java \
   VideoPlayer.java \
   WebAppAllocator.java \
   WebAppImpl.java \
   ZoomConstraints.java \
+  braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.java \
   braille/com/googlecode/eyesfree/braille/selfbraille/SelfBrailleClient.java \
   braille/com/googlecode/eyesfree/braille/selfbraille/WriteData.java \
   db/BrowserContract.java \
   db/BrowserProvider.java \
   db/FormHistoryProvider.java \
   db/PerProfileContentProvider.java \
   db/PasswordsProvider.java \
   db/TabsProvider.java \
@@ -1181,20 +1178,20 @@ include $(topsrcdir)/config/android-comm
 # Instead of on the .class files, since more than one .class file might be produced per .java file
 # Sync dependencies are provided in a single jar. Sync classes themselves are delivered as source,
 # because Android resource classes must be compiled together in order to avoid overlapping resource
 # indices.
 classes.dex: $(ALL_JARS)
 	@echo "DX classes.dex"
 	$(DX) --dex --output=classes.dex jars $(ANDROID_COMPAT_LIB)
 
-jars/gecko-browser.jar: jars/gecko-mozglue.jar jars/gecko-util.jar jars/sync-thirdparty.jar jars/websockets.jar $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(FENNEC_PP_JAVA_VIEW_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) $(AIDL_AUTOGEN_FILES) R.java
+jars/gecko-browser.jar: jars/gecko-mozglue.jar jars/gecko-util.jar jars/sync-thirdparty.jar jars/websockets.jar $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(FENNEC_PP_JAVA_VIEW_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
 	@echo "JAR gecko-browser.jar"
 	$(NSINSTALL) -D classes/gecko-browser
-	$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-deprecation,-fallthrough -d classes/gecko-browser -classpath "jars/gecko-mozglue.jar:jars/gecko-util.jar:jars/sync-thirdparty.jar:jars/websockets.jar" $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(FENNEC_PP_JAVA_VIEW_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) $(addprefix $(srcdir)/,$(AIDL_AUTOGEN_FILES)) R.java
+	$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-deprecation,-fallthrough -d classes/gecko-browser -classpath "jars/gecko-mozglue.jar:jars/gecko-util.jar:jars/sync-thirdparty.jar:jars/websockets.jar" $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(FENNEC_PP_JAVA_VIEW_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
 	$(JAR) cMf jars/gecko-browser.jar -C classes/gecko-browser .
 
 jars/gecko-mozglue.jar: $(addprefix $(srcdir)/,$(MOZGLUE_JAVA_FILES)) $(MOZGLUE_PP_JAVA_FILES) jars
 	@echo "JAR gecko-mozglue.jar"
 	$(NSINSTALL) -D classes/gecko-mozglue
 	$(JAVAC) $(JAVAC_FLAGS) -Xlint:all -d classes/gecko-mozglue $(addprefix $(srcdir)/,$(MOZGLUE_JAVA_FILES)) $(MOZGLUE_PP_JAVA_FILES)
 	$(JAR) cMf jars/gecko-mozglue.jar -C classes/gecko-mozglue .
 
@@ -1223,19 +1220,16 @@ jars/webrtc.jar: $(addprefix $(srcdir)/,
 	$(JAVAC) $(JAVAC_FLAGS) -d classes/webrtc -classpath classes/gecko-browser:classes/gecko-util $(addprefix $(srcdir)/,$(WEBRTC_JAVA_FILES))
 	$(JAR) cMf jars/webrtc.jar -C classes/webrtc .
 endif
 
 jars:
 	@echo "MKDIR jars"
 	$(NSINSTALL) -D jars
 
-$(AIDL_AUTOGEN_FILES): %.java: %.aidl
-	$(AIDL) -I$(srcdir)/braille $<
-
 CLASSES_WITH_JNI= \
     org.mozilla.gecko.GeckoAppShell \
     org.mozilla.gecko.GeckoJavaSampler \
     org.mozilla.gecko.gfx.NativePanZoomController \
     org.mozilla.gecko.ANRReporter \
     $(NULL)
 
 ifdef MOZ_WEBSMS_BACKEND
deleted file mode 100644
--- a/mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.aidl
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.googlecode.eyesfree.braille.selfbraille;
-
-import com.googlecode.eyesfree.braille.selfbraille.WriteData;
-
-/**
- * Interface for a client to control braille output for a part of the
- * accessibility node tree.
- */
-interface ISelfBrailleService {
-    void write(IBinder clientToken, in WriteData writeData);
-    oneway void disconnect(IBinder clientToken);
-}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.java
@@ -0,0 +1,147 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package com.googlecode.eyesfree.braille.selfbraille;
+
+/**
+ * Interface for a client to control braille output for a part of the
+ * accessibility node tree.
+ */
+public interface ISelfBrailleService extends android.os.IInterface {
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements
+            com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService {
+        private static final java.lang.String DESCRIPTOR = "com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService";
+
+        /** Construct the stub at attach it to the interface. */
+        public Stub() {
+            this.attachInterface(this, DESCRIPTOR);
+        }
+
+        /**
+         * Cast an IBinder object into an
+         * com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService
+         * interface, generating a proxy if needed.
+         */
+        public static com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService asInterface(
+                android.os.IBinder obj) {
+            if ((obj == null)) {
+                return null;
+            }
+            android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+            if (((iin != null) && (iin instanceof com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService))) {
+                return ((com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService) iin);
+            }
+            return new com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService.Stub.Proxy(
+                    obj);
+        }
+
+        @Override
+        public android.os.IBinder asBinder() {
+            return this;
+        }
+
+        @Override
+        public boolean onTransact(int code, android.os.Parcel data,
+                android.os.Parcel reply, int flags)
+                throws android.os.RemoteException {
+            switch (code) {
+            case INTERFACE_TRANSACTION: {
+                reply.writeString(DESCRIPTOR);
+                return true;
+            }
+            case TRANSACTION_write: {
+                data.enforceInterface(DESCRIPTOR);
+                android.os.IBinder _arg0;
+                _arg0 = data.readStrongBinder();
+                com.googlecode.eyesfree.braille.selfbraille.WriteData _arg1;
+                if ((0 != data.readInt())) {
+                    _arg1 = com.googlecode.eyesfree.braille.selfbraille.WriteData.CREATOR
+                            .createFromParcel(data);
+                } else {
+                    _arg1 = null;
+                }
+                this.write(_arg0, _arg1);
+                reply.writeNoException();
+                return true;
+            }
+            case TRANSACTION_disconnect: {
+                data.enforceInterface(DESCRIPTOR);
+                android.os.IBinder _arg0;
+                _arg0 = data.readStrongBinder();
+                this.disconnect(_arg0);
+                return true;
+            }
+            }
+            return super.onTransact(code, data, reply, flags);
+        }
+
+        private static class Proxy implements
+                com.googlecode.eyesfree.braille.selfbraille.ISelfBrailleService {
+            private android.os.IBinder mRemote;
+
+            Proxy(android.os.IBinder remote) {
+                mRemote = remote;
+            }
+
+            @Override
+            public android.os.IBinder asBinder() {
+                return mRemote;
+            }
+
+            public java.lang.String getInterfaceDescriptor() {
+                return DESCRIPTOR;
+            }
+
+            @Override
+            public void write(
+                    android.os.IBinder clientToken,
+                    com.googlecode.eyesfree.braille.selfbraille.WriteData writeData)
+                    throws android.os.RemoteException {
+                android.os.Parcel _data = android.os.Parcel.obtain();
+                android.os.Parcel _reply = android.os.Parcel.obtain();
+                try {
+                    _data.writeInterfaceToken(DESCRIPTOR);
+                    _data.writeStrongBinder(clientToken);
+                    if ((writeData != null)) {
+                        _data.writeInt(1);
+                        writeData.writeToParcel(_data, 0);
+                    } else {
+                        _data.writeInt(0);
+                    }
+                    mRemote.transact(Stub.TRANSACTION_write, _data, _reply, 0);
+                    _reply.readException();
+                } finally {
+                    _reply.recycle();
+                    _data.recycle();
+                }
+            }
+
+            @Override
+            public void disconnect(android.os.IBinder clientToken)
+                    throws android.os.RemoteException {
+                android.os.Parcel _data = android.os.Parcel.obtain();
+                try {
+                    _data.writeInterfaceToken(DESCRIPTOR);
+                    _data.writeStrongBinder(clientToken);
+                    mRemote.transact(Stub.TRANSACTION_disconnect, _data, null,
+                            android.os.IBinder.FLAG_ONEWAY);
+                } finally {
+                    _data.recycle();
+                }
+            }
+        }
+
+        static final int TRANSACTION_write = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+        static final int TRANSACTION_disconnect = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    }
+
+    public void write(android.os.IBinder clientToken,
+            com.googlecode.eyesfree.braille.selfbraille.WriteData writeData)
+            throws android.os.RemoteException;
+
+    public void disconnect(android.os.IBinder clientToken)
+            throws android.os.RemoteException;
+}
deleted file mode 100644
--- a/mobile/android/base/braille/com/googlecode/eyesfree/braille/selfbraille/WriteData.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.googlecode.eyesfree.braille.selfbraille;
-
-parcelable WriteData;