Revert "RuntimeException on unknown transaction"
This reverts commit 01e932459cd82d18345cfdb06671c51778d5762c.
Reason for revert: Bug 168542496
Fixes: 168542496
Change-Id: I76198b4595604cb0dac335d62fa9d6e7ecbd5fc9
diff --git a/generate_java_binder.cpp b/generate_java_binder.cpp
index 4d9d708..b9c7674 100644
--- a/generate_java_binder.cpp
+++ b/generate_java_binder.cpp
@@ -662,41 +662,22 @@
auto _status = std::make_shared<Variable>("boolean", "_status");
tryStatement->statements->Add(std::make_shared<VariableDeclaration>(_status, call));
- // If the transaction returns false, which means UNKNOWN_TRANSACTION, fall back to the local
- // method in the default impl, if set before. Otherwise, throw a RuntimeException if the interface
- // is versioned. We can't throw the exception for unversioned interface because that would be an
- // app breaking change.
+ // If the transaction returns false, which means UNKNOWN_TRANSACTION, fall
+ // back to the local method in the default impl, if set before.
vector<string> arg_names;
for (const auto& arg : method.GetArguments()) {
arg_names.emplace_back(arg->GetName());
}
bool has_return_type = method.GetType().GetName() != "void";
-
- auto checkDefaultImpl = std::make_shared<IfStatement>();
- checkDefaultImpl->expression = std::make_shared<LiteralExpression>("getDefaultImpl() != null");
- if (has_return_type) {
- checkDefaultImpl->statements->Add(std::make_shared<LiteralStatement>(
- android::base::StringPrintf("return getDefaultImpl().%s(%s);\n", method.GetName().c_str(),
- Join(arg_names, ", ").c_str())));
- } else {
- checkDefaultImpl->statements->Add(std::make_shared<LiteralStatement>(
- android::base::StringPrintf("getDefaultImpl().%s(%s);\n", method.GetName().c_str(),
- Join(arg_names, ", ").c_str())));
- checkDefaultImpl->statements->Add(std::make_shared<LiteralStatement>("return;\n"));
- }
- if (options.Version() > 0) {
- checkDefaultImpl->elseif = std::make_shared<IfStatement>();
- checkDefaultImpl->elseif->statements->Add(
- std::make_shared<LiteralStatement>(android::base::StringPrintf(
- "throw new RuntimeException(\"Method %s is unimplemented.\");\n",
- method.GetName().c_str())));
- }
-
- auto checkTransactionError = std::make_shared<IfStatement>();
- checkTransactionError->expression = std::make_shared<LiteralExpression>("!_status");
- checkTransactionError->statements->Add(checkDefaultImpl);
-
- tryStatement->statements->Add(checkTransactionError);
+ tryStatement->statements->Add(std::make_shared<LiteralStatement>(
+ android::base::StringPrintf(has_return_type ? "if (!_status && getDefaultImpl() != null) {\n"
+ " return getDefaultImpl().%s(%s);\n"
+ "}\n"
+ : "if (!_status && getDefaultImpl() != null) {\n"
+ " getDefaultImpl().%s(%s);\n"
+ " return;\n"
+ "}\n",
+ method.GetName().c_str(), Join(arg_names, ", ").c_str())));
// throw back exceptions.
if (_reply) {
diff --git a/tests/java_app/src/android/aidl/tests/TestVersionedInterface.java b/tests/java_app/src/android/aidl/tests/TestVersionedInterface.java
index 06b14a7..b14504b 100644
--- a/tests/java_app/src/android/aidl/tests/TestVersionedInterface.java
+++ b/tests/java_app/src/android/aidl/tests/TestVersionedInterface.java
@@ -16,22 +16,21 @@
package android.aidl.tests;
-import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertThat;
+import static org.hamcrest.core.Is.is;
+import androidx.test.core.app.ApplicationProvider;
import android.aidl.versioned.tests.IFooInterface;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
-import androidx.test.core.app.ApplicationProvider;
+
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
+import org.junit.runner.RunWith;
@RunWith(JUnit4.class)
public class TestVersionedInterface {
@@ -54,14 +53,4 @@
public void testGetInterfaceHash() throws RemoteException {
assertThat(service.getInterfaceHash(), is("fcd4f9c806cbc8af3694d569fd1de1ecc8cf7d22"));
}
-
- @Rule public ExpectedException expectedException = ExpectedException.none();
-
- @Test
- public void testUnimplementedMethodTriggersException() throws RemoteException {
- expectedException.expect(RuntimeException.class);
- expectedException.expectMessage("Method bar is unimplemented.");
-
- service.bar();
- }
}
diff --git a/tests/test_data_example_interface.cpp b/tests/test_data_example_interface.cpp
index a1c3498..6448dd3 100644
--- a/tests/test_data_example_interface.cpp
+++ b/tests/test_data_example_interface.cpp
@@ -340,10 +340,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().isEnabled();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().isEnabled();
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -362,10 +360,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getState();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getState();
}
_reply.readException();
_result = _reply.readInt();
@@ -384,10 +380,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getAddress();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getAddress();
}
_reply.readException();
_result = _reply.readString();
@@ -407,10 +401,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getParcelables();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getParcelables();
}
_reply.readException();
_result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
@@ -433,10 +425,8 @@
_data.writeInt(mode);
_data.writeInt(duration);
boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().setScanMode(mode, duration);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().setScanMode(mode, duration);
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -457,11 +447,9 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- getDefaultImpl().registerBinder(foo);
- return;
- }
+ if (!_status && getDefaultImpl() != null) {
+ getDefaultImpl().registerBinder(foo);
+ return;
}
_reply.readException();
}
@@ -478,10 +466,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getRecursiveBinder();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getRecursiveBinder();
}
_reply.readException();
_result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
@@ -501,10 +487,8 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAnInterface(arg);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAnInterface(arg);
}
_reply.readException();
_result = _reply.readInt();
@@ -537,10 +521,8 @@
_data.writeInt(0);
}
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAParcelable(arg, arg2);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAParcelable(arg, arg2);
}
_reply.readException();
_result = _reply.readInt();
@@ -878,10 +860,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().isEnabled();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().isEnabled();
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -900,10 +880,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getState();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getState();
}
_reply.readException();
_result = _reply.readInt();
@@ -922,10 +900,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getAddress();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getAddress();
}
_reply.readException();
_result = _reply.readString();
@@ -945,10 +921,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getParcelables();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getParcelables();
}
_reply.readException();
_result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
@@ -971,10 +945,8 @@
_data.writeInt(mode);
_data.writeInt(duration);
boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().setScanMode(mode, duration);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().setScanMode(mode, duration);
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -995,11 +967,9 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- getDefaultImpl().registerBinder(foo);
- return;
- }
+ if (!_status && getDefaultImpl() != null) {
+ getDefaultImpl().registerBinder(foo);
+ return;
}
_reply.readException();
}
@@ -1016,10 +986,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getRecursiveBinder();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getRecursiveBinder();
}
_reply.readException();
_result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
@@ -1039,10 +1007,8 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAnInterface(arg);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAnInterface(arg);
}
_reply.readException();
_result = _reply.readInt();
@@ -1075,10 +1041,8 @@
_data.writeInt(0);
}
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAParcelable(arg, arg2);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAParcelable(arg, arg2);
}
_reply.readException();
_result = _reply.readInt();
@@ -1419,10 +1383,8 @@
android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "AIDL::java::IExampleInterface::isEnabled::client");
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().isEnabled();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().isEnabled();
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -1443,10 +1405,8 @@
android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "AIDL::java::IExampleInterface::getState::client");
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getState();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getState();
}
_reply.readException();
_result = _reply.readInt();
@@ -1467,10 +1427,8 @@
android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "AIDL::java::IExampleInterface::getAddress::client");
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getAddress();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getAddress();
}
_reply.readException();
_result = _reply.readString();
@@ -1492,10 +1450,8 @@
android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "AIDL::java::IExampleInterface::getParcelables::client");
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getParcelables();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getParcelables();
}
_reply.readException();
_result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
@@ -1520,10 +1476,8 @@
_data.writeInt(mode);
_data.writeInt(duration);
boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().setScanMode(mode, duration);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().setScanMode(mode, duration);
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -1546,11 +1500,9 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- getDefaultImpl().registerBinder(foo);
- return;
- }
+ if (!_status && getDefaultImpl() != null) {
+ getDefaultImpl().registerBinder(foo);
+ return;
}
_reply.readException();
}
@@ -1569,10 +1521,8 @@
android.os.Trace.traceBegin(android.os.Trace.TRACE_TAG_AIDL, "AIDL::java::IExampleInterface::getRecursiveBinder::client");
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getRecursiveBinder();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getRecursiveBinder();
}
_reply.readException();
_result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
@@ -1594,10 +1544,8 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAnInterface(arg);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAnInterface(arg);
}
_reply.readException();
_result = _reply.readInt();
@@ -1632,10 +1580,8 @@
_data.writeInt(0);
}
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAParcelable(arg, arg2);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAParcelable(arg, arg2);
}
_reply.readException();
_result = _reply.readInt();
@@ -1868,10 +1814,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().isEnabled();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().isEnabled();
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -1892,10 +1836,8 @@
_data.writeInt(a);
_data.writeInt(b);
boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getState(a, b);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getState(a, b);
}
_reply.readException();
_result = _reply.readInt();
@@ -1914,10 +1856,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getAddress();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getAddress();
}
_reply.readException();
_result = _reply.readString();
@@ -1937,10 +1877,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getParcelables();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getParcelables();
}
_reply.readException();
_result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
@@ -1963,10 +1901,8 @@
_data.writeInt(mode);
_data.writeInt(duration);
boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().setScanMode(mode, duration);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().setScanMode(mode, duration);
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -1987,11 +1923,9 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- getDefaultImpl().registerBinder(foo);
- return;
- }
+ if (!_status && getDefaultImpl() != null) {
+ getDefaultImpl().registerBinder(foo);
+ return;
}
_reply.readException();
}
@@ -2008,10 +1942,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getRecursiveBinder();
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getRecursiveBinder();
}
_reply.readException();
_result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
@@ -2031,10 +1963,8 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAnInterface(arg);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAnInterface(arg);
}
_reply.readException();
_result = _reply.readInt();
@@ -2067,10 +1997,8 @@
_data.writeInt(0);
}
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAParcelable(arg, arg2);
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAParcelable(arg, arg2);
}
_reply.readException();
_result = _reply.readInt();
@@ -2412,13 +2340,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().isEnabled();
- }
- else {
- throw new RuntimeException("Method isEnabled is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().isEnabled();
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -2439,13 +2362,8 @@
_data.writeInt(a);
_data.writeInt(b);
boolean _status = mRemote.transact(Stub.TRANSACTION_getState, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getState(a, b);
- }
- else {
- throw new RuntimeException("Method getState is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getState(a, b);
}
_reply.readException();
_result = _reply.readInt();
@@ -2464,13 +2382,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getAddress, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getAddress();
- }
- else {
- throw new RuntimeException("Method getAddress is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getAddress();
}
_reply.readException();
_result = _reply.readString();
@@ -2490,13 +2403,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getParcelables, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getParcelables();
- }
- else {
- throw new RuntimeException("Method getParcelables is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getParcelables();
}
_reply.readException();
_result = _reply.createTypedArray(android.foo.ExampleParcelable.CREATOR);
@@ -2519,13 +2427,8 @@
_data.writeInt(mode);
_data.writeInt(duration);
boolean _status = mRemote.transact(Stub.TRANSACTION_setScanMode, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().setScanMode(mode, duration);
- }
- else {
- throw new RuntimeException("Method setScanMode is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().setScanMode(mode, duration);
}
_reply.readException();
_result = (0!=_reply.readInt());
@@ -2546,14 +2449,9 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((foo!=null))?(foo.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_registerBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- getDefaultImpl().registerBinder(foo);
- return;
- }
- else {
- throw new RuntimeException("Method registerBinder is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ getDefaultImpl().registerBinder(foo);
+ return;
}
_reply.readException();
}
@@ -2570,13 +2468,8 @@
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getRecursiveBinder, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().getRecursiveBinder();
- }
- else {
- throw new RuntimeException("Method getRecursiveBinder is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().getRecursiveBinder();
}
_reply.readException();
_result = android.test.IExampleInterface.Stub.asInterface(_reply.readStrongBinder());
@@ -2596,13 +2489,8 @@
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((arg!=null))?(arg.asBinder()):(null)));
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAnInterface, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAnInterface(arg);
- }
- else {
- throw new RuntimeException("Method takesAnInterface is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAnInterface(arg);
}
_reply.readException();
_result = _reply.readInt();
@@ -2635,13 +2523,8 @@
_data.writeInt(0);
}
boolean _status = mRemote.transact(Stub.TRANSACTION_takesAParcelable, _data, _reply, 0);
- if (!_status) {
- if (getDefaultImpl() != null) {
- return getDefaultImpl().takesAParcelable(arg, arg2);
- }
- else {
- throw new RuntimeException("Method takesAParcelable is unimplemented.");
- }
+ if (!_status && getDefaultImpl() != null) {
+ return getDefaultImpl().takesAParcelable(arg, arg2);
}
_reply.readException();
_result = _reply.readInt();