From df817661fdb6dbdc138899922d442cbb28b0c763 Mon Sep 17 00:00:00 2001 From: Tornaco Date: Mon, 20 May 2024 20:24:24 +0800 Subject: [PATCH] build on mac --- .../licensing/ILicenseResultListener.java | 33 +- .../vending/licensing/ILicensingService.java | 35 +- .../android/thanos/core/IPluginLogger.java | 54 +- .../tornaco/android/thanos/core/IPrinter.java | 40 +- .../tornaco/android/thanos/core/IThanos.java | 328 ++- .../android/thanos/core/IThanosProvider.java | 34 +- .../thanos/core/app/IActivityManager.java | 1757 ++++++++++++++--- .../activity/IActivityLifecycleListener.java | 65 +- .../activity/IActivityStackSupervisor.java | 496 +++-- .../activity/ITopPackageChangeListener.java | 80 +- .../core/app/activity/IVerifyCallback.java | 33 +- .../core/app/event/IEventSubscriber.java | 65 +- .../app/infinite/IAddPackageCallback.java | 40 +- .../core/app/infinite/IEnableCallback.java | 40 +- .../app/infinite/ILaunchPackageCallback.java | 40 +- .../app/infinite/IRemovePackageCallback.java | 40 +- .../thanos/core/app/infinite/InfiniteZ.java | 111 +- .../core/app/usage/IUsageStatsManager.java | 86 +- .../thanos/core/audio/IAudioManager.java | 64 +- .../thanos/core/backup/IBackupAgent.java | 88 +- .../thanos/core/backup/IBackupCallback.java | 54 +- .../core/backup/IFileDescriptorConsumer.java | 71 +- .../backup/IFileDescriptorInitializer.java | 36 +- .../thanos/core/input/IInputManager.java | 81 +- .../thanos/core/n/INotificationManager.java | 480 ++++- .../thanos/core/n/INotificationObserver.java | 135 +- .../thanos/core/net/INetworkManager.java | 64 +- .../tornaco/android/thanos/core/ops/IOps.java | 144 +- .../thanos/core/os/IServiceManager.java | 45 +- .../android/thanos/core/plus/ICallback.java | 65 +- .../tornaco/android/thanos/core/plus/IRS.java | 51 +- .../thanos/core/pm/IAddPluginCallback.java | 47 +- .../pm/IPackageEnableStateChangeListener.java | 64 +- .../core/pm/IPackageSetChangeListener.java | 47 +- .../android/thanos/core/pm/IPkgManager.java | 987 +++++++-- .../thanos/core/power/IPowerManager.java | 232 ++- .../thanos/core/pref/IPrefChangeListener.java | 33 +- .../thanos/core/pref/IPrefManager.java | 90 +- .../android/thanos/core/profile/ILogSink.java | 33 +- .../thanos/core/profile/IProfileManager.java | 684 +++++-- .../thanos/core/profile/IRuleAddCallback.java | 40 +- .../core/profile/IRuleChangeListener.java | 54 +- .../core/profile/IRuleCheckCallback.java | 74 +- .../thanos/core/push/IChannelHandler.java | 65 +- .../thanos/core/push/IPushManager.java | 109 +- .../push/wechat/IPushDelegateManager.java | 159 +- .../thanos/core/secure/IPrivacyManager.java | 318 ++- .../core/secure/ops/IAppOpsService.java | 206 +- .../tornaco/android/thanos/core/su/ISu.java | 64 +- .../thanos/core/wm/IWindowManager.java | 95 +- 50 files changed, 6020 insertions(+), 2136 deletions(-) diff --git a/android/android_framework/base/src/main/java/com/android/vending/licensing/ILicenseResultListener.java b/android/android_framework/base/src/main/java/com/android/vending/licensing/ILicenseResultListener.java index 8f75d010a..d8cb15aa5 100644 --- a/android/android_framework/base/src/main/java/com/android/vending/licensing/ILicenseResultListener.java +++ b/android/android_framework/base/src/main/java/com/android/vending/licensing/ILicenseResultListener.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements com.android.vending.licensing.ILicenseResultListener { + private static final java.lang.String DESCRIPTOR = "com.android.vending.licensing.ILicenseResultListener"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static com.android.vending.licensing.ILicenseResultListener asInterface(a @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,11 +53,9 @@ public static com.android.vending.licensing.ILicenseResultListener asInterface(a reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_verifyLicense: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; @@ -67,14 +63,13 @@ public static com.android.vending.licensing.ILicenseResultListener asInterface(a java.lang.String _arg2; _arg2 = data.readString(); this.verifyLicense(_arg0, _arg1, _arg2); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements com.android.vending.licensing.ILicenseResultListener { @@ -100,14 +95,34 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(signedData); _data.writeString(signature); boolean _status = mRemote.transact(Stub.TRANSACTION_verifyLicense, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().verifyLicense(responseCode, signedData, signature); + return; + } } finally { _data.recycle(); } } + public static com.android.vending.licensing.ILicenseResultListener sDefaultImpl; } static final int TRANSACTION_verifyLicense = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); + public static boolean setDefaultImpl(com.android.vending.licensing.ILicenseResultListener impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static com.android.vending.licensing.ILicenseResultListener getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "com.android.vending.licensing.ILicenseResultListener"; public void verifyLicense(int responseCode, java.lang.String signedData, java.lang.String signature) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/com/android/vending/licensing/ILicensingService.java b/android/android_framework/base/src/main/java/com/android/vending/licensing/ILicensingService.java index 16620db02..e22a2fe29 100644 --- a/android/android_framework/base/src/main/java/com/android/vending/licensing/ILicensingService.java +++ b/android/android_framework/base/src/main/java/com/android/vending/licensing/ILicensingService.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements com.android.vending.licensing.ILicensingService { + private static final java.lang.String DESCRIPTOR = "com.android.vending.licensing.ILicensingService"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static com.android.vending.licensing.ILicensingService asInterface(androi @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,11 +53,9 @@ public static com.android.vending.licensing.ILicensingService asInterface(androi reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_checkLicense: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); java.lang.String _arg1; @@ -67,14 +63,13 @@ public static com.android.vending.licensing.ILicensingService asInterface(androi com.android.vending.licensing.ILicenseResultListener _arg2; _arg2 = com.android.vending.licensing.ILicenseResultListener.Stub.asInterface(data.readStrongBinder()); this.checkLicense(_arg0, _arg1, _arg2); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements com.android.vending.licensing.ILicensingService { @@ -98,16 +93,36 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeLong(nonce); _data.writeString(packageName); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_checkLicense, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().checkLicense(nonce, packageName, listener); + return; + } } finally { _data.recycle(); } } + public static com.android.vending.licensing.ILicensingService sDefaultImpl; } static final int TRANSACTION_checkLicense = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); + public static boolean setDefaultImpl(com.android.vending.licensing.ILicensingService impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static com.android.vending.licensing.ILicensingService getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "com.android.vending.licensing.ILicensingService"; public void checkLicense(long nonce, java.lang.String packageName, com.android.vending.licensing.ILicenseResultListener listener) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IPluginLogger.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IPluginLogger.java index c00a5c435..f3e1ffd3e 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IPluginLogger.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IPluginLogger.java @@ -27,6 +27,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.IPluginLogger { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.IPluginLogger"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -54,9 +55,6 @@ public static github.tornaco.android.thanos.core.IPluginLogger asInterface(andro @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -64,47 +62,47 @@ public static github.tornaco.android.thanos.core.IPluginLogger asInterface(andro reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_logV: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.logV(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_logD: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.logD(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_logW: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.logW(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_logE: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.logE(_arg0); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.IPluginLogger { @@ -129,6 +127,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(content); boolean _status = mRemote.transact(Stub.TRANSACTION_logV, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().logV(content); + return; + } _reply.readException(); } finally { @@ -144,6 +146,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(content); boolean _status = mRemote.transact(Stub.TRANSACTION_logD, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().logD(content); + return; + } _reply.readException(); } finally { @@ -159,6 +165,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(content); boolean _status = mRemote.transact(Stub.TRANSACTION_logW, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().logW(content); + return; + } _reply.readException(); } finally { @@ -174,6 +184,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(content); boolean _status = mRemote.transact(Stub.TRANSACTION_logE, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().logE(content); + return; + } _reply.readException(); } finally { @@ -181,13 +195,29 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.IPluginLogger sDefaultImpl; } static final int TRANSACTION_logV = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_logD = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_logW = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_logE = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.IPluginLogger impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.IPluginLogger getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.IPluginLogger"; public void logV(java.lang.String content) throws android.os.RemoteException; public void logD(java.lang.String content) throws android.os.RemoteException; public void logW(java.lang.String content) throws android.os.RemoteException; diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IPrinter.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IPrinter.java index a98d31aa7..2a19ad73b 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IPrinter.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IPrinter.java @@ -21,6 +21,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.IPrinter { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.IPrinter"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -48,9 +49,6 @@ public static github.tornaco.android.thanos.core.IPrinter asInterface(android.os @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -58,31 +56,29 @@ public static github.tornaco.android.thanos.core.IPrinter asInterface(android.os reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_println: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.println(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_print: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.print(_arg0); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.IPrinter { @@ -107,6 +103,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(content); boolean _status = mRemote.transact(Stub.TRANSACTION_println, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().println(content); + return; + } _reply.readException(); } finally { @@ -122,6 +122,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(content); boolean _status = mRemote.transact(Stub.TRANSACTION_print, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().print(content); + return; + } _reply.readException(); } finally { @@ -129,11 +133,27 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.IPrinter sDefaultImpl; } static final int TRANSACTION_println = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_print = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.IPrinter impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.IPrinter getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.IPrinter"; public void println(java.lang.String content) throws android.os.RemoteException; public void print(java.lang.String content) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IThanos.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IThanos.java index 4de5a8cdc..5dd70f36e 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IThanos.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IThanos.java @@ -3,6 +3,7 @@ */ package github.tornaco.android.thanos.core; // DO NOT CHANGE ORDER. + public interface IThanos extends android.os.IInterface { /** Default implementation for IThanos. */ @@ -144,6 +145,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.IThanos { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.IThanos"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -171,9 +173,6 @@ public static github.tornaco.android.thanos.core.IThanos asInterface(android.os. @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -181,256 +180,295 @@ public static github.tornaco.android.thanos.core.IThanos asInterface(android.os. reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_getServiceManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.os.IServiceManager _result = this.getServiceManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getPrefManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pref.IPrefManager _result = this.getPrefManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getActivityManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.IActivityManager _result = this.getActivityManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getPkgManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.IPkgManager _result = this.getPkgManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getActivityStackSupervisor: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor _result = this.getActivityStackSupervisor(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getPrivacyManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.secure.IPrivacyManager _result = this.getPrivacyManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getAppOpsService: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.secure.ops.IAppOpsService _result = this.getAppOpsService(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getPushManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.push.IPushManager _result = this.getPushManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getNotificationManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.n.INotificationManager _result = this.getNotificationManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getAudioManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.audio.IAudioManager _result = this.getAudioManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getProfileManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.IProfileManager _result = this.getProfileManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getBackupAgent: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.backup.IBackupAgent _result = this.getBackupAgent(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getWindowManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.wm.IWindowManager _result = this.getWindowManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getPowerManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.power.IPowerManager _result = this.getPowerManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getInputManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.input.IInputManager _result = this.getInputManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_registerEventSubscriber: { + data.enforceInterface(descriptor); android.content.IntentFilter _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.IntentFilter.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.IntentFilter.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } github.tornaco.android.thanos.core.app.event.IEventSubscriber _arg1; _arg1 = github.tornaco.android.thanos.core.app.event.IEventSubscriber.Stub.asInterface(data.readStrongBinder()); this.registerEventSubscriber(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_unRegisterEventSubscriber: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.event.IEventSubscriber _arg0; _arg0 = github.tornaco.android.thanos.core.app.event.IEventSubscriber.Stub.asInterface(data.readStrongBinder()); this.unRegisterEventSubscriber(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_fingerPrint: { + data.enforceInterface(descriptor); java.lang.String _result = this.fingerPrint(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getVersionName: { + data.enforceInterface(descriptor); java.lang.String _result = this.getVersionName(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_whoAreYou: { + data.enforceInterface(descriptor); java.lang.String _result = this.whoAreYou(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_isLoggingEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isLoggingEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setLoggingEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setLoggingEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_hasFeature: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.hasFeature(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_hasFrameworkInitializeError: { + data.enforceInterface(descriptor); boolean _result = this.hasFrameworkInitializeError(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getPluginLogger: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.IPluginLogger _result = this.getPluginLogger(_arg0); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getInfiniteZ: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.infinite.InfiniteZ _result = this.getInfiniteZ(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getPatchingSource: { + data.enforceInterface(descriptor); java.util.List _result = this.getPatchingSource(); reply.writeNoException(); reply.writeStringList(_result); - break; + return true; } case TRANSACTION_getRS: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.plus.IRS _result = this.getRS(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getUsageStatsManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.usage.IUsageStatsManager _result = this.getUsageStatsManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getPushDelegateManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager _result = this.getPushDelegateManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getNetworkManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.net.INetworkManager _result = this.getNetworkManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_getOpsManager: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.ops.IOps _result = this.getOpsManager(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } case TRANSACTION_writeLogsTo: { + data.enforceInterface(descriptor); android.os.ParcelFileDescriptor _arg0; - _arg0 = _Parcel.readTypedObject(data, android.os.ParcelFileDescriptor.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.writeLogsTo(_arg0); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.IThanos { @@ -455,6 +493,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getServiceManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getServiceManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.os.IServiceManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -472,6 +513,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPrefManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPrefManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.pref.IPrefManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -489,6 +533,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getActivityManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getActivityManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.app.IActivityManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -506,6 +553,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPkgManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPkgManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.pm.IPkgManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -523,6 +573,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getActivityStackSupervisor, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getActivityStackSupervisor(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor.Stub.asInterface(_reply.readStrongBinder()); } @@ -540,6 +593,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPrivacyManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPrivacyManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.secure.IPrivacyManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -557,6 +613,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAppOpsService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAppOpsService(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.secure.ops.IAppOpsService.Stub.asInterface(_reply.readStrongBinder()); } @@ -574,6 +633,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPushManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPushManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.push.IPushManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -591,6 +653,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getNotificationManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getNotificationManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.n.INotificationManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -608,6 +673,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAudioManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAudioManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.audio.IAudioManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -625,6 +693,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getProfileManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getProfileManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.profile.IProfileManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -642,6 +713,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getBackupAgent, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getBackupAgent(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.backup.IBackupAgent.Stub.asInterface(_reply.readStrongBinder()); } @@ -659,6 +733,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getWindowManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getWindowManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.wm.IWindowManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -676,6 +753,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPowerManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPowerManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.power.IPowerManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -693,6 +773,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getInputManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getInputManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.input.IInputManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -708,9 +791,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, filter, 0); - _data.writeStrongInterface(subscriber); + if ((filter!=null)) { + _data.writeInt(1); + filter.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } + _data.writeStrongBinder((((subscriber!=null))?(subscriber.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_registerEventSubscriber, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().registerEventSubscriber(filter, subscriber); + return; + } _reply.readException(); } finally { @@ -724,8 +817,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(subscriber); + _data.writeStrongBinder((((subscriber!=null))?(subscriber.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterEventSubscriber, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unRegisterEventSubscriber(subscriber); + return; + } _reply.readException(); } finally { @@ -741,6 +838,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_fingerPrint, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().fingerPrint(); + } _reply.readException(); _result = _reply.readString(); } @@ -758,6 +858,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getVersionName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getVersionName(); + } _reply.readException(); _result = _reply.readString(); } @@ -775,6 +878,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_whoAreYou, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().whoAreYou(); + } _reply.readException(); _result = _reply.readString(); } @@ -792,6 +898,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isLoggingEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isLoggingEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -809,6 +918,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setLoggingEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setLoggingEnabled(enable); + return; + } _reply.readException(); } finally { @@ -825,6 +938,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(feature); boolean _status = mRemote.transact(Stub.TRANSACTION_hasFeature, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasFeature(feature); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -842,6 +958,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_hasFrameworkInitializeError, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasFrameworkInitializeError(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -860,6 +979,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pluginAlias); boolean _status = mRemote.transact(Stub.TRANSACTION_getPluginLogger, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPluginLogger(pluginAlias); + } _reply.readException(); _result = github.tornaco.android.thanos.core.IPluginLogger.Stub.asInterface(_reply.readStrongBinder()); } @@ -877,6 +999,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getInfiniteZ, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getInfiniteZ(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.app.infinite.InfiniteZ.Stub.asInterface(_reply.readStrongBinder()); } @@ -894,6 +1019,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPatchingSource, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPatchingSource(); + } _reply.readException(); _result = _reply.createStringArrayList(); } @@ -911,6 +1039,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getRS, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRS(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.plus.IRS.Stub.asInterface(_reply.readStrongBinder()); } @@ -928,6 +1059,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getUsageStatsManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getUsageStatsManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.app.usage.IUsageStatsManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -945,6 +1079,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPushDelegateManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPushDelegateManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -962,6 +1099,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getNetworkManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getNetworkManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.net.INetworkManager.Stub.asInterface(_reply.readStrongBinder()); } @@ -979,6 +1119,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getOpsManager, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOpsManager(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.ops.IOps.Stub.asInterface(_reply.readStrongBinder()); } @@ -994,8 +1137,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pfd, 0); + if ((pfd!=null)) { + _data.writeInt(1); + pfd.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_writeLogsTo, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().writeLogsTo(pfd); + return; + } _reply.readException(); } finally { @@ -1003,6 +1156,7 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.IThanos sDefaultImpl; } static final int TRANSACTION_getServiceManager = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_getPrefManager = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -1037,8 +1191,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_getNetworkManager = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30); static final int TRANSACTION_getOpsManager = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31); static final int TRANSACTION_writeLogsTo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 32); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.IThanos impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.IThanos getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.IThanos"; public github.tornaco.android.thanos.core.os.IServiceManager getServiceManager() throws android.os.RemoteException; public github.tornaco.android.thanos.core.pref.IPrefManager getPrefManager() throws android.os.RemoteException; public github.tornaco.android.thanos.core.app.IActivityManager getActivityManager() throws android.os.RemoteException; @@ -1072,25 +1241,4 @@ public java.lang.String getInterfaceDescriptor() public github.tornaco.android.thanos.core.net.INetworkManager getNetworkManager() throws android.os.RemoteException; public github.tornaco.android.thanos.core.ops.IOps getOpsManager() throws android.os.RemoteException; public void writeLogsTo(android.os.ParcelFileDescriptor pfd) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IThanosProvider.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IThanosProvider.java index 5ed2887d6..8f7bd8a6d 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IThanosProvider.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/IThanosProvider.java @@ -19,6 +19,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.IThanosProvider { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.IThanosProvider"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -46,9 +47,6 @@ public static github.tornaco.android.thanos.core.IThanosProvider asInterface(and @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -56,22 +54,19 @@ public static github.tornaco.android.thanos.core.IThanosProvider asInterface(and reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_getThanos: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.IThanos _result = this.getThanos(); reply.writeNoException(); - reply.writeStrongInterface(_result); - break; + reply.writeStrongBinder((((_result!=null))?(_result.asBinder()):(null))); + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.IThanosProvider { @@ -96,6 +91,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getThanos, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getThanos(); + } _reply.readException(); _result = github.tornaco.android.thanos.core.IThanos.Stub.asInterface(_reply.readStrongBinder()); } @@ -105,9 +103,25 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.IThanosProvider sDefaultImpl; } static final int TRANSACTION_getThanos = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.IThanosProvider impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.IThanosProvider getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.IThanosProvider"; public github.tornaco.android.thanos.core.IThanos getThanos() throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/IActivityManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/IActivityManager.java index 573e12cf0..7ffc2c6f1 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/IActivityManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/IActivityManager.java @@ -89,6 +89,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA return 0L; } // 启动管理设置 + @Override public boolean isStartBlockEnabled() throws android.os.RemoteException { return false; @@ -104,6 +105,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA return false; } // Task removal + @Override public boolean isCleanUpOnTaskRemovalEnabled() throws android.os.RemoteException { return false; @@ -119,6 +121,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA return false; } // 后台运行设置 + @Override public boolean isBgRestrictEnabled() throws android.os.RemoteException { return false; @@ -141,6 +144,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA return false; } // Task blur + @Override public boolean isRecentTaskBlurEnabled() throws android.os.RemoteException { return false; @@ -156,6 +160,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA return false; } // Audio focused app. + @Override public boolean isBgTaskCleanUpSkipAudioFocusedAppEnabled() throws android.os.RemoteException { return false; @@ -164,6 +169,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA { } // Notification record app. + @Override public boolean isBgTaskCleanUpSkipWhichHasNotificationEnabled() throws android.os.RemoteException { return false; @@ -172,6 +178,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA { } // 后台运行锁屏清理延迟 + @Override public void setBgTaskCleanUpDelayTimeMills(long delayMills) throws android.os.RemoteException { } @@ -227,6 +234,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA { } // Keep when has recent task. + @Override public boolean isBgTaskCleanUpSkipWhenHasRecentTaskEnabled() throws android.os.RemoteException { return false; @@ -382,6 +390,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA // https://source.android.com/devices/tech/perf/cached-apps-freezer // // ****************************************************************** + @Override public boolean isCachedAppsFreezerSupported() throws android.os.RemoteException { return false; @@ -422,6 +431,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA // Block Receiver/Service/Provider all the time, event the package is running at foreground, // may cause the app crash. // ****************************************************************** + @Override public void setBlockAllReceiver(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean block) throws android.os.RemoteException { } @@ -444,6 +454,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA return false; } // Return 0 if it fail + @Override public long getProcessStartTime(int pid) throws android.os.RemoteException { return 0L; @@ -471,12 +482,12 @@ public static class Default implements github.tornaco.android.thanos.core.app.IA @Override public void setBgTaskCleanUpSkipForegroundEnabled(boolean enable) throws android.os.RemoteException { } - /** return the pid of process. or -1 if no process found */ + /* return the pid of process. or -1 if no process found */ @Override public int getPid(github.tornaco.android.thanos.core.os.ProcessName processName) throws android.os.RemoteException { return 0; } - /** return the pid of killed process. or -1 if no process found */ + /* return the pid of killed process. or -1 if no process found */ @Override public int killProcessByName(github.tornaco.android.thanos.core.os.ProcessName processName) throws android.os.RemoteException { return 0; @@ -529,6 +540,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.IActivityManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.IActivityManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -556,9 +568,6 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -566,58 +575,91 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_getCurrentFrontApp: { + data.enforceInterface(descriptor); java.lang.String _result = this.getCurrentFrontApp(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_forceStopPackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); this.forceStopPackage(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_idlePackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.idlePackage(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPackageIdle: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPackageIdle(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_checkBroadcastingIntent: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.checkBroadcastingIntent(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_checkService: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } android.content.ComponentName _arg1; - _arg1 = _Parcel.readTypedObject(data, android.content.ComponentName.CREATOR); + if ((0!=data.readInt())) { + _arg1 = android.content.ComponentName.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } int _arg2; _arg2 = data.readInt(); int _arg3; @@ -625,23 +667,35 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac boolean _result = this.checkService(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_checkRestartService: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.content.ComponentName _arg1; - _arg1 = _Parcel.readTypedObject(data, android.content.ComponentName.CREATOR); + if ((0!=data.readInt())) { + _arg1 = android.content.ComponentName.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } boolean _result = this.checkRestartService(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_checkBroadcast: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); int _arg2; @@ -649,14 +703,20 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac boolean _result = this.checkBroadcast(_arg0, _arg1, _arg2); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_checkStartProcess: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.content.pm.ApplicationInfo _arg1; - _arg1 = _Parcel.readTypedObject(data, android.content.pm.ApplicationInfo.CREATOR); + if ((0!=data.readInt())) { + _arg1 = android.content.pm.ApplicationInfo.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } java.lang.String _arg2; _arg2 = data.readString(); java.lang.String _arg3; @@ -664,532 +724,693 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac boolean _result = this.checkStartProcess(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_onStartProcessLocked: { + data.enforceInterface(descriptor); android.content.pm.ApplicationInfo _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.pm.ApplicationInfo.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.pm.ApplicationInfo.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onStartProcessLocked(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getRunningAppProcess: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.process.ProcessRecord[] _result = this.getRunningAppProcess(); reply.writeNoException(); reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + return true; } case TRANSACTION_getRunningAppPackages: { + data.enforceInterface(descriptor); java.util.List _result = this.getRunningAppPackages(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getRunningServiceLegacy: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.util.List _result = this.getRunningServiceLegacy(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getRunningAppProcessLegacy: { + data.enforceInterface(descriptor); java.util.List _result = this.getRunningAppProcessLegacy(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getRunningAppsCount: { + data.enforceInterface(descriptor); int _result = this.getRunningAppsCount(); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_getRunningAppProcessForPackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.util.List _result = this.getRunningAppProcessForPackage(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_isPackageRunning: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPackageRunning(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getStartRecordsByPackageName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.util.List _result = this.getStartRecordsByPackageName(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getStartRecordBlockedPackages: { + data.enforceInterface(descriptor); java.util.List _result = this.getStartRecordBlockedPackages(); reply.writeNoException(); reply.writeStringList(_result); - break; + return true; } case TRANSACTION_getStartRecordsBlockedCount: { + data.enforceInterface(descriptor); long _result = this.getStartRecordsBlockedCount(); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_getStartRecordBlockedCountByPackageName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); long _result = this.getStartRecordBlockedCountByPackageName(_arg0); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_isStartBlockEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isStartBlockEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setStartBlockEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setStartBlockEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPkgStartBlockEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgStartBlockEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPkgStartBlocking: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPkgStartBlocking(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isCleanUpOnTaskRemovalEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isCleanUpOnTaskRemovalEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setCleanUpOnTaskRemovalEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setCleanUpOnTaskRemovalEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPkgCleanUpOnTaskRemovalEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgCleanUpOnTaskRemovalEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPkgCleanUpOnTaskRemovalEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPkgCleanUpOnTaskRemovalEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isBgRestrictEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isBgRestrictEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setBgRestrictEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setBgRestrictEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPkgBgRestrictEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgBgRestrictEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPkgBgRestricted: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPkgBgRestricted(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setBgRestrictNotificationEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setBgRestrictNotificationEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isBgRestrictNotificationEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isBgRestrictNotificationEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isRecentTaskBlurEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isRecentTaskBlurEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setRecentTaskBlurEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setRecentTaskBlurEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPkgRecentTaskBlurEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgRecentTaskBlurEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPkgRecentTaskBlurEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPkgRecentTaskBlurEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isBgTaskCleanUpSkipAudioFocusedAppEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isBgTaskCleanUpSkipAudioFocusedAppEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setBgTaskCleanUpSkipAudioFocusedAppEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setBgTaskCleanUpSkipAudioFocusedAppEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isBgTaskCleanUpSkipWhichHasNotificationEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isBgTaskCleanUpSkipWhichHasNotificationEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setBgTaskCleanUpSkipWhichHasNotificationEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setBgTaskCleanUpSkipWhichHasNotificationEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setBgTaskCleanUpDelayTimeMills: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); this.setBgTaskCleanUpDelayTimeMills(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getBgTaskCleanUpDelayTimeMills: { + data.enforceInterface(descriptor); long _result = this.getBgTaskCleanUpDelayTimeMills(); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_notifyTaskCreated: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); android.content.ComponentName _arg1; - _arg1 = _Parcel.readTypedObject(data, android.content.ComponentName.CREATOR); + if ((0!=data.readInt())) { + _arg1 = android.content.ComponentName.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } this.notifyTaskCreated(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getMemoryInfo: { + data.enforceInterface(descriptor); android.app.ActivityManager.MemoryInfo _result = this.getMemoryInfo(); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_getProcessPss: { + data.enforceInterface(descriptor); int[] _arg0; _arg0 = data.createIntArray(); long[] _result = this.getProcessPss(_arg0); reply.writeNoException(); reply.writeLongArray(_result); - break; + return true; } case TRANSACTION_onApplicationCrashing: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); github.tornaco.android.thanos.core.process.ProcessRecord _arg2; - _arg2 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.process.ProcessRecord.CREATOR); + if ((0!=data.readInt())) { + _arg2 = github.tornaco.android.thanos.core.process.ProcessRecord.CREATOR.createFromParcel(data); + } + else { + _arg2 = null; + } java.lang.String _arg3; _arg3 = data.readString(); this.onApplicationCrashing(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - break; + return true; } case TRANSACTION_getPackageNameForTaskId: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.getPackageNameForTaskId(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_isPlatformAppIdleEnabled: { + data.enforceInterface(descriptor); int _result = this.isPlatformAppIdleEnabled(); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_isSmartStandByEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSmartStandByEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSmartStandByEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartStandByEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPkgSmartStandByEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgSmartStandByEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPkgSmartStandByEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPkgSmartStandByEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getLastRecentUsedPackages: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.util.List _result = this.getLastRecentUsedPackages(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getRecentTaskExcludeSettingForPackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _result = this.getRecentTaskExcludeSettingForPackage(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_setRecentTaskExcludeSettingForPackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); this.setRecentTaskExcludeSettingForPackage(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isBgTaskCleanUpSkipWhenHasRecentTaskEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isBgTaskCleanUpSkipWhenHasRecentTaskEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setBgTaskCleanUpSkipWhenHasRecentTaskEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setBgTaskCleanUpSkipWhenHasRecentTaskEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_launchAppDetailsActivity: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.launchAppDetailsActivity(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_resetStartRecordsBlocked: { + data.enforceInterface(descriptor); this.resetStartRecordsBlocked(); reply.writeNoException(); - break; + return true; } case TRANSACTION_addApp: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.addApp(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isStartRuleEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isStartRuleEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setStartRuleEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setStartRuleEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_addStartRule: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.addStartRule(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_deleteStartRule: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.deleteStartRule(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAllStartRules: { + data.enforceInterface(descriptor); java.lang.String[] _result = this.getAllStartRules(); reply.writeNoException(); reply.writeStringArray(_result); - break; + return true; } case TRANSACTION_isStandbyRuleEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isStandbyRuleEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setStandbyRuleEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setStandbyRuleEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_addStandbyRule: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.addStandbyRule(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_deleteStandbyRule: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.deleteStandbyRule(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAllStandbyRules: { + data.enforceInterface(descriptor); java.lang.String[] _result = this.getAllStandbyRules(); reply.writeNoException(); reply.writeStringArray(_result); - break; + return true; } case TRANSACTION_getRunningAppServiceForPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; @@ -1197,10 +1418,11 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac github.tornaco.android.thanos.core.app.RunningServiceInfoCompat[] _result = this.getRunningAppServiceForPackage(_arg0, _arg1); reply.writeNoException(); reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + return true; } case TRANSACTION_hasRunningServiceForPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; @@ -1208,144 +1430,178 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac boolean _result = this.hasRunningServiceForPackage(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getUserInfo: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); android.content.pm.UserInfo _result = this.getUserInfo(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_stopService: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.stopService(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_killBackgroundProcesses: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.killBackgroundProcesses(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isSmartStandByStopServiceEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSmartStandByStopServiceEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSmartStandByStopServiceEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartStandByStopServiceEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isSmartStandByInactiveEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSmartStandByInactiveEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSmartStandByInactiveEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartStandByInactiveEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isSmartStandByByPassIfHasNotificationEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSmartStandByByPassIfHasNotificationEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSmartStandByByPassIfHasNotificationEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartStandByByPassIfHasNotificationEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isSmartStandByBlockBgServiceStartEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSmartStandByBlockBgServiceStartEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSmartStandByBlockBgServiceStartEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartStandByBlockBgServiceStartEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getStartRecordAllowedPackages: { + data.enforceInterface(descriptor); java.util.List _result = this.getStartRecordAllowedPackages(); reply.writeNoException(); reply.writeStringList(_result); - break; + return true; } case TRANSACTION_getStartRecordsAllowedCount: { + data.enforceInterface(descriptor); long _result = this.getStartRecordsAllowedCount(); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_getStartRecordAllowedCountByPackageName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); long _result = this.getStartRecordAllowedCountByPackageName(_arg0); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_getStartRecordsAllowedByPackageName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.util.List _result = this.getStartRecordsAllowedByPackageName(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getStartRecordsBlockedByPackageName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.util.List _result = this.getStartRecordsBlockedByPackageName(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_resetStartRecordsAllowed: { + data.enforceInterface(descriptor); this.resetStartRecordsAllowed(); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAllStartRecordsWithRes: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _arg1; @@ -1354,51 +1610,57 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac _arg2 = (0!=data.readInt()); java.util.List _result = this.getAllStartRecordsWithRes(_arg0, _arg1, _arg2); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getAllStartRecords: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.util.List _result = this.getAllStartRecords(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_dump: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.IPrinter _arg0; _arg0 = github.tornaco.android.thanos.core.IPrinter.Stub.asInterface(data.readStrongBinder()); this.dump(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_dumpCpu: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.IPrinter _arg0; _arg0 = github.tornaco.android.thanos.core.IPrinter.Stub.asInterface(data.readStrongBinder()); this.dumpCpu(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setNetStatTrackerEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setNetStatTrackerEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isNetStatTrackerEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isNetStatTrackerEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_checkGetContentProvider: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; @@ -1408,10 +1670,11 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac boolean _result = this.checkGetContentProvider(_arg0, _arg1, _arg2); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getAllStartRecordsForPackageSetWithRes: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; @@ -1420,67 +1683,85 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac _arg2 = (0!=data.readInt()); java.util.List _result = this.getAllStartRecordsForPackageSetWithRes(_arg0, _arg1, _arg2); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_isCachedAppsFreezerSupported: { + data.enforceInterface(descriptor); boolean _result = this.isCachedAppsFreezerSupported(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_freezeApp: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.freezeApp(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_unfreezeApp: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.unfreezeApp(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_freezeAppProcess: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); this.freezeAppProcess(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_unfreezeAppProcess: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); this.unfreezeAppProcess(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_updateProcessCpuUsageStats: { + data.enforceInterface(descriptor); this.updateProcessCpuUsageStats(); reply.writeNoException(); - break; + return true; } case TRANSACTION_queryProcessCpuUsageStats: { + data.enforceInterface(descriptor); long[] _arg0; _arg0 = data.createLongArray(); boolean _arg1; _arg1 = (0!=data.readInt()); java.util.List _result = this.queryProcessCpuUsageStats(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_queryCpuUsageRatio: { + data.enforceInterface(descriptor); long[] _arg0; _arg0 = data.createLongArray(); boolean _arg1; @@ -1488,264 +1769,378 @@ public static github.tornaco.android.thanos.core.app.IActivityManager asInterfac float _result = this.queryCpuUsageRatio(_arg0, _arg1); reply.writeNoException(); reply.writeFloat(_result); - break; + return true; } case TRANSACTION_killProcess: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); boolean _result = this.killProcess(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getSwapInfo: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.os.SwapInfo _result = this.getSwapInfo(); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_setBlockAllReceiver: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setBlockAllReceiver(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isBlockAllReceiver: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isBlockAllReceiver(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setBlockAllService: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setBlockAllService(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isBlockAllService: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isBlockAllService(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setBlockAllProvider: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setBlockAllProvider(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isBlockAllProvider: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isBlockAllProvider(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getProcessStartTime: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); long _result = this.getProcessStartTime(_arg0); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_isAppForeground: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isAppForeground(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_hasRunningForegroundService: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); boolean _result = this.hasRunningForegroundService(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getTopVisibleActivities: { + data.enforceInterface(descriptor); java.util.List _result = this.getTopVisibleActivities(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_checkStartActivity: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); boolean _result = this.checkStartActivity(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isBgTaskCleanUpSkipForegroundEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isBgTaskCleanUpSkipForegroundEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setBgTaskCleanUpSkipForegroundEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setBgTaskCleanUpSkipForegroundEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getPid: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.os.ProcessName _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.os.ProcessName.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.os.ProcessName.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _result = this.getPid(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_killProcessByName: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.os.ProcessName _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.os.ProcessName.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.os.ProcessName.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _result = this.killProcessByName(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_killProcessByNames: { + data.enforceInterface(descriptor); java.util.List _arg0; _arg0 = data.createTypedArrayList(github.tornaco.android.thanos.core.os.ProcessName.CREATOR); this.killProcessByNames(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_dumpHeap: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.dumpHeap(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getCurrentFrontPkg: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _result = this.getCurrentFrontPkg(); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_isSmartStandByByPassIfHasVisibleWindows: { + data.enforceInterface(descriptor); boolean _result = this.isSmartStandByByPassIfHasVisibleWindows(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSmartStandByByPassIfHasVisibleWindowsEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartStandByByPassIfHasVisibleWindowsEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getTotalCpuPercent: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); float _result = this.getTotalCpuPercent(_arg0); reply.writeNoException(); reply.writeFloat(_result); - break; + return true; } case TRANSACTION_getTopNCpuUsagePackages: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _arg1; _arg1 = (0!=data.readInt()); java.util.List _result = this.getTopNCpuUsagePackages(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_isPkgResident: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPkgResident(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setPkgResident: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgResident(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPkgRecentTaskBlurMode: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); this.setPkgRecentTaskBlurMode(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getPkgRecentTaskBlurMode: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _result = this.getPkgRecentTaskBlurMode(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.IActivityManager { @@ -1770,6 +2165,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getCurrentFrontApp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getCurrentFrontApp(); + } _reply.readException(); _result = _reply.readString(); } @@ -1785,9 +2183,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(reason); boolean _status = mRemote.transact(Stub.TRANSACTION_forceStopPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().forceStopPackage(pkg, reason); + return; + } _reply.readException(); } finally { @@ -1801,8 +2209,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_idlePackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().idlePackage(pkg); + return; + } _reply.readException(); } finally { @@ -1817,8 +2235,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPackageIdle, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPackageIdle(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1835,8 +2262,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_checkBroadcastingIntent, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkBroadcastingIntent(intent); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1853,11 +2289,26 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); - _Parcel.writeTypedObject(_data, service, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } + if ((service!=null)) { + _data.writeInt(1); + service.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(callerUid); _data.writeInt(userId); boolean _status = mRemote.transact(Stub.TRANSACTION_checkService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkService(intent, service, callerUid, userId); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1875,8 +2326,17 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); - _Parcel.writeTypedObject(_data, componentName, 0); + if ((componentName!=null)) { + _data.writeInt(1); + componentName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_checkRestartService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkRestartService(packageName, componentName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1893,10 +2353,19 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(receiverUid); _data.writeInt(callerUid); boolean _status = mRemote.transact(Stub.TRANSACTION_checkBroadcast, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkBroadcast(intent, receiverUid, callerUid); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1914,10 +2383,19 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(processName); - _Parcel.writeTypedObject(_data, applicationInfo, 0); + if ((applicationInfo!=null)) { + _data.writeInt(1); + applicationInfo.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(hostType); _data.writeString(hostName); boolean _status = mRemote.transact(Stub.TRANSACTION_checkStartProcess, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkStartProcess(processName, applicationInfo, hostType, hostName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1933,8 +2411,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, appInfo, 0); + if ((appInfo!=null)) { + _data.writeInt(1); + appInfo.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onStartProcessLocked, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onStartProcessLocked(appInfo); + return; + } _reply.readException(); } finally { @@ -1950,6 +2438,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getRunningAppProcess, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRunningAppProcess(); + } _reply.readException(); _result = _reply.createTypedArray(github.tornaco.android.thanos.core.process.ProcessRecord.CREATOR); } @@ -1967,6 +2458,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getRunningAppPackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRunningAppPackages(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.Pkg.CREATOR); } @@ -1985,6 +2479,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(max); boolean _status = mRemote.transact(Stub.TRANSACTION_getRunningServiceLegacy, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRunningServiceLegacy(max); + } _reply.readException(); _result = _reply.createTypedArrayList(android.app.ActivityManager.RunningServiceInfo.CREATOR); } @@ -2002,6 +2499,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getRunningAppProcessLegacy, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRunningAppProcessLegacy(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.RunningAppProcessInfoCompat.CREATOR); } @@ -2019,6 +2519,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getRunningAppsCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRunningAppsCount(); + } _reply.readException(); _result = _reply.readInt(); } @@ -2035,8 +2538,17 @@ public java.lang.String getInterfaceDescriptor() java.util.List _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getRunningAppProcessForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRunningAppProcessForPackage(pkg); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.process.ProcessRecord.CREATOR); } @@ -2053,8 +2565,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPackageRunning, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPackageRunning(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2073,6 +2594,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordsByPackageName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordsByPackageName(pkgName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.start.StartRecord.CREATOR); } @@ -2090,6 +2614,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordBlockedPackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordBlockedPackages(); + } _reply.readException(); _result = _reply.createStringArrayList(); } @@ -2107,6 +2634,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordsBlockedCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordsBlockedCount(); + } _reply.readException(); _result = _reply.readLong(); } @@ -2125,6 +2655,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordBlockedCountByPackageName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordBlockedCountByPackageName(pkgName); + } _reply.readException(); _result = _reply.readLong(); } @@ -2135,6 +2668,7 @@ public java.lang.String getInterfaceDescriptor() return _result; } // 启动管理设置 + @Override public boolean isStartBlockEnabled() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2143,6 +2677,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isStartBlockEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isStartBlockEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2160,6 +2697,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setStartBlockEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setStartBlockEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2173,9 +2714,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgStartBlockEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgStartBlockEnabled(pkg, enable); + return; + } _reply.readException(); } finally { @@ -2190,8 +2741,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgStartBlocking, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgStartBlocking(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2202,6 +2762,7 @@ public java.lang.String getInterfaceDescriptor() return _result; } // Task removal + @Override public boolean isCleanUpOnTaskRemovalEnabled() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2210,6 +2771,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isCleanUpOnTaskRemovalEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isCleanUpOnTaskRemovalEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2227,6 +2791,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setCleanUpOnTaskRemovalEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setCleanUpOnTaskRemovalEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2240,9 +2808,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgCleanUpOnTaskRemovalEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgCleanUpOnTaskRemovalEnabled(pkg, enable); + return; + } _reply.readException(); } finally { @@ -2257,8 +2835,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgCleanUpOnTaskRemovalEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgCleanUpOnTaskRemovalEnabled(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2269,6 +2856,7 @@ public java.lang.String getInterfaceDescriptor() return _result; } // 后台运行设置 + @Override public boolean isBgRestrictEnabled() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2277,6 +2865,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isBgRestrictEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBgRestrictEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2294,6 +2885,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBgRestrictEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBgRestrictEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2307,9 +2902,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgBgRestrictEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgBgRestrictEnabled(pkg, enable); + return; + } _reply.readException(); } finally { @@ -2324,8 +2929,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgBgRestricted, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgBgRestricted(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2343,6 +2957,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBgRestrictNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBgRestrictNotificationEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -2358,6 +2976,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isBgRestrictNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBgRestrictNotificationEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2368,6 +2989,7 @@ public java.lang.String getInterfaceDescriptor() return _result; } // Task blur + @Override public boolean isRecentTaskBlurEnabled() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2376,6 +2998,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isRecentTaskBlurEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isRecentTaskBlurEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2393,6 +3018,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setRecentTaskBlurEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setRecentTaskBlurEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2406,9 +3035,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgRecentTaskBlurEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgRecentTaskBlurEnabled(pkg, enable); + return; + } _reply.readException(); } finally { @@ -2423,8 +3062,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgRecentTaskBlurEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgRecentTaskBlurEnabled(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2435,6 +3083,7 @@ public java.lang.String getInterfaceDescriptor() return _result; } // Audio focused app. + @Override public boolean isBgTaskCleanUpSkipAudioFocusedAppEnabled() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2443,6 +3092,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isBgTaskCleanUpSkipAudioFocusedAppEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBgTaskCleanUpSkipAudioFocusedAppEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2460,6 +3112,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBgTaskCleanUpSkipAudioFocusedAppEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBgTaskCleanUpSkipAudioFocusedAppEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2468,6 +3124,7 @@ public java.lang.String getInterfaceDescriptor() } } // Notification record app. + @Override public boolean isBgTaskCleanUpSkipWhichHasNotificationEnabled() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2476,6 +3133,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isBgTaskCleanUpSkipWhichHasNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBgTaskCleanUpSkipWhichHasNotificationEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2493,6 +3153,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBgTaskCleanUpSkipWhichHasNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBgTaskCleanUpSkipWhichHasNotificationEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2501,6 +3165,7 @@ public java.lang.String getInterfaceDescriptor() } } // 后台运行锁屏清理延迟 + @Override public void setBgTaskCleanUpDelayTimeMills(long delayMills) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2509,6 +3174,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeLong(delayMills); boolean _status = mRemote.transact(Stub.TRANSACTION_setBgTaskCleanUpDelayTimeMills, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBgTaskCleanUpDelayTimeMills(delayMills); + return; + } _reply.readException(); } finally { @@ -2524,6 +3193,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getBgTaskCleanUpDelayTimeMills, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getBgTaskCleanUpDelayTimeMills(); + } _reply.readException(); _result = _reply.readLong(); } @@ -2540,8 +3212,18 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(taskId); - _Parcel.writeTypedObject(_data, componentName, 0); + if ((componentName!=null)) { + _data.writeInt(1); + componentName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_notifyTaskCreated, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().notifyTaskCreated(taskId, componentName); + return; + } _reply.readException(); } finally { @@ -2557,8 +3239,16 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getMemoryInfo, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getMemoryInfo(); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, android.app.ActivityManager.MemoryInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = android.app.ActivityManager.MemoryInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -2575,6 +3265,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeIntArray(pids); boolean _status = mRemote.transact(Stub.TRANSACTION_getProcessPss, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getProcessPss(pids); + } _reply.readException(); _result = _reply.createLongArray(); } @@ -2592,9 +3285,19 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(eventType); _data.writeString(processName); - _Parcel.writeTypedObject(_data, process, 0); + if ((process!=null)) { + _data.writeInt(1); + process.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(stackTrace); boolean _status = mRemote.transact(Stub.TRANSACTION_onApplicationCrashing, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onApplicationCrashing(eventType, processName, process, stackTrace); + return; + } _reply.readException(); } finally { @@ -2611,6 +3314,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(taskId); boolean _status = mRemote.transact(Stub.TRANSACTION_getPackageNameForTaskId, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPackageNameForTaskId(taskId); + } _reply.readException(); _result = _reply.readString(); } @@ -2628,6 +3334,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isPlatformAppIdleEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPlatformAppIdleEnabled(); + } _reply.readException(); _result = _reply.readInt(); } @@ -2645,6 +3354,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartStandByEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartStandByEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2662,6 +3374,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartStandByEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartStandByEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2675,9 +3391,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgSmartStandByEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgSmartStandByEnabled(pkg, enable); + return; + } _reply.readException(); } finally { @@ -2692,8 +3418,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgSmartStandByEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgSmartStandByEnabled(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2712,6 +3447,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(count); boolean _status = mRemote.transact(Stub.TRANSACTION_getLastRecentUsedPackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getLastRecentUsedPackages(count); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.Pkg.CREATOR); } @@ -2728,8 +3466,17 @@ public java.lang.String getInterfaceDescriptor() int _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getRecentTaskExcludeSettingForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRecentTaskExcludeSettingForPackage(pkg); + } _reply.readException(); _result = _reply.readInt(); } @@ -2745,9 +3492,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(setting); boolean _status = mRemote.transact(Stub.TRANSACTION_setRecentTaskExcludeSettingForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setRecentTaskExcludeSettingForPackage(pkg, setting); + return; + } _reply.readException(); } finally { @@ -2756,6 +3513,7 @@ public java.lang.String getInterfaceDescriptor() } } // Keep when has recent task. + @Override public boolean isBgTaskCleanUpSkipWhenHasRecentTaskEnabled() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2764,6 +3522,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isBgTaskCleanUpSkipWhenHasRecentTaskEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBgTaskCleanUpSkipWhenHasRecentTaskEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2781,6 +3542,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBgTaskCleanUpSkipWhenHasRecentTaskEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBgTaskCleanUpSkipWhenHasRecentTaskEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2796,6 +3561,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_launchAppDetailsActivity, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().launchAppDetailsActivity(pkgName); + return; + } _reply.readException(); } finally { @@ -2810,6 +3579,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_resetStartRecordsBlocked, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().resetStartRecordsBlocked(); + return; + } _reply.readException(); } finally { @@ -2823,8 +3596,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_addApp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addApp(pkg); + return; + } _reply.readException(); } finally { @@ -2840,6 +3623,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isStartRuleEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isStartRuleEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2857,6 +3643,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setStartRuleEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setStartRuleEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2872,6 +3662,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(rule); boolean _status = mRemote.transact(Stub.TRANSACTION_addStartRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addStartRule(rule); + return; + } _reply.readException(); } finally { @@ -2887,6 +3681,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(rule); boolean _status = mRemote.transact(Stub.TRANSACTION_deleteStartRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().deleteStartRule(rule); + return; + } _reply.readException(); } finally { @@ -2902,6 +3700,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllStartRules, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllStartRules(); + } _reply.readException(); _result = _reply.createStringArray(); } @@ -2919,6 +3720,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isStandbyRuleEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isStandbyRuleEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2936,6 +3740,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setStandbyRuleEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setStandbyRuleEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2951,6 +3759,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(rule); boolean _status = mRemote.transact(Stub.TRANSACTION_addStandbyRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addStandbyRule(rule); + return; + } _reply.readException(); } finally { @@ -2966,6 +3778,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(rule); boolean _status = mRemote.transact(Stub.TRANSACTION_deleteStandbyRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().deleteStandbyRule(rule); + return; + } _reply.readException(); } finally { @@ -2981,6 +3797,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllStandbyRules, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllStandbyRules(); + } _reply.readException(); _result = _reply.createStringArray(); } @@ -3000,6 +3819,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkgName); _data.writeInt(userId); boolean _status = mRemote.transact(Stub.TRANSACTION_getRunningAppServiceForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRunningAppServiceForPackage(pkgName, userId); + } _reply.readException(); _result = _reply.createTypedArray(github.tornaco.android.thanos.core.app.RunningServiceInfoCompat.CREATOR); } @@ -3019,6 +3841,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkgName); _data.writeInt(userId); boolean _status = mRemote.transact(Stub.TRANSACTION_hasRunningServiceForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasRunningServiceForPackage(pkgName, userId); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3037,8 +3862,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(userHandle); boolean _status = mRemote.transact(Stub.TRANSACTION_getUserInfo, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getUserInfo(userHandle); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, android.content.pm.UserInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = android.content.pm.UserInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -3053,8 +3886,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_stopService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().stopService(intent); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3071,8 +3913,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_killBackgroundProcesses, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().killBackgroundProcesses(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3090,6 +3941,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartStandByStopServiceEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartStandByStopServiceEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3107,6 +3961,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartStandByStopServiceEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartStandByStopServiceEnabled(enable); + return; + } _reply.readException(); } finally { @@ -3122,6 +3980,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartStandByInactiveEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartStandByInactiveEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3139,6 +4000,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartStandByInactiveEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartStandByInactiveEnabled(enable); + return; + } _reply.readException(); } finally { @@ -3154,6 +4019,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartStandByByPassIfHasNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartStandByByPassIfHasNotificationEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3171,6 +4039,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartStandByByPassIfHasNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartStandByByPassIfHasNotificationEnabled(enable); + return; + } _reply.readException(); } finally { @@ -3186,6 +4058,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartStandByBlockBgServiceStartEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartStandByBlockBgServiceStartEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3203,6 +4078,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartStandByBlockBgServiceStartEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartStandByBlockBgServiceStartEnabled(enable); + return; + } _reply.readException(); } finally { @@ -3218,6 +4097,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordAllowedPackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordAllowedPackages(); + } _reply.readException(); _result = _reply.createStringArrayList(); } @@ -3235,6 +4117,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordsAllowedCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordsAllowedCount(); + } _reply.readException(); _result = _reply.readLong(); } @@ -3253,6 +4138,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordAllowedCountByPackageName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordAllowedCountByPackageName(pkgName); + } _reply.readException(); _result = _reply.readLong(); } @@ -3271,6 +4159,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordsAllowedByPackageName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordsAllowedByPackageName(pkgName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.start.StartRecord.CREATOR); } @@ -3289,6 +4180,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_getStartRecordsBlockedByPackageName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getStartRecordsBlockedByPackageName(pkgName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.start.StartRecord.CREATOR); } @@ -3305,6 +4199,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_resetStartRecordsAllowed, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().resetStartRecordsAllowed(); + return; + } _reply.readException(); } finally { @@ -3323,6 +4221,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(((allowed)?(1):(0))); _data.writeInt(((blocked)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllStartRecordsWithRes, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllStartRecordsWithRes(appFlags, allowed, blocked); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.start.StartRecord.CREATOR); } @@ -3341,6 +4242,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(appFlags); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllStartRecords, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllStartRecords(appFlags); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.start.StartRecord.CREATOR); } @@ -3356,8 +4260,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(p); + _data.writeStrongBinder((((p!=null))?(p.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_dump, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().dump(p); + return; + } _reply.readException(); } finally { @@ -3371,8 +4279,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(p); + _data.writeStrongBinder((((p!=null))?(p.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_dumpCpu, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().dumpCpu(p); + return; + } _reply.readException(); } finally { @@ -3388,6 +4300,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setNetStatTrackerEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setNetStatTrackerEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -3403,6 +4319,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isNetStatTrackerEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isNetStatTrackerEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3423,6 +4342,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(name); _data.writeInt(userId); boolean _status = mRemote.transact(Stub.TRANSACTION_checkGetContentProvider, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkGetContentProvider(callerPkg, name, userId); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3443,6 +4365,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(((allowed)?(1):(0))); _data.writeInt(((blocked)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllStartRecordsForPackageSetWithRes, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllStartRecordsForPackageSetWithRes(pkgSetId, allowed, blocked); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.start.StartRecord.CREATOR); } @@ -3457,6 +4382,7 @@ public java.lang.String getInterfaceDescriptor() // https://source.android.com/devices/tech/perf/cached-apps-freezer // // ****************************************************************** + @Override public boolean isCachedAppsFreezerSupported() throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -3465,6 +4391,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isCachedAppsFreezerSupported, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isCachedAppsFreezerSupported(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3480,8 +4409,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_freezeApp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().freezeApp(pkg); + return; + } _reply.readException(); } finally { @@ -3495,8 +4434,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_unfreezeApp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unfreezeApp(pkg); + return; + } _reply.readException(); } finally { @@ -3512,6 +4461,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeLong(pid); boolean _status = mRemote.transact(Stub.TRANSACTION_freezeAppProcess, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().freezeAppProcess(pid); + return; + } _reply.readException(); } finally { @@ -3527,6 +4480,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeLong(pid); boolean _status = mRemote.transact(Stub.TRANSACTION_unfreezeAppProcess, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unfreezeAppProcess(pid); + return; + } _reply.readException(); } finally { @@ -3541,6 +4498,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_updateProcessCpuUsageStats, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().updateProcessCpuUsageStats(); + return; + } _reply.readException(); } finally { @@ -3558,6 +4519,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeLongArray(pids); _data.writeInt(((update)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_queryProcessCpuUsageStats, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().queryProcessCpuUsageStats(pids, update); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.usage.ProcessCpuUsageStats.CREATOR); } @@ -3577,6 +4541,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeLongArray(pids); _data.writeInt(((update)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_queryCpuUsageRatio, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().queryCpuUsageRatio(pids, update); + } _reply.readException(); _result = _reply.readFloat(); } @@ -3595,6 +4562,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeLong(pid); boolean _status = mRemote.transact(Stub.TRANSACTION_killProcess, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().killProcess(pid); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3612,8 +4582,16 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getSwapInfo, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSwapInfo(); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.os.SwapInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.os.SwapInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -3626,15 +4604,26 @@ public java.lang.String getInterfaceDescriptor() // Block Receiver/Service/Provider all the time, event the package is running at foreground, // may cause the app crash. // ****************************************************************** + @Override public void setBlockAllReceiver(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean block) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((block)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBlockAllReceiver, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBlockAllReceiver(pkg, block); + return; + } _reply.readException(); } finally { @@ -3649,8 +4638,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isBlockAllReceiver, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBlockAllReceiver(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3666,9 +4664,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((block)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBlockAllService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBlockAllService(pkg, block); + return; + } _reply.readException(); } finally { @@ -3683,8 +4691,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isBlockAllService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBlockAllService(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3700,9 +4717,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((block)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBlockAllProvider, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBlockAllProvider(pkg, block); + return; + } _reply.readException(); } finally { @@ -3717,8 +4744,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isBlockAllProvider, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBlockAllProvider(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3729,6 +4765,7 @@ public java.lang.String getInterfaceDescriptor() return _result; } // Return 0 if it fail + @Override public long getProcessStartTime(int pid) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -3738,6 +4775,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(pid); boolean _status = mRemote.transact(Stub.TRANSACTION_getProcessStartTime, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getProcessStartTime(pid); + } _reply.readException(); _result = _reply.readLong(); } @@ -3754,8 +4794,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isAppForeground, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isAppForeground(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3772,9 +4821,18 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(foregroundServicetype); boolean _status = mRemote.transact(Stub.TRANSACTION_hasRunningForegroundService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasRunningForegroundService(pkg, foregroundServicetype); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3792,6 +4850,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getTopVisibleActivities, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getTopVisibleActivities(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.ActivityAssistInfo.CREATOR); } @@ -3808,9 +4869,18 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(callerUid); boolean _status = mRemote.transact(Stub.TRANSACTION_checkStartActivity, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkStartActivity(intent, callerUid); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3828,6 +4898,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isBgTaskCleanUpSkipForegroundEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isBgTaskCleanUpSkipForegroundEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3845,6 +4918,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBgTaskCleanUpSkipForegroundEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBgTaskCleanUpSkipForegroundEnabled(enable); + return; + } _reply.readException(); } finally { @@ -3852,7 +4929,7 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } - /** return the pid of process. or -1 if no process found */ + /* return the pid of process. or -1 if no process found */ @Override public int getPid(github.tornaco.android.thanos.core.os.ProcessName processName) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -3860,8 +4937,17 @@ public java.lang.String getInterfaceDescriptor() int _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, processName, 0); + if ((processName!=null)) { + _data.writeInt(1); + processName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getPid, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPid(processName); + } _reply.readException(); _result = _reply.readInt(); } @@ -3871,7 +4957,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } - /** return the pid of killed process. or -1 if no process found */ + /* return the pid of killed process. or -1 if no process found */ @Override public int killProcessByName(github.tornaco.android.thanos.core.os.ProcessName processName) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -3879,8 +4965,17 @@ public java.lang.String getInterfaceDescriptor() int _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, processName, 0); + if ((processName!=null)) { + _data.writeInt(1); + processName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_killProcessByName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().killProcessByName(processName); + } _reply.readException(); _result = _reply.readInt(); } @@ -3896,8 +4991,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedList(_data, processNames, 0); + _data.writeTypedList(processNames); boolean _status = mRemote.transact(Stub.TRANSACTION_killProcessByNames, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().killProcessByNames(processNames); + return; + } _reply.readException(); } finally { @@ -3914,6 +5013,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(process); boolean _status = mRemote.transact(Stub.TRANSACTION_dumpHeap, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().dumpHeap(process); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3931,8 +5033,16 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getCurrentFrontPkg, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getCurrentFrontPkg(); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -3948,6 +5058,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartStandByByPassIfHasVisibleWindows, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartStandByByPassIfHasVisibleWindows(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -3965,6 +5078,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartStandByByPassIfHasVisibleWindowsEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartStandByByPassIfHasVisibleWindowsEnabled(enable); + return; + } _reply.readException(); } finally { @@ -3981,6 +5098,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((update)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getTotalCpuPercent, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getTotalCpuPercent(update); + } _reply.readException(); _result = _reply.readFloat(); } @@ -4000,6 +5120,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(n); _data.writeInt(((update)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getTopNCpuUsagePackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getTopNCpuUsagePackages(n, update); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.usage.PkgCpuUsageStats.CREATOR); } @@ -4016,8 +5139,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgResident, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgResident(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -4033,9 +5165,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((resident)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgResident, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgResident(pkg, resident); + return; + } _reply.readException(); } finally { @@ -4049,9 +5191,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(mode); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgRecentTaskBlurMode, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgRecentTaskBlurMode(pkg, mode); + return; + } _reply.readException(); } finally { @@ -4066,8 +5218,17 @@ public java.lang.String getInterfaceDescriptor() int _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getPkgRecentTaskBlurMode, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPkgRecentTaskBlurMode(pkg); + } _reply.readException(); _result = _reply.readInt(); } @@ -4077,6 +5238,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.app.IActivityManager sDefaultImpl; } static final int TRANSACTION_getCurrentFrontApp = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_forceStopPackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -4214,8 +5376,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_setPkgResident = (android.os.IBinder.FIRST_CALL_TRANSACTION + 133); static final int TRANSACTION_setPkgRecentTaskBlurMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 134); static final int TRANSACTION_getPkgRecentTaskBlurMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 135); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.IActivityManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.app.IActivityManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.IActivityManager"; public java.lang.String getCurrentFrontApp() throws android.os.RemoteException; public void forceStopPackage(github.tornaco.android.thanos.core.pm.Pkg pkg, java.lang.String reason) throws android.os.RemoteException; public void idlePackage(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; @@ -4238,16 +5415,19 @@ public java.lang.String getInterfaceDescriptor() public long getStartRecordsBlockedCount() throws android.os.RemoteException; public long getStartRecordBlockedCountByPackageName(java.lang.String pkgName) throws android.os.RemoteException; // 启动管理设置 + public boolean isStartBlockEnabled() throws android.os.RemoteException; public void setStartBlockEnabled(boolean enable) throws android.os.RemoteException; public void setPkgStartBlockEnabled(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean enable) throws android.os.RemoteException; public boolean isPkgStartBlocking(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; // Task removal + public boolean isCleanUpOnTaskRemovalEnabled() throws android.os.RemoteException; public void setCleanUpOnTaskRemovalEnabled(boolean enable) throws android.os.RemoteException; public void setPkgCleanUpOnTaskRemovalEnabled(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean enable) throws android.os.RemoteException; public boolean isPkgCleanUpOnTaskRemovalEnabled(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; // 后台运行设置 + public boolean isBgRestrictEnabled() throws android.os.RemoteException; public void setBgRestrictEnabled(boolean enable) throws android.os.RemoteException; public void setPkgBgRestrictEnabled(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean enable) throws android.os.RemoteException; @@ -4255,17 +5435,21 @@ public java.lang.String getInterfaceDescriptor() public void setBgRestrictNotificationEnabled(boolean enabled) throws android.os.RemoteException; public boolean isBgRestrictNotificationEnabled() throws android.os.RemoteException; // Task blur + public boolean isRecentTaskBlurEnabled() throws android.os.RemoteException; public void setRecentTaskBlurEnabled(boolean enable) throws android.os.RemoteException; public void setPkgRecentTaskBlurEnabled(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean enable) throws android.os.RemoteException; public boolean isPkgRecentTaskBlurEnabled(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; // Audio focused app. + public boolean isBgTaskCleanUpSkipAudioFocusedAppEnabled() throws android.os.RemoteException; public void setBgTaskCleanUpSkipAudioFocusedAppEnabled(boolean enable) throws android.os.RemoteException; // Notification record app. + public boolean isBgTaskCleanUpSkipWhichHasNotificationEnabled() throws android.os.RemoteException; public void setBgTaskCleanUpSkipWhichHasNotificationEnabled(boolean enable) throws android.os.RemoteException; // 后台运行锁屏清理延迟 + public void setBgTaskCleanUpDelayTimeMills(long delayMills) throws android.os.RemoteException; public long getBgTaskCleanUpDelayTimeMills() throws android.os.RemoteException; public void notifyTaskCreated(int taskId, android.content.ComponentName componentName) throws android.os.RemoteException; @@ -4282,6 +5466,7 @@ public java.lang.String getInterfaceDescriptor() public int getRecentTaskExcludeSettingForPackage(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public void setRecentTaskExcludeSettingForPackage(github.tornaco.android.thanos.core.pm.Pkg pkg, int setting) throws android.os.RemoteException; // Keep when has recent task. + public boolean isBgTaskCleanUpSkipWhenHasRecentTaskEnabled() throws android.os.RemoteException; public void setBgTaskCleanUpSkipWhenHasRecentTaskEnabled(boolean enable) throws android.os.RemoteException; public void launchAppDetailsActivity(java.lang.String pkgName) throws android.os.RemoteException; @@ -4329,6 +5514,7 @@ public java.lang.String getInterfaceDescriptor() // https://source.android.com/devices/tech/perf/cached-apps-freezer // // ****************************************************************** + public boolean isCachedAppsFreezerSupported() throws android.os.RemoteException; public void freezeApp(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public void unfreezeApp(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; @@ -4344,6 +5530,7 @@ public java.lang.String getInterfaceDescriptor() // Block Receiver/Service/Provider all the time, event the package is running at foreground, // may cause the app crash. // ****************************************************************** + public void setBlockAllReceiver(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean block) throws android.os.RemoteException; public boolean isBlockAllReceiver(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public void setBlockAllService(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean block) throws android.os.RemoteException; @@ -4351,6 +5538,7 @@ public java.lang.String getInterfaceDescriptor() public void setBlockAllProvider(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean block) throws android.os.RemoteException; public boolean isBlockAllProvider(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; // Return 0 if it fail + public long getProcessStartTime(int pid) throws android.os.RemoteException; public boolean isAppForeground(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public boolean hasRunningForegroundService(github.tornaco.android.thanos.core.pm.Pkg pkg, int foregroundServicetype) throws android.os.RemoteException; @@ -4358,9 +5546,9 @@ public java.lang.String getInterfaceDescriptor() public boolean checkStartActivity(android.content.Intent intent, int callerUid) throws android.os.RemoteException; public boolean isBgTaskCleanUpSkipForegroundEnabled() throws android.os.RemoteException; public void setBgTaskCleanUpSkipForegroundEnabled(boolean enable) throws android.os.RemoteException; - /** return the pid of process. or -1 if no process found */ + /* return the pid of process. or -1 if no process found */ public int getPid(github.tornaco.android.thanos.core.os.ProcessName processName) throws android.os.RemoteException; - /** return the pid of killed process. or -1 if no process found */ + /* return the pid of killed process. or -1 if no process found */ public int killProcessByName(github.tornaco.android.thanos.core.os.ProcessName processName) throws android.os.RemoteException; public void killProcessByNames(java.util.List processNames) throws android.os.RemoteException; public boolean dumpHeap(java.lang.String process) throws android.os.RemoteException; @@ -4373,39 +5561,4 @@ public java.lang.String getInterfaceDescriptor() public void setPkgResident(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean resident) throws android.os.RemoteException; public void setPkgRecentTaskBlurMode(github.tornaco.android.thanos.core.pm.Pkg pkg, int mode) throws android.os.RemoteException; public int getPkgRecentTaskBlurMode(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IActivityLifecycleListener.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IActivityLifecycleListener.java index 460775d94..d89664e54 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IActivityLifecycleListener.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IActivityLifecycleListener.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.app.activity.IActivityLifecycle @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,23 +53,25 @@ public static github.tornaco.android.thanos.core.app.activity.IActivityLifecycle reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onAboutToLaunchActivity: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onAboutToLaunchActivity(_arg0); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener { @@ -94,8 +94,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onAboutToLaunchActivity, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onAboutToLaunchActivity(intent); + return; + } _reply.readException(); } finally { @@ -103,30 +113,25 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener sDefaultImpl; } static final int TRANSACTION_onAboutToLaunchActivity = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener"; - public void onAboutToLaunchActivity(android.content.Intent intent) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public void onAboutToLaunchActivity(android.content.Intent intent) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IActivityStackSupervisor.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IActivityStackSupervisor.java index 619ae73c3..a23d73a8f 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IActivityStackSupervisor.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IActivityStackSupervisor.java @@ -93,6 +93,7 @@ public static class Default implements github.tornaco.android.thanos.core.app.ac { } // Bridge API to report app events. + @Override public android.content.Intent reportOnStartActivity(java.lang.String callingPackage, android.content.Intent intent) throws android.os.RemoteException { return null; @@ -154,6 +155,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -181,9 +183,6 @@ public static github.tornaco.android.thanos.core.app.activity.IActivityStackSupe @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -191,13 +190,16 @@ public static github.tornaco.android.thanos.core.app.activity.IActivityStackSupe reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_checkActivity: { + data.enforceInterface(descriptor); android.content.ComponentName _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.ComponentName.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.ComponentName.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); android.os.IBinder _arg2; @@ -205,12 +207,18 @@ public static github.tornaco.android.thanos.core.app.activity.IActivityStackSupe boolean _result = this.checkActivity(_arg0, _arg1, _arg2); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_replaceActivityStartingIntent: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); android.os.IBinder _arg2; @@ -219,13 +227,25 @@ public static github.tornaco.android.thanos.core.app.activity.IActivityStackSupe _arg3 = data.readString(); android.content.Intent _result = this.replaceActivityStartingIntent(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_shouldVerifyActivityStarting: { + data.enforceInterface(descriptor); android.content.ComponentName _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.ComponentName.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.ComponentName.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); java.lang.String _arg2; @@ -233,51 +253,57 @@ public static github.tornaco.android.thanos.core.app.activity.IActivityStackSupe boolean _result = this.shouldVerifyActivityStarting(_arg0, _arg1, _arg2); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getCurrentFrontApp: { + data.enforceInterface(descriptor); java.lang.String _result = this.getCurrentFrontApp(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_setAppLockEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setAppLockEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isAppLockEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isAppLockEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isPackageLocked: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isPackageLocked(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setPackageLocked: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setPackageLocked(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_setVerifyResult: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _arg1; @@ -286,259 +312,320 @@ public static github.tornaco.android.thanos.core.app.activity.IActivityStackSupe _arg2 = data.readInt(); this.setVerifyResult(_arg0, _arg1, _arg2); reply.writeNoException(); - break; + return true; } case TRANSACTION_addComponentReplacement: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.component.ComponentReplacement _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.app.component.ComponentReplacement.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.app.component.ComponentReplacement.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.addComponentReplacement(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_removeComponentReplacement: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.component.ComponentReplacement _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.app.component.ComponentReplacement.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.app.component.ComponentReplacement.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.removeComponentReplacement(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getComponentReplacements: { + data.enforceInterface(descriptor); java.util.List _result = this.getComponentReplacements(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_setActivityTrampolineEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setActivityTrampolineEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isActivityTrampolineEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isActivityTrampolineEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setShowCurrentComponentViewEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setShowCurrentComponentViewEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isShowCurrentComponentViewEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isShowCurrentComponentViewEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_registerTopPackageChangeListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener.Stub.asInterface(data.readStrongBinder()); this.registerTopPackageChangeListener(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_unRegisterTopPackageChangeListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener.Stub.asInterface(data.readStrongBinder()); this.unRegisterTopPackageChangeListener(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isVerifyOnScreenOffEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isVerifyOnScreenOffEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setVerifyOnScreenOffEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setVerifyOnScreenOffEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isVerifyOnAppSwitchEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isVerifyOnAppSwitchEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setVerifyOnAppSwitchEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setVerifyOnAppSwitchEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isVerifyOnTaskRemovedEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isVerifyOnTaskRemovedEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setVerifyOnTaskRemovedEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setVerifyOnTaskRemovedEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_reportOnStartActivity: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.content.Intent _arg1; - _arg1 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg1 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } android.content.Intent _result = this.reportOnStartActivity(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_reportOnActivityStopped: { + data.enforceInterface(descriptor); android.os.IBinder _arg0; _arg0 = data.readStrongBinder(); this.reportOnActivityStopped(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_reportOnActivityResumed: { + data.enforceInterface(descriptor); android.os.IBinder _arg0; _arg0 = data.readStrongBinder(); this.reportOnActivityResumed(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_dump: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.IPrinter _arg0; _arg0 = github.tornaco.android.thanos.core.IPrinter.Stub.asInterface(data.readStrongBinder()); this.dump(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_registerActivityLifecycleListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener _arg0; _arg0 = github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener.Stub.asInterface(data.readStrongBinder()); this.registerActivityLifecycleListener(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_unRegisterActivityLifecycleListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener _arg0; _arg0 = github.tornaco.android.thanos.core.app.activity.IActivityLifecycleListener.Stub.asInterface(data.readStrongBinder()); this.unRegisterActivityLifecycleListener(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_addAppLockWhiteListComponents: { + data.enforceInterface(descriptor); java.util.List _arg0; _arg0 = data.createTypedArrayList(android.content.ComponentName.CREATOR); this.addAppLockWhiteListComponents(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_removeAppLockWhiteListComponents: { + data.enforceInterface(descriptor); java.util.List _arg0; _arg0 = data.createTypedArrayList(android.content.ComponentName.CREATOR); this.removeAppLockWhiteListComponents(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAppLockWhiteListComponents: { + data.enforceInterface(descriptor); java.util.List _result = this.getAppLockWhiteListComponents(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getLaunchOtherAppSetting: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _result = this.getLaunchOtherAppSetting(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_setLaunchOtherAppSetting: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); this.setLaunchOtherAppSetting(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isLaunchOtherAppBlockerEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isLaunchOtherAppBlockerEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setLaunchOtherAppBlockerEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setLaunchOtherAppBlockerEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_addLaunchOtherAppRule: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.addLaunchOtherAppRule(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_deleteLaunchOtherAppRule: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.deleteLaunchOtherAppRule(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAllLaunchOtherAppRules: { + data.enforceInterface(descriptor); java.lang.String[] _result = this.getAllLaunchOtherAppRules(); reply.writeNoException(); reply.writeStringArray(_result); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor { @@ -563,10 +650,19 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, componentName, 0); + if ((componentName!=null)) { + _data.writeInt(1); + componentName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(userId); _data.writeStrongBinder(resultTo); boolean _status = mRemote.transact(Stub.TRANSACTION_checkActivity, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkActivity(componentName, userId, resultTo); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -583,13 +679,27 @@ public java.lang.String getInterfaceDescriptor() android.content.Intent _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(userId); _data.writeStrongBinder(resultTo); _data.writeString(callingPkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_replaceActivityStartingIntent, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().replaceActivityStartingIntent(intent, userId, resultTo, callingPkgName); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, android.content.Intent.CREATOR); + if ((0!=_reply.readInt())) { + _result = android.content.Intent.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -604,10 +714,19 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, componentName, 0); + if ((componentName!=null)) { + _data.writeInt(1); + componentName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(pkg); _data.writeString(source); boolean _status = mRemote.transact(Stub.TRANSACTION_shouldVerifyActivityStarting, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().shouldVerifyActivityStarting(componentName, pkg, source); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -625,6 +744,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getCurrentFrontApp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getCurrentFrontApp(); + } _reply.readException(); _result = _reply.readString(); } @@ -642,6 +764,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setAppLockEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setAppLockEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -657,6 +783,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isAppLockEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isAppLockEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -675,6 +804,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkg); boolean _status = mRemote.transact(Stub.TRANSACTION_isPackageLocked, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPackageLocked(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -693,6 +825,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkg); _data.writeInt(((locked)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPackageLocked, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPackageLocked(pkg, locked); + return; + } _reply.readException(); } finally { @@ -710,6 +846,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(result); _data.writeInt(reason); boolean _status = mRemote.transact(Stub.TRANSACTION_setVerifyResult, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setVerifyResult(request, result, reason); + return; + } _reply.readException(); } finally { @@ -723,8 +863,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, replacement, 0); + if ((replacement!=null)) { + _data.writeInt(1); + replacement.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_addComponentReplacement, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addComponentReplacement(replacement); + return; + } _reply.readException(); } finally { @@ -738,8 +888,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, replacement, 0); + if ((replacement!=null)) { + _data.writeInt(1); + replacement.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_removeComponentReplacement, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().removeComponentReplacement(replacement); + return; + } _reply.readException(); } finally { @@ -755,6 +915,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getComponentReplacements, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getComponentReplacements(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.app.component.ComponentReplacement.CREATOR); } @@ -772,6 +935,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setActivityTrampolineEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setActivityTrampolineEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -787,6 +954,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isActivityTrampolineEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isActivityTrampolineEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -804,6 +974,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setShowCurrentComponentViewEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setShowCurrentComponentViewEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -819,6 +993,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isShowCurrentComponentViewEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isShowCurrentComponentViewEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -834,8 +1011,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_registerTopPackageChangeListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().registerTopPackageChangeListener(listener); + return; + } _reply.readException(); } finally { @@ -849,8 +1030,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterTopPackageChangeListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unRegisterTopPackageChangeListener(listener); + return; + } _reply.readException(); } finally { @@ -866,6 +1051,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isVerifyOnScreenOffEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isVerifyOnScreenOffEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -883,6 +1071,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setVerifyOnScreenOffEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setVerifyOnScreenOffEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -898,6 +1090,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isVerifyOnAppSwitchEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isVerifyOnAppSwitchEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -915,6 +1110,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setVerifyOnAppSwitchEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setVerifyOnAppSwitchEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -930,6 +1129,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isVerifyOnTaskRemovedEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isVerifyOnTaskRemovedEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -947,6 +1149,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setVerifyOnTaskRemovedEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setVerifyOnTaskRemovedEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -955,6 +1161,7 @@ public java.lang.String getInterfaceDescriptor() } } // Bridge API to report app events. + @Override public android.content.Intent reportOnStartActivity(java.lang.String callingPackage, android.content.Intent intent) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -963,10 +1170,24 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(callingPackage); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_reportOnStartActivity, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().reportOnStartActivity(callingPackage, intent); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, android.content.Intent.CREATOR); + if ((0!=_reply.readInt())) { + _result = android.content.Intent.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -982,6 +1203,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeStrongBinder(token); boolean _status = mRemote.transact(Stub.TRANSACTION_reportOnActivityStopped, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().reportOnActivityStopped(token); + return; + } _reply.readException(); } finally { @@ -997,6 +1222,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeStrongBinder(token); boolean _status = mRemote.transact(Stub.TRANSACTION_reportOnActivityResumed, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().reportOnActivityResumed(token); + return; + } _reply.readException(); } finally { @@ -1010,8 +1239,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(p); + _data.writeStrongBinder((((p!=null))?(p.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_dump, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().dump(p); + return; + } _reply.readException(); } finally { @@ -1025,8 +1258,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_registerActivityLifecycleListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().registerActivityLifecycleListener(listener); + return; + } _reply.readException(); } finally { @@ -1040,8 +1277,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterActivityLifecycleListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unRegisterActivityLifecycleListener(listener); + return; + } _reply.readException(); } finally { @@ -1055,8 +1296,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedList(_data, componentName, 0); + _data.writeTypedList(componentName); boolean _status = mRemote.transact(Stub.TRANSACTION_addAppLockWhiteListComponents, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addAppLockWhiteListComponents(componentName); + return; + } _reply.readException(); } finally { @@ -1070,8 +1315,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedList(_data, componentName, 0); + _data.writeTypedList(componentName); boolean _status = mRemote.transact(Stub.TRANSACTION_removeAppLockWhiteListComponents, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().removeAppLockWhiteListComponents(componentName); + return; + } _reply.readException(); } finally { @@ -1087,6 +1336,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAppLockWhiteListComponents, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAppLockWhiteListComponents(); + } _reply.readException(); _result = _reply.createTypedArrayList(android.content.ComponentName.CREATOR); } @@ -1103,8 +1355,17 @@ public java.lang.String getInterfaceDescriptor() int _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getLaunchOtherAppSetting, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getLaunchOtherAppSetting(pkg); + } _reply.readException(); _result = _reply.readInt(); } @@ -1120,9 +1381,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(setting); boolean _status = mRemote.transact(Stub.TRANSACTION_setLaunchOtherAppSetting, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setLaunchOtherAppSetting(pkg, setting); + return; + } _reply.readException(); } finally { @@ -1138,6 +1409,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isLaunchOtherAppBlockerEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isLaunchOtherAppBlockerEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1155,6 +1429,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setLaunchOtherAppBlockerEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setLaunchOtherAppBlockerEnabled(enable); + return; + } _reply.readException(); } finally { @@ -1170,6 +1448,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(rule); boolean _status = mRemote.transact(Stub.TRANSACTION_addLaunchOtherAppRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addLaunchOtherAppRule(rule); + return; + } _reply.readException(); } finally { @@ -1185,6 +1467,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(rule); boolean _status = mRemote.transact(Stub.TRANSACTION_deleteLaunchOtherAppRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().deleteLaunchOtherAppRule(rule); + return; + } _reply.readException(); } finally { @@ -1200,6 +1486,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllLaunchOtherAppRules, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllLaunchOtherAppRules(); + } _reply.readException(); _result = _reply.createStringArray(); } @@ -1209,6 +1498,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor sDefaultImpl; } static final int TRANSACTION_checkActivity = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_replaceActivityStartingIntent = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -1250,10 +1540,24 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_addLaunchOtherAppRule = (android.os.IBinder.FIRST_CALL_TRANSACTION + 37); static final int TRANSACTION_deleteLaunchOtherAppRule = (android.os.IBinder.FIRST_CALL_TRANSACTION + 38); static final int TRANSACTION_getAllLaunchOtherAppRules = (android.os.IBinder.FIRST_CALL_TRANSACTION + 39); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.activity.IActivityStackSupervisor"; /** @deprecated use {@link #replaceActivityStartingIntent} instead */ - @Deprecated public boolean checkActivity(android.content.ComponentName componentName, int userId, android.os.IBinder resultTo) throws android.os.RemoteException; public android.content.Intent replaceActivityStartingIntent(android.content.Intent intent, int userId, android.os.IBinder resultTo, java.lang.String callingPkgName) throws android.os.RemoteException; public boolean shouldVerifyActivityStarting(android.content.ComponentName componentName, java.lang.String pkg, java.lang.String source) throws android.os.RemoteException; @@ -1279,6 +1583,7 @@ public java.lang.String getInterfaceDescriptor() public boolean isVerifyOnTaskRemovedEnabled() throws android.os.RemoteException; public void setVerifyOnTaskRemovedEnabled(boolean enabled) throws android.os.RemoteException; // Bridge API to report app events. + public android.content.Intent reportOnStartActivity(java.lang.String callingPackage, android.content.Intent intent) throws android.os.RemoteException; public void reportOnActivityStopped(android.os.IBinder token) throws android.os.RemoteException; public void reportOnActivityResumed(android.os.IBinder token) throws android.os.RemoteException; @@ -1295,39 +1600,4 @@ public java.lang.String getInterfaceDescriptor() public void addLaunchOtherAppRule(java.lang.String rule) throws android.os.RemoteException; public void deleteLaunchOtherAppRule(java.lang.String rule) throws android.os.RemoteException; public java.lang.String[] getAllLaunchOtherAppRules() throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/ITopPackageChangeListener.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/ITopPackageChangeListener.java index ba2f22f86..c9ee07d5e 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/ITopPackageChangeListener.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/ITopPackageChangeListener.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.app.activity.ITopPackageChangeL @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,25 +53,32 @@ public static github.tornaco.android.thanos.core.app.activity.ITopPackageChangeL reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onChange: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } github.tornaco.android.thanos.core.pm.Pkg _arg1; - _arg1 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg1 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } this.onChange(_arg0, _arg1); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener { @@ -96,9 +101,25 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, from, 0); - _Parcel.writeTypedObject(_data, to, 0); + if ((from!=null)) { + _data.writeInt(1); + from.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } + if ((to!=null)) { + _data.writeInt(1); + to.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onChange, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onChange(from, to); + return; + } _reply.readException(); } finally { @@ -106,30 +127,25 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener sDefaultImpl; } static final int TRANSACTION_onChange = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener"; - public void onChange(github.tornaco.android.thanos.core.pm.Pkg from, github.tornaco.android.thanos.core.pm.Pkg to) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.app.activity.ITopPackageChangeListener getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public void onChange(github.tornaco.android.thanos.core.pm.Pkg from, github.tornaco.android.thanos.core.pm.Pkg to) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IVerifyCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IVerifyCallback.java index 6c9a3792f..46c685a95 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IVerifyCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/activity/IVerifyCallback.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.activity.IVerifyCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.activity.IVerifyCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.app.activity.IVerifyCallback as @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,25 +53,22 @@ public static github.tornaco.android.thanos.core.app.activity.IVerifyCallback as reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onVerifyResult: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _arg1; _arg1 = data.readInt(); this.onVerifyResult(_arg0, _arg1); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.activity.IVerifyCallback { @@ -99,6 +94,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(verifyResult); _data.writeInt(reason); boolean _status = mRemote.transact(Stub.TRANSACTION_onVerifyResult, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onVerifyResult(verifyResult, reason); + return; + } _reply.readException(); } finally { @@ -106,9 +105,25 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.app.activity.IVerifyCallback sDefaultImpl; } static final int TRANSACTION_onVerifyResult = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.activity.IVerifyCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.app.activity.IVerifyCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.activity.IVerifyCallback"; public void onVerifyResult(int verifyResult, int reason) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/event/IEventSubscriber.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/event/IEventSubscriber.java index e0b844892..cf43d4089 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/event/IEventSubscriber.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/event/IEventSubscriber.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.event.IEventSubscriber { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.event.IEventSubscriber"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.app.event.IEventSubscriber asIn @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,23 +53,25 @@ public static github.tornaco.android.thanos.core.app.event.IEventSubscriber asIn reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onEvent: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.app.event.ThanosEvent _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.app.event.ThanosEvent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.app.event.ThanosEvent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onEvent(_arg0); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.event.IEventSubscriber { @@ -94,8 +94,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, e, 0); + if ((e!=null)) { + _data.writeInt(1); + e.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onEvent, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onEvent(e); + return; + } _reply.readException(); } finally { @@ -103,30 +113,25 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.app.event.IEventSubscriber sDefaultImpl; } static final int TRANSACTION_onEvent = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.event.IEventSubscriber"; - public void onEvent(github.tornaco.android.thanos.core.app.event.ThanosEvent e) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.event.IEventSubscriber impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.app.event.IEventSubscriber getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public void onEvent(github.tornaco.android.thanos.core.app.event.ThanosEvent e) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IAddPackageCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IAddPackageCallback.java index 596b80b2f..7f769fd96 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IAddPackageCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IAddPackageCallback.java @@ -21,6 +21,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -48,9 +49,6 @@ public static github.tornaco.android.thanos.core.app.infinite.IAddPackageCallbac @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -58,31 +56,29 @@ public static github.tornaco.android.thanos.core.app.infinite.IAddPackageCallbac reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onSuccess: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); this.onSuccess(_arg0); - break; + return true; } case TRANSACTION_onError: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; _arg1 = data.readInt(); this.onError(_arg0, _arg1); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback { @@ -106,6 +102,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(userId); boolean _status = mRemote.transact(Stub.TRANSACTION_onSuccess, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onSuccess(userId); + return; + } } finally { _data.recycle(); @@ -119,16 +119,36 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(errorMessage); _data.writeInt(errorCode); boolean _status = mRemote.transact(Stub.TRANSACTION_onError, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onError(errorMessage, errorCode); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback sDefaultImpl; } static final int TRANSACTION_onSuccess = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onError = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback"; public void onSuccess(int userId) throws android.os.RemoteException; public void onError(java.lang.String errorMessage, int errorCode) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IEnableCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IEnableCallback.java index 3bf4d99cb..c08bfb3dc 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IEnableCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IEnableCallback.java @@ -21,6 +21,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.infinite.IEnableCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.IEnableCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -48,9 +49,6 @@ public static github.tornaco.android.thanos.core.app.infinite.IEnableCallback as @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -58,31 +56,29 @@ public static github.tornaco.android.thanos.core.app.infinite.IEnableCallback as reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onSuccess: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); this.onSuccess(_arg0); - break; + return true; } case TRANSACTION_onError: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; _arg1 = data.readInt(); this.onError(_arg0, _arg1); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.infinite.IEnableCallback { @@ -106,6 +102,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(userId); boolean _status = mRemote.transact(Stub.TRANSACTION_onSuccess, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onSuccess(userId); + return; + } } finally { _data.recycle(); @@ -119,16 +119,36 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(errorMessage); _data.writeInt(errorCode); boolean _status = mRemote.transact(Stub.TRANSACTION_onError, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onError(errorMessage, errorCode); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.app.infinite.IEnableCallback sDefaultImpl; } static final int TRANSACTION_onSuccess = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onError = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.infinite.IEnableCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.app.infinite.IEnableCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.IEnableCallback"; public void onSuccess(int userId) throws android.os.RemoteException; public void onError(java.lang.String errorMessage, int errorCode) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/ILaunchPackageCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/ILaunchPackageCallback.java index 9d49403fb..a945dd54c 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/ILaunchPackageCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/ILaunchPackageCallback.java @@ -21,6 +21,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -48,9 +49,6 @@ public static github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCall @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -58,29 +56,27 @@ public static github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCall reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onSuccess: { + data.enforceInterface(descriptor); this.onSuccess(); - break; + return true; } case TRANSACTION_onError: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; _arg1 = data.readInt(); this.onError(_arg0, _arg1); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback { @@ -103,6 +99,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_onSuccess, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onSuccess(); + return; + } } finally { _data.recycle(); @@ -116,16 +116,36 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(errorMessage); _data.writeInt(errorCode); boolean _status = mRemote.transact(Stub.TRANSACTION_onError, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onError(errorMessage, errorCode); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback sDefaultImpl; } static final int TRANSACTION_onSuccess = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onError = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback"; public void onSuccess() throws android.os.RemoteException; public void onError(java.lang.String errorMessage, int errorCode) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IRemovePackageCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IRemovePackageCallback.java index 2f0d5173e..8fc48bf6a 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IRemovePackageCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/IRemovePackageCallback.java @@ -21,6 +21,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -48,9 +49,6 @@ public static github.tornaco.android.thanos.core.app.infinite.IRemovePackageCall @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -58,29 +56,27 @@ public static github.tornaco.android.thanos.core.app.infinite.IRemovePackageCall reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onSuccess: { + data.enforceInterface(descriptor); this.onSuccess(); - break; + return true; } case TRANSACTION_onError: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; _arg1 = data.readInt(); this.onError(_arg0, _arg1); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback { @@ -103,6 +99,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_onSuccess, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onSuccess(); + return; + } } finally { _data.recycle(); @@ -116,16 +116,36 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(errorMessage); _data.writeInt(errorCode); boolean _status = mRemote.transact(Stub.TRANSACTION_onError, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onError(errorMessage, errorCode); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback sDefaultImpl; } static final int TRANSACTION_onSuccess = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onError = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback"; public void onSuccess() throws android.os.RemoteException; public void onError(java.lang.String errorMessage, int errorCode) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/InfiniteZ.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/InfiniteZ.java index ccd1cd253..3ae2ae715 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/InfiniteZ.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/infinite/InfiniteZ.java @@ -35,6 +35,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.infinite.InfiniteZ { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.InfiniteZ"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -62,9 +63,6 @@ public static github.tornaco.android.thanos.core.app.infinite.InfiniteZ asInterf @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -72,69 +70,71 @@ public static github.tornaco.android.thanos.core.app.infinite.InfiniteZ asInterf reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_setEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); github.tornaco.android.thanos.core.app.infinite.IEnableCallback _arg1; _arg1 = github.tornaco.android.thanos.core.app.infinite.IEnableCallback.Stub.asInterface(data.readStrongBinder()); this.setEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_addPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback _arg1; _arg1 = github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback.Stub.asInterface(data.readStrongBinder()); this.addPackage(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_removePackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback _arg1; _arg1 = github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback.Stub.asInterface(data.readStrongBinder()); this.removePackage(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_launchPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback _arg1; _arg1 = github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback.Stub.asInterface(data.readStrongBinder()); this.launchPackage(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getInstalledPackages: { + data.enforceInterface(descriptor); java.util.List _result = this.getInstalledPackages(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.infinite.InfiniteZ { @@ -158,8 +158,12 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_setEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setEnabled(enable, callback); + return; + } _reply.readException(); } finally { @@ -175,6 +179,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -191,8 +198,12 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_addPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addPackage(pkgName, callback); + return; + } _reply.readException(); } finally { @@ -207,8 +218,12 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_removePackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().removePackage(pkgName, callback); + return; + } _reply.readException(); } finally { @@ -223,8 +238,12 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_launchPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().launchPackage(pkgName, callback); + return; + } _reply.readException(); } finally { @@ -240,6 +259,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getInstalledPackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getInstalledPackages(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.AppInfo.CREATOR); } @@ -249,6 +271,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.app.infinite.InfiniteZ sDefaultImpl; } static final int TRANSACTION_setEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_isEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -256,47 +279,27 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_removePackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); static final int TRANSACTION_launchPackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); static final int TRANSACTION_getInstalledPackages = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.infinite.InfiniteZ impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.app.infinite.InfiniteZ getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.infinite.InfiniteZ"; public void setEnabled(boolean enable, github.tornaco.android.thanos.core.app.infinite.IEnableCallback callback) throws android.os.RemoteException; public boolean isEnabled() throws android.os.RemoteException; public void addPackage(java.lang.String pkgName, github.tornaco.android.thanos.core.app.infinite.IAddPackageCallback callback) throws android.os.RemoteException; public void removePackage(java.lang.String pkgName, github.tornaco.android.thanos.core.app.infinite.IRemovePackageCallback callback) throws android.os.RemoteException; public void launchPackage(java.lang.String pkgName, github.tornaco.android.thanos.core.app.infinite.ILaunchPackageCallback callback) throws android.os.RemoteException; public java.util.List getInstalledPackages() throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/usage/IUsageStatsManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/usage/IUsageStatsManager.java index f53e178e7..fd102dd1f 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/usage/IUsageStatsManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/app/usage/IUsageStatsManager.java @@ -23,6 +23,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.app.usage.IUsageStatsManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.usage.IUsageStatsManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -50,9 +51,6 @@ public static github.tornaco.android.thanos.core.app.usage.IUsageStatsManager as @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -60,11 +58,9 @@ public static github.tornaco.android.thanos.core.app.usage.IUsageStatsManager as reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_queryUsageStats: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); long _arg1; @@ -73,11 +69,12 @@ public static github.tornaco.android.thanos.core.app.usage.IUsageStatsManager as _arg2 = data.readLong(); java.util.List _result = this.queryUsageStats(_arg0, _arg1, _arg2); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_queryAndAggregateUsageStats: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); long _arg1; @@ -90,17 +87,22 @@ public static github.tornaco.android.thanos.core.app.usage.IUsageStatsManager as reply.writeInt(_result.size()); _result.forEach((k, v) -> { reply.writeString(k); - _Parcel.writeTypedObject(reply, v, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + if ((v!=null)) { + reply.writeInt(1); + v.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } }); } - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.app.usage.IUsageStatsManager { @@ -128,6 +130,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeLong(beginTime); _data.writeLong(endTime); boolean _status = mRemote.transact(Stub.TRANSACTION_queryUsageStats, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().queryUsageStats(intervalType, beginTime, endTime); + } _reply.readException(); _result = _reply.createTypedArrayList(android.app.usage.UsageStats.CREATOR); } @@ -147,6 +152,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeLong(beginTime); _data.writeLong(endTime); boolean _status = mRemote.transact(Stub.TRANSACTION_queryAndAggregateUsageStats, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().queryAndAggregateUsageStats(beginTime, endTime); + } _reply.readException(); { int N = _reply.readInt(); @@ -154,7 +162,12 @@ public java.lang.String getInterfaceDescriptor() java.util.stream.IntStream.range(0, N).forEach(i -> { String k = _reply.readString(); android.app.usage.UsageStats v; - v = _Parcel.readTypedObject(_reply, android.app.usage.UsageStats.CREATOR); + if ((0!=_reply.readInt())) { + v = android.app.usage.UsageStats.CREATOR.createFromParcel(_reply); + } + else { + v = null; + } _result.put(k, v); }); } @@ -165,46 +178,27 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.app.usage.IUsageStatsManager sDefaultImpl; } static final int TRANSACTION_queryUsageStats = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_queryAndAggregateUsageStats = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.app.usage.IUsageStatsManager"; - public java.util.List queryUsageStats(int intervalType, long beginTime, long endTime) throws android.os.RemoteException; - public java.util.Map queryAndAggregateUsageStats(long beginTime, long endTime) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.app.usage.IUsageStatsManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } + public static github.tornaco.android.thanos.core.app.usage.IUsageStatsManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public java.util.List queryUsageStats(int intervalType, long beginTime, long endTime) throws android.os.RemoteException; + public java.util.Map queryAndAggregateUsageStats(long beginTime, long endTime) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/audio/IAudioManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/audio/IAudioManager.java index 80605b0ef..102b52014 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/audio/IAudioManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/audio/IAudioManager.java @@ -19,6 +19,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.audio.IAudioManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.audio.IAudioManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -46,9 +47,6 @@ public static github.tornaco.android.thanos.core.audio.IAudioManager asInterface @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -56,24 +54,26 @@ public static github.tornaco.android.thanos.core.audio.IAudioManager asInterface reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_hasAudioFocus: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.hasAudioFocus(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.audio.IAudioManager { @@ -97,8 +97,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_hasAudioFocus, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasAudioFocus(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -108,30 +117,25 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.audio.IAudioManager sDefaultImpl; } static final int TRANSACTION_hasAudioFocus = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.audio.IAudioManager"; - public boolean hasAudioFocus(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.audio.IAudioManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.audio.IAudioManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public boolean hasAudioFocus(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IBackupAgent.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IBackupAgent.java index 5230d92e8..038f4f6b2 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IBackupAgent.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IBackupAgent.java @@ -25,6 +25,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.backup.IBackupAgent { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.backup.IBackupAgent"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -52,9 +53,6 @@ public static github.tornaco.android.thanos.core.backup.IBackupAgent asInterface @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -62,11 +60,9 @@ public static github.tornaco.android.thanos.core.backup.IBackupAgent asInterface reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_performBackup: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer _arg0; _arg0 = github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer.Stub.asInterface(data.readStrongBinder()); java.lang.String _arg1; @@ -76,12 +72,18 @@ public static github.tornaco.android.thanos.core.backup.IBackupAgent asInterface github.tornaco.android.thanos.core.backup.IBackupCallback _arg3; _arg3 = github.tornaco.android.thanos.core.backup.IBackupCallback.Stub.asInterface(data.readStrongBinder()); this.performBackup(_arg0, _arg1, _arg2, _arg3); - break; + return true; } case TRANSACTION_performRestore: { + data.enforceInterface(descriptor); android.os.ParcelFileDescriptor _arg0; - _arg0 = _Parcel.readTypedObject(data, android.os.ParcelFileDescriptor.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); java.lang.String _arg2; @@ -89,21 +91,21 @@ public static github.tornaco.android.thanos.core.backup.IBackupAgent asInterface github.tornaco.android.thanos.core.backup.IBackupCallback _arg3; _arg3 = github.tornaco.android.thanos.core.backup.IBackupCallback.Stub.asInterface(data.readStrongBinder()); this.performRestore(_arg0, _arg1, _arg2, _arg3); - break; + return true; } case TRANSACTION_restoreDefault: { + data.enforceInterface(descriptor); boolean _result = this.restoreDefault(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.backup.IBackupAgent { @@ -125,11 +127,15 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(init); + _data.writeStrongBinder((((init!=null))?(init.asBinder()):(null))); _data.writeString(domain); _data.writeString(path); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_performBackup, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().performBackup(init, domain, path, callback); + return; + } } finally { _data.recycle(); @@ -140,11 +146,21 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pfd, 0); + if ((pfd!=null)) { + _data.writeInt(1); + pfd.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(domain); _data.writeString(path); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_performRestore, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().performRestore(pfd, domain, path, callback); + return; + } } finally { _data.recycle(); @@ -158,6 +174,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_restoreDefault, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().restoreDefault(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -167,34 +186,29 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.backup.IBackupAgent sDefaultImpl; } static final int TRANSACTION_performBackup = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_performRestore = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_restoreDefault = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.backup.IBackupAgent"; - public void performBackup(github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer init, java.lang.String domain, java.lang.String path, github.tornaco.android.thanos.core.backup.IBackupCallback callback) throws android.os.RemoteException; - public void performRestore(android.os.ParcelFileDescriptor pfd, java.lang.String domain, java.lang.String path, github.tornaco.android.thanos.core.backup.IBackupCallback callback) throws android.os.RemoteException; - public boolean restoreDefault() throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.backup.IBackupAgent impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.backup.IBackupAgent getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public void performBackup(github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer init, java.lang.String domain, java.lang.String path, github.tornaco.android.thanos.core.backup.IBackupCallback callback) throws android.os.RemoteException; + public void performRestore(android.os.ParcelFileDescriptor pfd, java.lang.String domain, java.lang.String path, github.tornaco.android.thanos.core.backup.IBackupCallback callback) throws android.os.RemoteException; + public boolean restoreDefault() throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IBackupCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IBackupCallback.java index 9a45c1b39..330dd3fa5 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IBackupCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IBackupCallback.java @@ -27,6 +27,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.backup.IBackupCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.backup.IBackupCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -54,9 +55,6 @@ public static github.tornaco.android.thanos.core.backup.IBackupCallback asInterf @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -64,47 +62,47 @@ public static github.tornaco.android.thanos.core.backup.IBackupCallback asInterf reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onBackupFinished: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); this.onBackupFinished(_arg0, _arg1); - break; + return true; } case TRANSACTION_onRestoreFinished: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); this.onRestoreFinished(_arg0, _arg1); - break; + return true; } case TRANSACTION_onFail: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.onFail(_arg0); - break; + return true; } case TRANSACTION_onProgress: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.onProgress(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.backup.IBackupCallback { @@ -129,6 +127,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(domain); _data.writeString(path); boolean _status = mRemote.transact(Stub.TRANSACTION_onBackupFinished, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onBackupFinished(domain, path); + return; + } } finally { _data.recycle(); @@ -142,6 +144,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(domain); _data.writeString(path); boolean _status = mRemote.transact(Stub.TRANSACTION_onRestoreFinished, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onRestoreFinished(domain, path); + return; + } } finally { _data.recycle(); @@ -154,6 +160,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(message); boolean _status = mRemote.transact(Stub.TRANSACTION_onFail, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onFail(message); + return; + } } finally { _data.recycle(); @@ -166,18 +176,38 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(progressMessage); boolean _status = mRemote.transact(Stub.TRANSACTION_onProgress, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onProgress(progressMessage); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.backup.IBackupCallback sDefaultImpl; } static final int TRANSACTION_onBackupFinished = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onRestoreFinished = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_onFail = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_onProgress = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.backup.IBackupCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.backup.IBackupCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.backup.IBackupCallback"; public void onBackupFinished(java.lang.String domain, java.lang.String path) throws android.os.RemoteException; public void onRestoreFinished(java.lang.String domain, java.lang.String path) throws android.os.RemoteException; public void onFail(java.lang.String message) throws android.os.RemoteException; diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IFileDescriptorConsumer.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IFileDescriptorConsumer.java index cfddce27a..b222c8d8b 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IFileDescriptorConsumer.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IFileDescriptorConsumer.java @@ -3,12 +3,14 @@ */ package github.tornaco.android.thanos.core.backup; // oneway + public interface IFileDescriptorConsumer extends android.os.IInterface { /** Default implementation for IFileDescriptorConsumer. */ public static class Default implements github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer { // IO. + @Override public void acceptAppParcelFileDescriptor(android.os.ParcelFileDescriptor pfd) throws android.os.RemoteException { } @@ -20,6 +22,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -47,9 +50,6 @@ public static github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -57,22 +57,24 @@ public static github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_acceptAppParcelFileDescriptor: { + data.enforceInterface(descriptor); android.os.ParcelFileDescriptor _arg0; - _arg0 = _Parcel.readTypedObject(data, android.os.ParcelFileDescriptor.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.acceptAppParcelFileDescriptor(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer { @@ -90,43 +92,50 @@ public java.lang.String getInterfaceDescriptor() return DESCRIPTOR; } // IO. + @Override public void acceptAppParcelFileDescriptor(android.os.ParcelFileDescriptor pfd) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pfd, 0); + if ((pfd!=null)) { + _data.writeInt(1); + pfd.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_acceptAppParcelFileDescriptor, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().acceptAppParcelFileDescriptor(pfd); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer sDefaultImpl; } static final int TRANSACTION_acceptAppParcelFileDescriptor = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer"; - // IO. - public void acceptAppParcelFileDescriptor(android.os.ParcelFileDescriptor pfd) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + // IO. + + public void acceptAppParcelFileDescriptor(android.os.ParcelFileDescriptor pfd) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IFileDescriptorInitializer.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IFileDescriptorInitializer.java index ed8ee437d..502d3947e 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IFileDescriptorInitializer.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/backup/IFileDescriptorInitializer.java @@ -3,6 +3,7 @@ */ package github.tornaco.android.thanos.core.backup; // oneway + public interface IFileDescriptorInitializer extends android.os.IInterface { /** Default implementation for IFileDescriptorInitializer. */ @@ -19,6 +20,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -46,9 +48,6 @@ public static github.tornaco.android.thanos.core.backup.IFileDescriptorInitializ @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -56,11 +55,9 @@ public static github.tornaco.android.thanos.core.backup.IFileDescriptorInitializ reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_initParcelFileDescriptor: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; @@ -68,14 +65,13 @@ public static github.tornaco.android.thanos.core.backup.IFileDescriptorInitializ github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer _arg2; _arg2 = github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer.Stub.asInterface(data.readStrongBinder()); this.initParcelFileDescriptor(_arg0, _arg1, _arg2); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer { @@ -99,16 +95,36 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(domain); _data.writeString(path); - _data.writeStrongInterface(consumer); + _data.writeStrongBinder((((consumer!=null))?(consumer.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_initParcelFileDescriptor, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().initParcelFileDescriptor(domain, path, consumer); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer sDefaultImpl; } static final int TRANSACTION_initParcelFileDescriptor = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.backup.IFileDescriptorInitializer"; public void initParcelFileDescriptor(java.lang.String domain, java.lang.String path, github.tornaco.android.thanos.core.backup.IFileDescriptorConsumer consumer) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/input/IInputManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/input/IInputManager.java index 8e210fa64..8efd6c4fd 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/input/IInputManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/input/IInputManager.java @@ -26,6 +26,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.input.IInputManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.input.IInputManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -53,9 +54,6 @@ public static github.tornaco.android.thanos.core.input.IInputManager asInterface @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -63,41 +61,45 @@ public static github.tornaco.android.thanos.core.input.IInputManager asInterface reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_injectKey: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.injectKey(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getLastKey: { + data.enforceInterface(descriptor); int _result = this.getLastKey(); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_onKeyEvent: { + data.enforceInterface(descriptor); android.view.KeyEvent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.view.KeyEvent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.view.KeyEvent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); this.onKeyEvent(_arg0, _arg1); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.input.IInputManager { @@ -123,6 +125,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(keyCode); boolean _status = mRemote.transact(Stub.TRANSACTION_injectKey, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().injectKey(keyCode); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -140,6 +145,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getLastKey, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getLastKey(); + } _reply.readException(); _result = _reply.readInt(); } @@ -155,9 +163,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, keyEvent, 0); + if ((keyEvent!=null)) { + _data.writeInt(1); + keyEvent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(source); boolean _status = mRemote.transact(Stub.TRANSACTION_onKeyEvent, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onKeyEvent(keyEvent, source); + return; + } _reply.readException(); } finally { @@ -165,34 +183,29 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.input.IInputManager sDefaultImpl; } static final int TRANSACTION_injectKey = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_getLastKey = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_onKeyEvent = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.input.IInputManager"; - public boolean injectKey(int keyCode) throws android.os.RemoteException; - public int getLastKey() throws android.os.RemoteException; - public void onKeyEvent(android.view.KeyEvent keyEvent, java.lang.String source) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.input.IInputManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.input.IInputManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public boolean injectKey(int keyCode) throws android.os.RemoteException; + public int getLastKey() throws android.os.RemoteException; + public void onKeyEvent(android.view.KeyEvent keyEvent, java.lang.String source) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/n/INotificationManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/n/INotificationManager.java index 58955aeae..a27dead64 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/n/INotificationManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/n/INotificationManager.java @@ -75,6 +75,7 @@ public static class Default implements github.tornaco.android.thanos.core.n.INot { } // For searching. + @Override public java.util.List getAllNotificationRecordsByPageAndKeyword(int start, int limit, java.lang.String keyword) throws android.os.RemoteException { return null; @@ -129,6 +130,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.n.INotificationManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.n.INotificationManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -156,9 +158,6 @@ public static github.tornaco.android.thanos.core.n.INotificationManager asInterf @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -166,169 +165,201 @@ public static github.tornaco.android.thanos.core.n.INotificationManager asInterf reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_getShowingNotificationRecordsForPackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.util.List _result = this.getShowingNotificationRecordsForPackage(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_hasShowingNotificationRecordsForPackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.hasShowingNotificationRecordsForPackage(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_registerObserver: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.n.INotificationObserver _arg0; _arg0 = github.tornaco.android.thanos.core.n.INotificationObserver.Stub.asInterface(data.readStrongBinder()); this.registerObserver(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_unRegisterObserver: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.n.INotificationObserver _arg0; _arg0 = github.tornaco.android.thanos.core.n.INotificationObserver.Stub.asInterface(data.readStrongBinder()); this.unRegisterObserver(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setScreenOnNotificationEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setScreenOnNotificationEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isScreenOnNotificationEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isScreenOnNotificationEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setScreenOnNotificationEnabledForPkg: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setScreenOnNotificationEnabledForPkg(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isScreenOnNotificationEnabledForPkg: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isScreenOnNotificationEnabledForPkg(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_nextNotificationId: { + data.enforceInterface(descriptor); int _result = this.nextNotificationId(); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_setPersistOnNewNotificationEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setPersistOnNewNotificationEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPersistOnNewNotificationEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isPersistOnNewNotificationEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_cleanUpPersistNotificationRecords: { + data.enforceInterface(descriptor); this.cleanUpPersistNotificationRecords(); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAllNotificationRecordsByPage: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _arg1; _arg1 = data.readInt(); java.util.List _result = this.getAllNotificationRecordsByPage(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getNotificationRecordsForPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.util.List _result = this.getNotificationRecordsForPackage(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_onAddNotificationRecord: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.n.NotificationRecord _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onAddNotificationRecord(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setShowToastAppInfoEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setShowToastAppInfoEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isShowToastAppInfoEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isShowToastAppInfoEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isNREnabled: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.isNREnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setNREnabled: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setNREnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAllNotificationRecordsByPageAndKeyword: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _arg1; @@ -337,11 +368,12 @@ public static github.tornaco.android.thanos.core.n.INotificationManager asInterf _arg2 = data.readString(); java.util.List _result = this.getAllNotificationRecordsByPageAndKeyword(_arg0, _arg1, _arg2); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getAllNotificationRecordsByPageAndKeywordInDateRange: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _arg1; @@ -354,116 +386,176 @@ public static github.tornaco.android.thanos.core.n.INotificationManager asInterf _arg4 = data.readString(); java.util.List _result = this.getAllNotificationRecordsByPageAndKeywordInDateRange(_arg0, _arg1, _arg2, _arg3, _arg4); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_onSetPrimaryClip: { + data.enforceInterface(descriptor); android.content.ClipData _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.ClipData.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.ClipData.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } github.tornaco.android.thanos.core.pm.Pkg _arg1; - _arg1 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg1 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } this.onSetPrimaryClip(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPackageRedactionNotificationEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPackageRedactionNotificationEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPackageRedactionNotificationEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPackageRedactionNotificationEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setPackageRedactionNotificationTitle: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); this.setPackageRedactionNotificationTitle(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getPackageRedactionNotificationTitle: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _result = this.getPackageRedactionNotificationTitle(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_setPackageRedactionNotificationText: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); this.setPackageRedactionNotificationText(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getPackageRedactionNotificationText: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _result = this.getPackageRedactionNotificationText(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_setPersistAllPkgEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setPersistAllPkgEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPersistAllPkgEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isPersistAllPkgEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setPkgNREnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgNREnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPkgNREnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPkgNREnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.n.INotificationManager { @@ -487,8 +579,17 @@ public java.lang.String getInterfaceDescriptor() java.util.List _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getShowingNotificationRecordsForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getShowingNotificationRecordsForPackage(pkg); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); } @@ -505,8 +606,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_hasShowingNotificationRecordsForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasShowingNotificationRecordsForPackage(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -522,8 +632,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(obs); + _data.writeStrongBinder((((obs!=null))?(obs.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_registerObserver, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().registerObserver(obs); + return; + } _reply.readException(); } finally { @@ -537,8 +651,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(obs); + _data.writeStrongBinder((((obs!=null))?(obs.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterObserver, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unRegisterObserver(obs); + return; + } _reply.readException(); } finally { @@ -554,6 +672,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setScreenOnNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setScreenOnNotificationEnabled(enable); + return; + } _reply.readException(); } finally { @@ -569,6 +691,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isScreenOnNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isScreenOnNotificationEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -587,6 +712,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkg); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setScreenOnNotificationEnabledForPkg, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setScreenOnNotificationEnabledForPkg(pkg, enable); + return; + } _reply.readException(); } finally { @@ -603,6 +732,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkg); boolean _status = mRemote.transact(Stub.TRANSACTION_isScreenOnNotificationEnabledForPkg, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isScreenOnNotificationEnabledForPkg(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -620,6 +752,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_nextNotificationId, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().nextNotificationId(); + } _reply.readException(); _result = _reply.readInt(); } @@ -637,6 +772,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPersistOnNewNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPersistOnNewNotificationEnabled(enable); + return; + } _reply.readException(); } finally { @@ -652,6 +791,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isPersistOnNewNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPersistOnNewNotificationEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -668,6 +810,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_cleanUpPersistNotificationRecords, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().cleanUpPersistNotificationRecords(); + return; + } _reply.readException(); } finally { @@ -685,6 +831,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(start); _data.writeInt(limit); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllNotificationRecordsByPage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllNotificationRecordsByPage(start, limit); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); } @@ -703,6 +852,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getNotificationRecordsForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getNotificationRecordsForPackage(packageName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); } @@ -718,8 +870,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, record, 0); + if ((record!=null)) { + _data.writeInt(1); + record.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onAddNotificationRecord, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onAddNotificationRecord(record); + return; + } _reply.readException(); } finally { @@ -735,6 +897,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setShowToastAppInfoEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setShowToastAppInfoEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -750,6 +916,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isShowToastAppInfoEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isShowToastAppInfoEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -768,6 +937,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(type); boolean _status = mRemote.transact(Stub.TRANSACTION_isNREnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isNREnabled(type); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -786,6 +958,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(type); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setNREnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setNREnabled(type, enabled); + return; + } _reply.readException(); } finally { @@ -794,6 +970,7 @@ public java.lang.String getInterfaceDescriptor() } } // For searching. + @Override public java.util.List getAllNotificationRecordsByPageAndKeyword(int start, int limit, java.lang.String keyword) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -805,6 +982,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(limit); _data.writeString(keyword); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllNotificationRecordsByPageAndKeyword, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllNotificationRecordsByPageAndKeyword(start, limit, keyword); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); } @@ -827,6 +1007,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeLong(endTimeMills); _data.writeString(keyword); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllNotificationRecordsByPageAndKeywordInDateRange, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllNotificationRecordsByPageAndKeywordInDateRange(start, limit, startTimeMills, endTimeMills, keyword); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); } @@ -842,9 +1025,25 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, clip, 0); - _Parcel.writeTypedObject(_data, caller, 0); + if ((clip!=null)) { + _data.writeInt(1); + clip.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } + if ((caller!=null)) { + _data.writeInt(1); + caller.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onSetPrimaryClip, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onSetPrimaryClip(clip, caller); + return; + } _reply.readException(); } finally { @@ -858,9 +1057,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPackageRedactionNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPackageRedactionNotificationEnabled(pkg, enable); + return; + } _reply.readException(); } finally { @@ -875,8 +1084,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPackageRedactionNotificationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPackageRedactionNotificationEnabled(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -892,9 +1110,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(title); boolean _status = mRemote.transact(Stub.TRANSACTION_setPackageRedactionNotificationTitle, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPackageRedactionNotificationTitle(pkg, title); + return; + } _reply.readException(); } finally { @@ -909,8 +1137,17 @@ public java.lang.String getInterfaceDescriptor() java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getPackageRedactionNotificationTitle, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPackageRedactionNotificationTitle(pkg); + } _reply.readException(); _result = _reply.readString(); } @@ -926,9 +1163,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(text); boolean _status = mRemote.transact(Stub.TRANSACTION_setPackageRedactionNotificationText, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPackageRedactionNotificationText(pkg, text); + return; + } _reply.readException(); } finally { @@ -943,8 +1190,17 @@ public java.lang.String getInterfaceDescriptor() java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getPackageRedactionNotificationText, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPackageRedactionNotificationText(pkg); + } _reply.readException(); _result = _reply.readString(); } @@ -962,6 +1218,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPersistAllPkgEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPersistAllPkgEnabled(enable); + return; + } _reply.readException(); } finally { @@ -977,6 +1237,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isPersistAllPkgEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPersistAllPkgEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -992,9 +1255,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgNREnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgNREnabled(pkg, enable); + return; + } _reply.readException(); } finally { @@ -1009,8 +1282,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgNREnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgNREnabled(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1020,6 +1302,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.n.INotificationManager sDefaultImpl; } static final int TRANSACTION_getShowingNotificationRecordsForPackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_hasShowingNotificationRecordsForPackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -1053,8 +1336,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_isPersistAllPkgEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29); static final int TRANSACTION_setPkgNREnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30); static final int TRANSACTION_isPkgNREnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.n.INotificationManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.n.INotificationManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.n.INotificationManager"; public java.util.List getShowingNotificationRecordsForPackage(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public boolean hasShowingNotificationRecordsForPackage(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public void registerObserver(github.tornaco.android.thanos.core.n.INotificationObserver obs) throws android.os.RemoteException; @@ -1075,6 +1373,7 @@ public java.lang.String getInterfaceDescriptor() public boolean isNREnabled(int type) throws android.os.RemoteException; public void setNREnabled(int type, boolean enabled) throws android.os.RemoteException; // For searching. + public java.util.List getAllNotificationRecordsByPageAndKeyword(int start, int limit, java.lang.String keyword) throws android.os.RemoteException; public java.util.List getAllNotificationRecordsByPageAndKeywordInDateRange(int start, int limit, long startTimeMills, long endTimeMills, java.lang.String keyword) throws android.os.RemoteException; public void onSetPrimaryClip(android.content.ClipData clip, github.tornaco.android.thanos.core.pm.Pkg caller) throws android.os.RemoteException; @@ -1088,39 +1387,4 @@ public java.lang.String getInterfaceDescriptor() public boolean isPersistAllPkgEnabled() throws android.os.RemoteException; public void setPkgNREnabled(github.tornaco.android.thanos.core.pm.Pkg pkg, boolean enable) throws android.os.RemoteException; public boolean isPkgNREnabled(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/n/INotificationObserver.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/n/INotificationObserver.java index 8cdbd1a1a..330e14e76 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/n/INotificationObserver.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/n/INotificationObserver.java @@ -27,6 +27,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.n.INotificationObserver { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.n.INotificationObserver"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -54,9 +55,6 @@ public static github.tornaco.android.thanos.core.n.INotificationObserver asInter @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -64,43 +62,63 @@ public static github.tornaco.android.thanos.core.n.INotificationObserver asInter reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onNewNotification: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.n.NotificationRecord _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onNewNotification(_arg0); - break; + return true; } case TRANSACTION_onNotificationRemoved: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.n.NotificationRecord _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onNotificationRemoved(_arg0); - break; + return true; } case TRANSACTION_onNotificationUpdated: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.n.NotificationRecord _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onNotificationUpdated(_arg0); - break; + return true; } case TRANSACTION_onNotificationClicked: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.n.NotificationRecord _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.n.NotificationRecord.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onNotificationClicked(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.n.INotificationObserver { @@ -122,8 +140,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, record, 0); + if ((record!=null)) { + _data.writeInt(1); + record.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onNewNotification, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onNewNotification(record); + return; + } } finally { _data.recycle(); @@ -134,8 +162,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, record, 0); + if ((record!=null)) { + _data.writeInt(1); + record.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onNotificationRemoved, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onNotificationRemoved(record); + return; + } } finally { _data.recycle(); @@ -146,8 +184,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, record, 0); + if ((record!=null)) { + _data.writeInt(1); + record.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onNotificationUpdated, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onNotificationUpdated(record); + return; + } } finally { _data.recycle(); @@ -158,43 +206,48 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, record, 0); + if ((record!=null)) { + _data.writeInt(1); + record.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onNotificationClicked, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onNotificationClicked(record); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.n.INotificationObserver sDefaultImpl; } static final int TRANSACTION_onNewNotification = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onNotificationRemoved = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_onNotificationUpdated = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_onNotificationClicked = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.n.INotificationObserver impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.n.INotificationObserver getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.n.INotificationObserver"; public void onNewNotification(github.tornaco.android.thanos.core.n.NotificationRecord record) throws android.os.RemoteException; public void onNotificationRemoved(github.tornaco.android.thanos.core.n.NotificationRecord record) throws android.os.RemoteException; public void onNotificationUpdated(github.tornaco.android.thanos.core.n.NotificationRecord record) throws android.os.RemoteException; public void onNotificationClicked(github.tornaco.android.thanos.core.n.NotificationRecord record) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/net/INetworkManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/net/INetworkManager.java index 777723460..31b66460c 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/net/INetworkManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/net/INetworkManager.java @@ -19,6 +19,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.net.INetworkManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.net.INetworkManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -46,9 +47,6 @@ public static github.tornaco.android.thanos.core.net.INetworkManager asInterface @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -56,24 +54,27 @@ public static github.tornaco.android.thanos.core.net.INetworkManager asInterface reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_getUidTrafficStats: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); github.tornaco.android.thanos.core.net.TrafficStats _result = this.getUidTrafficStats(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.net.INetworkManager { @@ -99,8 +100,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(uid); boolean _status = mRemote.transact(Stub.TRANSACTION_getUidTrafficStats, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getUidTrafficStats(uid); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.net.TrafficStats.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.net.TrafficStats.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -108,30 +117,25 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.net.INetworkManager sDefaultImpl; } static final int TRANSACTION_getUidTrafficStats = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.net.INetworkManager"; - public github.tornaco.android.thanos.core.net.TrafficStats getUidTrafficStats(int uid) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.net.INetworkManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.net.INetworkManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public github.tornaco.android.thanos.core.net.TrafficStats getUidTrafficStats(int uid) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/ops/IOps.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/ops/IOps.java index 621395332..5af01bf34 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/ops/IOps.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/ops/IOps.java @@ -38,6 +38,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.ops.IOps { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.ops.IOps"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -65,9 +66,6 @@ public static github.tornaco.android.thanos.core.ops.IOps asInterface(android.os @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -75,76 +73,99 @@ public static github.tornaco.android.thanos.core.ops.IOps asInterface(android.os reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_setMode: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); github.tornaco.android.thanos.core.pm.Pkg _arg1; - _arg1 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg1 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } java.lang.String _arg2; _arg2 = data.readString(); this.setMode(_arg0, _arg1, _arg2); reply.writeNoException(); - break; + return true; } case TRANSACTION_getPackagePermInfo: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); github.tornaco.android.thanos.core.pm.Pkg _arg1; - _arg1 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg1 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } github.tornaco.android.thanos.core.ops.PermInfo _result = this.getPackagePermInfo(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_opToName: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.opToName(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_opToPermission: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.opToPermission(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getPermissionFlags: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.pm.Pkg _arg1; - _arg1 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg1 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } int _result = this.getPermissionFlags(_arg0, _arg1); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_permissionFlagToString: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.permissionFlagToString(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.ops.IOps { @@ -168,9 +189,19 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(code); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(permStateName); boolean _status = mRemote.transact(Stub.TRANSACTION_setMode, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setMode(code, pkg, permStateName); + return; + } _reply.readException(); } finally { @@ -186,10 +217,24 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(code); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getPackagePermInfo, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPackagePermInfo(code, pkg); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.ops.PermInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.ops.PermInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -206,6 +251,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(code); boolean _status = mRemote.transact(Stub.TRANSACTION_opToName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().opToName(code); + } _reply.readException(); _result = _reply.readString(); } @@ -224,6 +272,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(code); boolean _status = mRemote.transact(Stub.TRANSACTION_opToPermission, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().opToPermission(code); + } _reply.readException(); _result = _reply.readString(); } @@ -241,8 +292,17 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(permName); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getPermissionFlags, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPermissionFlags(permName, pkg); + } _reply.readException(); _result = _reply.readInt(); } @@ -261,6 +321,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(flag); boolean _status = mRemote.transact(Stub.TRANSACTION_permissionFlagToString, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().permissionFlagToString(flag); + } _reply.readException(); _result = _reply.readString(); } @@ -270,6 +333,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.ops.IOps sDefaultImpl; } static final int TRANSACTION_setMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_getPackagePermInfo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -277,33 +341,27 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_opToPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); static final int TRANSACTION_getPermissionFlags = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); static final int TRANSACTION_permissionFlagToString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.ops.IOps impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.ops.IOps getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.ops.IOps"; public void setMode(int code, github.tornaco.android.thanos.core.pm.Pkg pkg, java.lang.String permStateName) throws android.os.RemoteException; public github.tornaco.android.thanos.core.ops.PermInfo getPackagePermInfo(int code, github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public java.lang.String opToName(int code) throws android.os.RemoteException; public java.lang.String opToPermission(int code) throws android.os.RemoteException; public int getPermissionFlags(java.lang.String permName, github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public java.lang.String permissionFlagToString(int flag) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/os/IServiceManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/os/IServiceManager.java index 1e39661f2..45c75da35 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/os/IServiceManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/os/IServiceManager.java @@ -26,6 +26,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.os.IServiceManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.os.IServiceManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -53,9 +54,6 @@ public static github.tornaco.android.thanos.core.os.IServiceManager asInterface( @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -63,43 +61,42 @@ public static github.tornaco.android.thanos.core.os.IServiceManager asInterface( reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_hasService: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.hasService(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_addService: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.os.IBinder _arg1; _arg1 = data.readStrongBinder(); this.addService(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getService: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.os.IBinder _result = this.getService(_arg0); reply.writeNoException(); reply.writeStrongBinder(_result); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.os.IServiceManager { @@ -125,6 +122,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(name); boolean _status = mRemote.transact(Stub.TRANSACTION_hasService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasService(name); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -143,6 +143,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(name); _data.writeStrongBinder(binder); boolean _status = mRemote.transact(Stub.TRANSACTION_addService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addService(name, binder); + return; + } _reply.readException(); } finally { @@ -159,6 +163,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(name); boolean _status = mRemote.transact(Stub.TRANSACTION_getService, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getService(name); + } _reply.readException(); _result = _reply.readStrongBinder(); } @@ -168,12 +175,28 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.os.IServiceManager sDefaultImpl; } static final int TRANSACTION_hasService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_addService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_getService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.os.IServiceManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.os.IServiceManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.os.IServiceManager"; public boolean hasService(java.lang.String name) throws android.os.RemoteException; public void addService(java.lang.String name, android.os.IBinder binder) throws android.os.RemoteException; public android.os.IBinder getService(java.lang.String name) throws android.os.RemoteException; diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/plus/ICallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/plus/ICallback.java index 98f7e7dd8..7283911df 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/plus/ICallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/plus/ICallback.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.plus.ICallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.plus.ICallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.plus.ICallback asInterface(andr @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,22 +53,24 @@ public static github.tornaco.android.thanos.core.plus.ICallback asInterface(andr reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onRes: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.plus.RR _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.plus.RR.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.plus.RR.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onRes(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.plus.ICallback { @@ -92,37 +92,42 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, res, 0); + if ((res!=null)) { + _data.writeInt(1); + res.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onRes, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onRes(res); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.plus.ICallback sDefaultImpl; } static final int TRANSACTION_onRes = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.plus.ICallback"; - public void onRes(github.tornaco.android.thanos.core.plus.RR res) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.plus.ICallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.plus.ICallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public void onRes(github.tornaco.android.thanos.core.plus.RR res) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/plus/IRS.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/plus/IRS.java index 6c01af523..ea3cdb18b 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/plus/IRS.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/plus/IRS.java @@ -3,16 +3,19 @@ */ package github.tornaco.android.thanos.core.plus; // Remote Server + public interface IRS extends android.os.IInterface { /** Default implementation for IRS. */ public static class Default implements github.tornaco.android.thanos.core.plus.IRS { // Bind code. + @Override public void bc(java.lang.String code, java.lang.String deviceId, github.tornaco.android.thanos.core.plus.ICallback cb) throws android.os.RemoteException { } // Verify binding. + @Override public void vb(java.lang.String code, java.lang.String deviceId, github.tornaco.android.thanos.core.plus.ICallback cb) throws android.os.RemoteException { } @@ -24,6 +27,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.plus.IRS { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.plus.IRS"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -51,9 +55,6 @@ public static github.tornaco.android.thanos.core.plus.IRS asInterface(android.os @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -61,11 +62,9 @@ public static github.tornaco.android.thanos.core.plus.IRS asInterface(android.os reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_bc: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; @@ -74,10 +73,11 @@ public static github.tornaco.android.thanos.core.plus.IRS asInterface(android.os _arg2 = github.tornaco.android.thanos.core.plus.ICallback.Stub.asInterface(data.readStrongBinder()); this.bc(_arg0, _arg1, _arg2); reply.writeNoException(); - break; + return true; } case TRANSACTION_vb: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; @@ -86,14 +86,13 @@ public static github.tornaco.android.thanos.core.plus.IRS asInterface(android.os _arg2 = github.tornaco.android.thanos.core.plus.ICallback.Stub.asInterface(data.readStrongBinder()); this.vb(_arg0, _arg1, _arg2); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.plus.IRS { @@ -111,6 +110,7 @@ public java.lang.String getInterfaceDescriptor() return DESCRIPTOR; } // Bind code. + @Override public void bc(java.lang.String code, java.lang.String deviceId, github.tornaco.android.thanos.core.plus.ICallback cb) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -119,8 +119,12 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(code); _data.writeString(deviceId); - _data.writeStrongInterface(cb); + _data.writeStrongBinder((((cb!=null))?(cb.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_bc, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().bc(code, deviceId, cb); + return; + } _reply.readException(); } finally { @@ -129,6 +133,7 @@ public java.lang.String getInterfaceDescriptor() } } // Verify binding. + @Override public void vb(java.lang.String code, java.lang.String deviceId, github.tornaco.android.thanos.core.plus.ICallback cb) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -137,8 +142,12 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(code); _data.writeString(deviceId); - _data.writeStrongInterface(cb); + _data.writeStrongBinder((((cb!=null))?(cb.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_vb, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().vb(code, deviceId, cb); + return; + } _reply.readException(); } finally { @@ -146,13 +155,31 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.plus.IRS sDefaultImpl; } static final int TRANSACTION_bc = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_vb = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.plus.IRS impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.plus.IRS getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.plus.IRS"; // Bind code. + public void bc(java.lang.String code, java.lang.String deviceId, github.tornaco.android.thanos.core.plus.ICallback cb) throws android.os.RemoteException; // Verify binding. + public void vb(java.lang.String code, java.lang.String deviceId, github.tornaco.android.thanos.core.plus.ICallback cb) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IAddPluginCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IAddPluginCallback.java index 78156da1c..65e4d4d07 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IAddPluginCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IAddPluginCallback.java @@ -24,6 +24,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.pm.IAddPluginCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pm.IAddPluginCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -51,9 +52,6 @@ public static github.tornaco.android.thanos.core.pm.IAddPluginCallback asInterfa @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -61,34 +59,33 @@ public static github.tornaco.android.thanos.core.pm.IAddPluginCallback asInterfa reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onPluginAdd: { + data.enforceInterface(descriptor); this.onPluginAdd(); - break; + return true; } case TRANSACTION_onFail: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.onFail(_arg0); - break; + return true; } case TRANSACTION_onProgress: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.onProgress(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.pm.IAddPluginCallback { @@ -111,6 +108,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_onPluginAdd, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onPluginAdd(); + return; + } } finally { _data.recycle(); @@ -123,6 +124,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(message); boolean _status = mRemote.transact(Stub.TRANSACTION_onFail, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onFail(message); + return; + } } finally { _data.recycle(); @@ -135,17 +140,37 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(progressMessage); boolean _status = mRemote.transact(Stub.TRANSACTION_onProgress, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onProgress(progressMessage); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.pm.IAddPluginCallback sDefaultImpl; } static final int TRANSACTION_onPluginAdd = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onFail = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_onProgress = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.pm.IAddPluginCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.pm.IAddPluginCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pm.IAddPluginCallback"; public void onPluginAdd() throws android.os.RemoteException; public void onFail(java.lang.String message) throws android.os.RemoteException; public void onProgress(java.lang.String progressMessage) throws android.os.RemoteException; diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPackageEnableStateChangeListener.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPackageEnableStateChangeListener.java index bfdce82b9..30e5d32bf 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPackageEnableStateChangeListener.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPackageEnableStateChangeListener.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeLis @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,22 +53,19 @@ public static github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeLis reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onPackageEnableStateChanged: { + data.enforceInterface(descriptor); java.util.List _arg0; _arg0 = data.createTypedArrayList(github.tornaco.android.thanos.core.pm.Pkg.CREATOR); this.onPackageEnableStateChanged(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener { @@ -92,51 +87,36 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedList(_data, pkgs, 0); + _data.writeTypedList(pkgs); boolean _status = mRemote.transact(Stub.TRANSACTION_onPackageEnableStateChanged, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onPackageEnableStateChanged(pkgs); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener sDefaultImpl; } static final int TRANSACTION_onPackageEnableStateChanged = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener"; - public void onPackageEnableStateChanged(java.util.List pkgs) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } + public static github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public void onPackageEnableStateChanged(java.util.List pkgs) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPackageSetChangeListener.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPackageSetChangeListener.java index a062df480..dbebedd80 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPackageSetChangeListener.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPackageSetChangeListener.java @@ -24,6 +24,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.pm.IPackageSetChangeListener { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pm.IPackageSetChangeListener"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -51,9 +52,6 @@ public static github.tornaco.android.thanos.core.pm.IPackageSetChangeListener as @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -61,36 +59,35 @@ public static github.tornaco.android.thanos.core.pm.IPackageSetChangeListener as reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onPackageSetAdded: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.onPackageSetAdded(_arg0); - break; + return true; } case TRANSACTION_onPackageSetRemoved: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.onPackageSetRemoved(_arg0); - break; + return true; } case TRANSACTION_onPackageSetChanged: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.onPackageSetChanged(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.pm.IPackageSetChangeListener { @@ -114,6 +111,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgSetId); boolean _status = mRemote.transact(Stub.TRANSACTION_onPackageSetAdded, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onPackageSetAdded(pkgSetId); + return; + } } finally { _data.recycle(); @@ -126,6 +127,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgSetId); boolean _status = mRemote.transact(Stub.TRANSACTION_onPackageSetRemoved, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onPackageSetRemoved(pkgSetId); + return; + } } finally { _data.recycle(); @@ -138,17 +143,37 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgSetId); boolean _status = mRemote.transact(Stub.TRANSACTION_onPackageSetChanged, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onPackageSetChanged(pkgSetId); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.pm.IPackageSetChangeListener sDefaultImpl; } static final int TRANSACTION_onPackageSetAdded = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onPackageSetRemoved = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_onPackageSetChanged = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.pm.IPackageSetChangeListener impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.pm.IPackageSetChangeListener getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pm.IPackageSetChangeListener"; public void onPackageSetAdded(java.lang.String pkgSetId) throws android.os.RemoteException; public void onPackageSetRemoved(java.lang.String pkgSetId) throws android.os.RemoteException; public void onPackageSetChanged(java.lang.String pkgSetId) throws android.os.RemoteException; diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPkgManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPkgManager.java index 8c56e9c62..fc437050c 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPkgManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pm/IPkgManager.java @@ -16,6 +16,7 @@ public static class Default implements github.tornaco.android.thanos.core.pm.IPk return 0; } // ApplicationInfo + @Override public java.util.List getInstalledPkgs(int flags) throws android.os.RemoteException { return null; @@ -251,6 +252,7 @@ public static class Default implements github.tornaco.android.thanos.core.pm.IPk return null; } // Wrap api to skip permission check + @Override public java.lang.String[] getPackagesForUid(int uid) throws android.os.RemoteException { return null; @@ -315,6 +317,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.pm.IPkgManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pm.IPkgManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -342,9 +345,6 @@ public static github.tornaco.android.thanos.core.pm.IPkgManager asInterface(andr @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -352,140 +352,187 @@ public static github.tornaco.android.thanos.core.pm.IPkgManager asInterface(andr reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_getPkgNameForUid: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String[] _result = this.getPkgNameForUid(_arg0); reply.writeNoException(); reply.writeStringArray(_result); - break; + return true; } case TRANSACTION_getUidForPkgName: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _result = this.getUidForPkgName(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_getInstalledPkgs: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.util.List _result = this.getInstalledPkgs(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getAppInfo: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.pm.AppInfo _result = this.getAppInfo(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_getWhiteListPkgs: { + data.enforceInterface(descriptor); java.lang.String[] _result = this.getWhiteListPkgs(); reply.writeNoException(); reply.writeStringArray(_result); - break; + return true; } case TRANSACTION_isPkgInWhiteList: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isPkgInWhiteList(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setComponentEnabledSetting: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); android.content.ComponentName _arg1; - _arg1 = _Parcel.readTypedObject(data, android.content.ComponentName.CREATOR); + if ((0!=data.readInt())) { + _arg1 = android.content.ComponentName.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } int _arg2; _arg2 = data.readInt(); int _arg3; _arg3 = data.readInt(); this.setComponentEnabledSetting(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - break; + return true; } case TRANSACTION_getComponentEnabledSetting: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); android.content.ComponentName _arg1; - _arg1 = _Parcel.readTypedObject(data, android.content.ComponentName.CREATOR); + if ((0!=data.readInt())) { + _arg1 = android.content.ComponentName.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } int _result = this.getComponentEnabledSetting(_arg0, _arg1); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_isComponentDisabledByThanox: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); android.content.ComponentName _arg1; - _arg1 = _Parcel.readTypedObject(data, android.content.ComponentName.CREATOR); + if ((0!=data.readInt())) { + _arg1 = android.content.ComponentName.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } boolean _result = this.isComponentDisabledByThanox(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getApplicationEnableState: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.getApplicationEnableState(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setApplicationEnableState: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); boolean _arg2; _arg2 = (0!=data.readInt()); this.setApplicationEnableState(_arg0, _arg1, _arg2); reply.writeNoException(); - break; + return true; } case TRANSACTION_getActivities: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; _arg1 = data.readString(); java.util.List _result = this.getActivities(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getActivitiesCount: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _result = this.getActivitiesCount(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_getActivitiesInBatch: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; @@ -496,31 +543,34 @@ public static github.tornaco.android.thanos.core.pm.IPkgManager asInterface(andr _arg3 = data.readInt(); java.util.List _result = this.getActivitiesInBatch(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getReceivers: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; _arg1 = data.readString(); java.util.List _result = this.getReceivers(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getReceiverCount: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _result = this.getReceiverCount(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_getReceiversInBatch: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; @@ -531,31 +581,34 @@ public static github.tornaco.android.thanos.core.pm.IPkgManager asInterface(andr _arg3 = data.readInt(); java.util.List _result = this.getReceiversInBatch(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getServices: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; _arg1 = data.readString(); java.util.List _result = this.getServices(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getServiceCount: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _result = this.getServiceCount(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_getServicesInBatch: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; @@ -566,263 +619,321 @@ public static github.tornaco.android.thanos.core.pm.IPkgManager asInterface(andr _arg3 = data.readInt(); java.util.List _result = this.getServicesInBatch(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_setSmartFreezeEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartFreezeEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isSmartFreezeEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSmartFreezeEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setPkgSmartFreezeEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgSmartFreezeEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPkgSmartFreezeEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isPkgSmartFreezeEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getSmartFreezePkgs: { + data.enforceInterface(descriptor); java.util.List _result = this.getSmartFreezePkgs(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_launchSmartFreezePkg: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.launchSmartFreezePkg(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setSmartFreezeScreenOffCheckEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartFreezeScreenOffCheckEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isSmartFreezeScreenOffCheckEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSmartFreezeScreenOffCheckEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSmartFreezeScreenOffCheckDelay: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); this.setSmartFreezeScreenOffCheckDelay(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getSmartFreezeScreenOffCheckDelay: { + data.enforceInterface(descriptor); long _result = this.getSmartFreezeScreenOffCheckDelay(); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_queryLaunchIntentForPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); android.content.Intent _result = this.queryLaunchIntentForPackage(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_enableAllThanoxDisabledPackages: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); java.util.List _result = this.enableAllThanoxDisabledPackages(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_deviceHasGms: { + data.enforceInterface(descriptor); boolean _result = this.deviceHasGms(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_verifyBillingState: { + data.enforceInterface(descriptor); boolean _result = this.verifyBillingState(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_launchSmartFreezePkgThenKillOrigin: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); this.launchSmartFreezePkgThenKillOrigin(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isProtectedWhitelistEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isProtectedWhitelistEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setProtectedWhitelistEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setProtectedWhitelistEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_addPlugin: { + data.enforceInterface(descriptor); android.os.ParcelFileDescriptor _arg0; - _arg0 = _Parcel.readTypedObject(data, android.os.ParcelFileDescriptor.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); github.tornaco.android.thanos.core.pm.IAddPluginCallback _arg2; _arg2 = github.tornaco.android.thanos.core.pm.IAddPluginCallback.Stub.asInterface(data.readStrongBinder()); this.addPlugin(_arg0, _arg1, _arg2); - break; + return true; } case TRANSACTION_removePlugin: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.removePlugin(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_hasPlugin: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.hasPlugin(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isSmartFreezeHidePackageEventEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSmartFreezeHidePackageEventEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSmartFreezeHidePackageEventEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSmartFreezeHidePackageEventEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_dump: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.IPrinter _arg0; _arg0 = github.tornaco.android.thanos.core.IPrinter.Stub.asInterface(data.readStrongBinder()); this.dump(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPackageBlockUninstallEnabled: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setPackageBlockUninstallEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPackageBlockUninstallEnabled: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isPackageBlockUninstallEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setPackageBlockClearDataEnabled: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setPackageBlockClearDataEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPackageBlockClearDataEnabled: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isPackageBlockClearDataEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getInstalledPackagesCount: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _result = this.getInstalledPackagesCount(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_createPackageSet: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.pm.PackageSet _result = this.createPackageSet(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_removePackageSet: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.removePackageSet(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getPackageSetById: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; @@ -831,277 +942,368 @@ public static github.tornaco.android.thanos.core.pm.IPkgManager asInterface(andr _arg2 = (0!=data.readInt()); github.tornaco.android.thanos.core.pm.PackageSet _result = this.getPackageSetById(_arg0, _arg1, _arg2); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_getAllPackageSets: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); java.util.List _result = this.getAllPackageSets(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getAllPackageSetIds: { + data.enforceInterface(descriptor); java.util.List _result = this.getAllPackageSetIds(); reply.writeNoException(); reply.writeStringList(_result); - break; + return true; } case TRANSACTION_addToPackageSet: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); this.addToPackageSet(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_removeFromPackageSet: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); this.removeFromPackageSet(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getPackageSetThatContainsPkg: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.util.List _result = this.getPackageSetThatContainsPkg(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getPackageSetLabelsThatContainsPkg: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.util.List _result = this.getPackageSetLabelsThatContainsPkg(_arg0); reply.writeNoException(); reply.writeStringList(_result); - break; + return true; } case TRANSACTION_setFreezePkgWithSuspendEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setFreezePkgWithSuspendEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isFreezePkgWithSuspendEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isFreezePkgWithSuspendEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getInstalledPkgsByPackageSetId: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.util.List _result = this.getInstalledPkgsByPackageSetId(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_registerPackageSetChangeListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.IPackageSetChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.pm.IPackageSetChangeListener.Stub.asInterface(data.readStrongBinder()); this.registerPackageSetChangeListener(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_unRegisterPackageSetChangeListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.IPackageSetChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.pm.IPackageSetChangeListener.Stub.asInterface(data.readStrongBinder()); this.unRegisterPackageSetChangeListener(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setEnablePackageOnLaunchRequestEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setEnablePackageOnLaunchRequestEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isEnablePackageOnLaunchRequestEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isEnablePackageOnLaunchRequestEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getProviders: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; _arg1 = data.readString(); java.util.List _result = this.getProviders(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getPackagesForUid: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String[] _result = this.getPackagesForUid(_arg0); reply.writeNoException(); reply.writeStringArray(_result); - break; + return true; } case TRANSACTION_mayEnableAppOnStartActivityIntent: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); java.lang.String _result = this.mayEnableAppOnStartActivityIntent(_arg0, _arg1); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_isEnablePkgOnLaunchByDefault: { + data.enforceInterface(descriptor); boolean _result = this.isEnablePkgOnLaunchByDefault(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setEnablePkgOnLaunchByDefaultEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setEnablePkgOnLaunchByDefaultEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAppInfoForUser: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; _arg1 = data.readInt(); github.tornaco.android.thanos.core.pm.AppInfo _result = this.getAppInfoForUser(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_launchSmartFreezePkgForUser: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.launchSmartFreezePkgForUser(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_launchSmartFreezePkgThenKillOriginForUser: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.lang.String _arg1; _arg1 = data.readString(); this.launchSmartFreezePkgThenKillOriginForUser(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_setDOLTipsEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setDOLTipsEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isDOLTipsEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isDOLTipsEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_updatePackageSetLabel: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); this.updatePackageSetLabel(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_freezeAllSmartFreezePackages: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener.Stub.asInterface(data.readStrongBinder()); this.freezeAllSmartFreezePackages(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_freezeSmartFreezePackages: { + data.enforceInterface(descriptor); java.util.List _arg0; _arg0 = data.createTypedArrayList(github.tornaco.android.thanos.core.pm.Pkg.CREATOR); github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener _arg1; _arg1 = github.tornaco.android.thanos.core.pm.IPackageEnableStateChangeListener.Stub.asInterface(data.readStrongBinder()); this.freezeSmartFreezePackages(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_hasFreezedPackageInUserWhiteListPkgSet: { + data.enforceInterface(descriptor); boolean _result = this.hasFreezedPackageInUserWhiteListPkgSet(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getAllDisabledComponentsForPackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } java.util.List _result = this.getAllDisabledComponentsForPackage(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_setFreezeTipEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setFreezeTipEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isFreezeTipEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isFreezeTipEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.pm.IPkgManager { @@ -1127,6 +1329,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(uid); boolean _status = mRemote.transact(Stub.TRANSACTION_getPkgNameForUid, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPkgNameForUid(uid); + } _reply.readException(); _result = _reply.createStringArray(); } @@ -1143,8 +1348,17 @@ public java.lang.String getInterfaceDescriptor() int _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getUidForPkgName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getUidForPkgName(pkg); + } _reply.readException(); _result = _reply.readInt(); } @@ -1155,6 +1369,7 @@ public java.lang.String getInterfaceDescriptor() return _result; } // ApplicationInfo + @Override public java.util.List getInstalledPkgs(int flags) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -1164,6 +1379,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(flags); boolean _status = mRemote.transact(Stub.TRANSACTION_getInstalledPkgs, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getInstalledPkgs(flags); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.AppInfo.CREATOR); } @@ -1183,8 +1401,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_getAppInfo, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAppInfo(pkgName); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.pm.AppInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.pm.AppInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1200,6 +1426,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getWhiteListPkgs, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getWhiteListPkgs(); + } _reply.readException(); _result = _reply.createStringArray(); } @@ -1218,6 +1447,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkg); boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgInWhiteList, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgInWhiteList(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1234,10 +1466,20 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(userId); - _Parcel.writeTypedObject(_data, componentName, 0); + if ((componentName!=null)) { + _data.writeInt(1); + componentName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(newState); _data.writeInt(flags); boolean _status = mRemote.transact(Stub.TRANSACTION_setComponentEnabledSetting, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setComponentEnabledSetting(userId, componentName, newState, flags); + return; + } _reply.readException(); } finally { @@ -1253,8 +1495,17 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(userId); - _Parcel.writeTypedObject(_data, componentName, 0); + if ((componentName!=null)) { + _data.writeInt(1); + componentName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getComponentEnabledSetting, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getComponentEnabledSetting(userId, componentName); + } _reply.readException(); _result = _reply.readInt(); } @@ -1272,8 +1523,17 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(userId); - _Parcel.writeTypedObject(_data, componentName, 0); + if ((componentName!=null)) { + _data.writeInt(1); + componentName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isComponentDisabledByThanox, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isComponentDisabledByThanox(userId, componentName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1290,8 +1550,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getApplicationEnableState, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getApplicationEnableState(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1307,10 +1576,20 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); _data.writeInt(((tmp)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setApplicationEnableState, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setApplicationEnableState(pkg, enable, tmp); + return; + } _reply.readException(); } finally { @@ -1328,6 +1607,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(userId); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getActivities, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getActivities(userId, packageName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.ComponentInfo.CREATOR); } @@ -1346,6 +1628,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getActivitiesCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getActivitiesCount(packageName); + } _reply.readException(); _result = _reply.readInt(); } @@ -1367,6 +1652,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(itemCountInEachBatch); _data.writeInt(batchIndex); boolean _status = mRemote.transact(Stub.TRANSACTION_getActivitiesInBatch, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getActivitiesInBatch(userId, packageName, itemCountInEachBatch, batchIndex); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.ComponentInfo.CREATOR); } @@ -1386,6 +1674,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(userId); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getReceivers, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getReceivers(userId, packageName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.ComponentInfo.CREATOR); } @@ -1404,6 +1695,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getReceiverCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getReceiverCount(packageName); + } _reply.readException(); _result = _reply.readInt(); } @@ -1425,6 +1719,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(itemCountInEachBatch); _data.writeInt(batchIndex); boolean _status = mRemote.transact(Stub.TRANSACTION_getReceiversInBatch, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getReceiversInBatch(userId, packageName, itemCountInEachBatch, batchIndex); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.ComponentInfo.CREATOR); } @@ -1444,6 +1741,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(userId); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getServices, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getServices(userId, packageName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.ComponentInfo.CREATOR); } @@ -1462,6 +1762,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getServiceCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getServiceCount(packageName); + } _reply.readException(); _result = _reply.readInt(); } @@ -1483,6 +1786,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(itemCountInEachBatch); _data.writeInt(batchIndex); boolean _status = mRemote.transact(Stub.TRANSACTION_getServicesInBatch, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getServicesInBatch(userId, packageName, itemCountInEachBatch, batchIndex); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.ComponentInfo.CREATOR); } @@ -1500,6 +1806,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartFreezeEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartFreezeEnabled(enable); + return; + } _reply.readException(); } finally { @@ -1515,6 +1825,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartFreezeEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartFreezeEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1530,9 +1843,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkgName, 0); + if ((pkgName!=null)) { + _data.writeInt(1); + pkgName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgSmartFreezeEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgSmartFreezeEnabled(pkgName, enable); + return; + } _reply.readException(); } finally { @@ -1547,8 +1870,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkgName, 0); + if ((pkgName!=null)) { + _data.writeInt(1); + pkgName.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgSmartFreezeEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgSmartFreezeEnabled(pkgName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1566,6 +1898,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getSmartFreezePkgs, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSmartFreezePkgs(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.Pkg.CREATOR); } @@ -1584,6 +1919,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_launchSmartFreezePkg, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().launchSmartFreezePkg(pkgName); + return; + } _reply.readException(); } finally { @@ -1599,6 +1938,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartFreezeScreenOffCheckEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartFreezeScreenOffCheckEnabled(enable); + return; + } _reply.readException(); } finally { @@ -1614,6 +1957,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartFreezeScreenOffCheckEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartFreezeScreenOffCheckEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1631,6 +1977,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeLong(delay); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartFreezeScreenOffCheckDelay, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartFreezeScreenOffCheckDelay(delay); + return; + } _reply.readException(); } finally { @@ -1646,6 +1996,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getSmartFreezeScreenOffCheckDelay, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSmartFreezeScreenOffCheckDelay(); + } _reply.readException(); _result = _reply.readLong(); } @@ -1664,8 +2017,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_queryLaunchIntentForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().queryLaunchIntentForPackage(pkgName); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, android.content.Intent.CREATOR); + if ((0!=_reply.readInt())) { + _result = android.content.Intent.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1682,6 +2043,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((removeFromSmartFreezeList)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_enableAllThanoxDisabledPackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().enableAllThanoxDisabledPackages(removeFromSmartFreezeList); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.Pkg.CREATOR); } @@ -1699,6 +2063,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_deviceHasGms, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().deviceHasGms(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1716,6 +2083,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_verifyBillingState, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().verifyBillingState(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1735,6 +2105,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkgName); _data.writeString(origin); boolean _status = mRemote.transact(Stub.TRANSACTION_launchSmartFreezePkgThenKillOrigin, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().launchSmartFreezePkgThenKillOrigin(pkgName, origin); + return; + } _reply.readException(); } finally { @@ -1750,6 +2124,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isProtectedWhitelistEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isProtectedWhitelistEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1767,6 +2144,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setProtectedWhitelistEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setProtectedWhitelistEnabled(enable); + return; + } _reply.readException(); } finally { @@ -1779,10 +2160,20 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pfd, 0); + if ((pfd!=null)) { + _data.writeInt(1); + pfd.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(pluginPackageName); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_addPlugin, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addPlugin(pfd, pluginPackageName, callback); + return; + } } finally { _data.recycle(); @@ -1796,6 +2187,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pluginPackageName); boolean _status = mRemote.transact(Stub.TRANSACTION_removePlugin, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().removePlugin(pluginPackageName); + return; + } _reply.readException(); } finally { @@ -1812,6 +2207,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pluginPackageName); boolean _status = mRemote.transact(Stub.TRANSACTION_hasPlugin, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasPlugin(pluginPackageName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1829,6 +2227,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSmartFreezeHidePackageEventEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSmartFreezeHidePackageEventEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1846,6 +2247,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSmartFreezeHidePackageEventEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSmartFreezeHidePackageEventEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -1859,8 +2264,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(p); + _data.writeStrongBinder((((p!=null))?(p.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_dump, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().dump(p); + return; + } _reply.readException(); } finally { @@ -1877,6 +2286,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkgName); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPackageBlockUninstallEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPackageBlockUninstallEnabled(pkgName, enable); + return; + } _reply.readException(); } finally { @@ -1893,6 +2306,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_isPackageBlockUninstallEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPackageBlockUninstallEnabled(pkgName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1911,6 +2327,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkgName); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPackageBlockClearDataEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPackageBlockClearDataEnabled(pkgName, enable); + return; + } _reply.readException(); } finally { @@ -1927,6 +2347,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgName); boolean _status = mRemote.transact(Stub.TRANSACTION_isPackageBlockClearDataEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPackageBlockClearDataEnabled(pkgName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1945,6 +2368,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(appFlags); boolean _status = mRemote.transact(Stub.TRANSACTION_getInstalledPackagesCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getInstalledPackagesCount(appFlags); + } _reply.readException(); _result = _reply.readInt(); } @@ -1963,8 +2389,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(label); boolean _status = mRemote.transact(Stub.TRANSACTION_createPackageSet, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().createPackageSet(label); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.pm.PackageSet.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.pm.PackageSet.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1981,6 +2415,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_removePackageSet, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().removePackageSet(id); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2001,8 +2438,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(((withPackages)?(1):(0))); _data.writeInt(((shouldFilterUserWhiteList)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getPackageSetById, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPackageSetById(id, withPackages, shouldFilterUserWhiteList); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.pm.PackageSet.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.pm.PackageSet.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -2019,6 +2464,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((withPackages)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllPackageSets, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllPackageSets(withPackages); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.PackageSet.CREATOR); } @@ -2036,6 +2484,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllPackageSetIds, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllPackageSetIds(); + } _reply.readException(); _result = _reply.createStringArrayList(); } @@ -2051,9 +2502,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_addToPackageSet, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addToPackageSet(pkg, id); + return; + } _reply.readException(); } finally { @@ -2067,9 +2528,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_removeFromPackageSet, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().removeFromPackageSet(pkg, id); + return; + } _reply.readException(); } finally { @@ -2084,8 +2555,17 @@ public java.lang.String getInterfaceDescriptor() java.util.List _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getPackageSetThatContainsPkg, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPackageSetThatContainsPkg(pkg); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.PackageSet.CREATOR); } @@ -2102,8 +2582,17 @@ public java.lang.String getInterfaceDescriptor() java.util.List _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getPackageSetLabelsThatContainsPkg, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPackageSetLabelsThatContainsPkg(pkg); + } _reply.readException(); _result = _reply.createStringArrayList(); } @@ -2121,6 +2610,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setFreezePkgWithSuspendEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setFreezePkgWithSuspendEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2136,6 +2629,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isFreezePkgWithSuspendEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isFreezePkgWithSuspendEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2154,6 +2650,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkgSetId); boolean _status = mRemote.transact(Stub.TRANSACTION_getInstalledPkgsByPackageSetId, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getInstalledPkgsByPackageSetId(pkgSetId); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.AppInfo.CREATOR); } @@ -2169,8 +2668,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_registerPackageSetChangeListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().registerPackageSetChangeListener(listener); + return; + } _reply.readException(); } finally { @@ -2184,8 +2687,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterPackageSetChangeListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unRegisterPackageSetChangeListener(listener); + return; + } _reply.readException(); } finally { @@ -2199,9 +2706,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setEnablePackageOnLaunchRequestEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setEnablePackageOnLaunchRequestEnabled(pkg, enable); + return; + } _reply.readException(); } finally { @@ -2216,8 +2733,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isEnablePackageOnLaunchRequestEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isEnablePackageOnLaunchRequestEnabled(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2237,6 +2763,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(userId); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getProviders, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getProviders(userId, packageName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.pm.ComponentInfo.CREATOR); } @@ -2247,6 +2776,7 @@ public java.lang.String getInterfaceDescriptor() return _result; } // Wrap api to skip permission check + @Override public java.lang.String[] getPackagesForUid(int uid) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); @@ -2256,6 +2786,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(uid); boolean _status = mRemote.transact(Stub.TRANSACTION_getPackagesForUid, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPackagesForUid(uid); + } _reply.readException(); _result = _reply.createStringArray(); } @@ -2272,9 +2805,18 @@ public java.lang.String getInterfaceDescriptor() java.lang.String _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(userId); boolean _status = mRemote.transact(Stub.TRANSACTION_mayEnableAppOnStartActivityIntent, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().mayEnableAppOnStartActivityIntent(intent, userId); + } _reply.readException(); _result = _reply.readString(); } @@ -2292,6 +2834,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isEnablePkgOnLaunchByDefault, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isEnablePkgOnLaunchByDefault(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2309,6 +2854,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((byDefault)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setEnablePkgOnLaunchByDefaultEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setEnablePkgOnLaunchByDefaultEnabled(byDefault); + return; + } _reply.readException(); } finally { @@ -2326,8 +2875,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkgName); _data.writeInt(userId); boolean _status = mRemote.transact(Stub.TRANSACTION_getAppInfoForUser, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAppInfoForUser(pkgName, userId); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.pm.AppInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.pm.AppInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -2341,8 +2898,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_launchSmartFreezePkgForUser, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().launchSmartFreezePkgForUser(pkg); + return; + } _reply.readException(); } finally { @@ -2356,9 +2923,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, targetPkg, 0); + if ((targetPkg!=null)) { + _data.writeInt(1); + targetPkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeString(origin); boolean _status = mRemote.transact(Stub.TRANSACTION_launchSmartFreezePkgThenKillOriginForUser, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().launchSmartFreezePkgThenKillOriginForUser(targetPkg, origin); + return; + } _reply.readException(); } finally { @@ -2374,6 +2951,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setDOLTipsEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setDOLTipsEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2389,6 +2970,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isDOLTipsEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isDOLTipsEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2407,6 +2991,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(newLabel); _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_updatePackageSetLabel, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().updatePackageSetLabel(newLabel, id); + return; + } _reply.readException(); } finally { @@ -2420,8 +3008,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_freezeAllSmartFreezePackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().freezeAllSmartFreezePackages(listener); + return; + } _reply.readException(); } finally { @@ -2435,9 +3027,13 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedList(_data, packages, 0); - _data.writeStrongInterface(listener); + _data.writeTypedList(packages); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_freezeSmartFreezePackages, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().freezeSmartFreezePackages(packages, listener); + return; + } _reply.readException(); } finally { @@ -2453,6 +3049,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_hasFreezedPackageInUserWhiteListPkgSet, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().hasFreezedPackageInUserWhiteListPkgSet(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2469,8 +3068,17 @@ public java.lang.String getInterfaceDescriptor() java.util.List _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_getAllDisabledComponentsForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllDisabledComponentsForPackage(pkg); + } _reply.readException(); _result = _reply.createTypedArrayList(android.content.ComponentName.CREATOR); } @@ -2488,6 +3096,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setFreezeTipEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setFreezeTipEnabled(enable); + return; + } _reply.readException(); } finally { @@ -2503,6 +3115,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isFreezeTipEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isFreezeTipEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -2512,6 +3127,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.pm.IPkgManager sDefaultImpl; } static final int TRANSACTION_getPkgNameForUid = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_getUidForPkgName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -2594,14 +3210,29 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_getAllDisabledComponentsForPackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 78); static final int TRANSACTION_setFreezeTipEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 79); static final int TRANSACTION_isFreezeTipEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 80); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.pm.IPkgManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.pm.IPkgManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pm.IPkgManager"; public java.lang.String[] getPkgNameForUid(int uid) throws android.os.RemoteException; public int getUidForPkgName(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; // ApplicationInfo + public java.util.List getInstalledPkgs(int flags) throws android.os.RemoteException; /** @deprecated use {@link #getAppInfoForUser} instead */ - @Deprecated public github.tornaco.android.thanos.core.pm.AppInfo getAppInfo(java.lang.String pkgName) throws android.os.RemoteException; public java.lang.String[] getWhiteListPkgs() throws android.os.RemoteException; public boolean isPkgInWhiteList(java.lang.String pkg) throws android.os.RemoteException; @@ -2625,7 +3256,6 @@ public java.lang.String getInterfaceDescriptor() public boolean isPkgSmartFreezeEnabled(github.tornaco.android.thanos.core.pm.Pkg pkgName) throws android.os.RemoteException; public java.util.List getSmartFreezePkgs() throws android.os.RemoteException; /** @deprecated use {@link #launchSmartFreezePkgForUser} instead */ - @Deprecated public void launchSmartFreezePkg(java.lang.String pkgName) throws android.os.RemoteException; public void setSmartFreezeScreenOffCheckEnabled(boolean enable) throws android.os.RemoteException; public boolean isSmartFreezeScreenOffCheckEnabled() throws android.os.RemoteException; @@ -2636,7 +3266,6 @@ public java.lang.String getInterfaceDescriptor() public boolean deviceHasGms() throws android.os.RemoteException; public boolean verifyBillingState() throws android.os.RemoteException; /** @deprecated use {@link #launchSmartFreezePkgThenKillOriginForUser} instead */ - @Deprecated public void launchSmartFreezePkgThenKillOrigin(java.lang.String pkgName, java.lang.String origin) throws android.os.RemoteException; public boolean isProtectedWhitelistEnabled() throws android.os.RemoteException; public void setProtectedWhitelistEnabled(boolean enable) throws android.os.RemoteException; @@ -2669,6 +3298,7 @@ public java.lang.String getInterfaceDescriptor() public boolean isEnablePackageOnLaunchRequestEnabled(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public java.util.List getProviders(int userId, java.lang.String packageName) throws android.os.RemoteException; // Wrap api to skip permission check + public java.lang.String[] getPackagesForUid(int uid) throws android.os.RemoteException; public java.lang.String mayEnableAppOnStartActivityIntent(android.content.Intent intent, int userId) throws android.os.RemoteException; public boolean isEnablePkgOnLaunchByDefault() throws android.os.RemoteException; @@ -2685,39 +3315,4 @@ public java.lang.String getInterfaceDescriptor() public java.util.List getAllDisabledComponentsForPackage(github.tornaco.android.thanos.core.pm.Pkg pkg) throws android.os.RemoteException; public void setFreezeTipEnabled(boolean enable) throws android.os.RemoteException; public boolean isFreezeTipEnabled() throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/power/IPowerManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/power/IPowerManager.java index 17df212f6..0ea1bb0b2 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/power/IPowerManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/power/IPowerManager.java @@ -77,6 +77,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.power.IPowerManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.power.IPowerManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -104,9 +105,6 @@ public static github.tornaco.android.thanos.core.power.IPowerManager asInterface @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -114,161 +112,190 @@ public static github.tornaco.android.thanos.core.power.IPowerManager asInterface reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_reboot: { + data.enforceInterface(descriptor); this.reboot(); reply.writeNoException(); - break; + return true; } case TRANSACTION_softReboot: { + data.enforceInterface(descriptor); this.softReboot(); reply.writeNoException(); - break; + return true; } case TRANSACTION_goToSleep: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); this.goToSleep(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setPowerSaveModeEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setPowerSaveModeEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPowerSaveModeEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isPowerSaveModeEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getSeenWakeLocks: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); java.util.List _result = this.getSeenWakeLocks(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getSeenWakeLocksForPkg: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); java.util.List _result = this.getSeenWakeLocksForPkg(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getSeenWakeLocksStats: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); boolean _arg1; _arg1 = (0!=data.readInt()); java.util.List _result = this.getSeenWakeLocksStats(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_isWakeLockHeld: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.power.SeenWakeLock _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.power.SeenWakeLock.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.power.SeenWakeLock.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.isWakeLockHeld(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_dump: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.IPrinter _arg0; _arg0 = github.tornaco.android.thanos.core.IPrinter.Stub.asInterface(data.readStrongBinder()); this.dump(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_wakeUp: { + data.enforceInterface(descriptor); long _arg0; _arg0 = data.readLong(); this.wakeUp(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setBrightness: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); this.setBrightness(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getBrightness: { + data.enforceInterface(descriptor); int _result = this.getBrightness(); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_setAutoBrightnessEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setAutoBrightnessEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isAutoBrightnessEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isAutoBrightnessEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isWakeLockBlockerEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isWakeLockBlockerEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setWakeLockBlockerEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setWakeLockBlockerEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_setBlockWakeLock: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.power.SeenWakeLock _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.power.SeenWakeLock.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.power.SeenWakeLock.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setBlockWakeLock(_arg0, _arg1); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.power.IPowerManager { @@ -292,6 +319,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_reboot, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().reboot(); + return; + } _reply.readException(); } finally { @@ -306,6 +337,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_softReboot, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().softReboot(); + return; + } _reply.readException(); } finally { @@ -321,6 +356,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeLong(delay); boolean _status = mRemote.transact(Stub.TRANSACTION_goToSleep, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().goToSleep(delay); + return; + } _reply.readException(); } finally { @@ -336,6 +375,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPowerSaveModeEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPowerSaveModeEnabled(enable); + return; + } _reply.readException(); } finally { @@ -351,6 +394,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isPowerSaveModeEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPowerSaveModeEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -369,6 +415,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((includeHistory)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getSeenWakeLocks, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSeenWakeLocks(includeHistory); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.power.SeenWakeLock.CREATOR); } @@ -385,9 +434,18 @@ public java.lang.String getInterfaceDescriptor() java.util.List _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((includeHistory)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getSeenWakeLocksForPkg, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSeenWakeLocksForPkg(pkg, includeHistory); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.power.SeenWakeLock.CREATOR); } @@ -407,6 +465,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(((includeHistory)?(1):(0))); _data.writeInt(((heldOnly)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getSeenWakeLocksStats, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSeenWakeLocksStats(includeHistory, heldOnly); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.power.WakeLockStats.CREATOR); } @@ -423,8 +484,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, wakelock, 0); + if ((wakelock!=null)) { + _data.writeInt(1); + wakelock.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_isWakeLockHeld, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isWakeLockHeld(wakelock); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -440,8 +510,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(p); + _data.writeStrongBinder((((p!=null))?(p.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_dump, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().dump(p); + return; + } _reply.readException(); } finally { @@ -457,6 +531,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeLong(delay); boolean _status = mRemote.transact(Stub.TRANSACTION_wakeUp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().wakeUp(delay); + return; + } _reply.readException(); } finally { @@ -472,6 +550,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(level); boolean _status = mRemote.transact(Stub.TRANSACTION_setBrightness, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBrightness(level); + return; + } _reply.readException(); } finally { @@ -487,6 +569,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getBrightness, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getBrightness(); + } _reply.readException(); _result = _reply.readInt(); } @@ -504,6 +589,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setAutoBrightnessEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setAutoBrightnessEnabled(enable); + return; + } _reply.readException(); } finally { @@ -519,6 +608,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isAutoBrightnessEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isAutoBrightnessEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -536,6 +628,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isWakeLockBlockerEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isWakeLockBlockerEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -553,6 +648,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setWakeLockBlockerEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setWakeLockBlockerEnabled(enable); + return; + } _reply.readException(); } finally { @@ -566,9 +665,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, wl, 0); + if ((wl!=null)) { + _data.writeInt(1); + wl.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((block)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setBlockWakeLock, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setBlockWakeLock(wl, block); + return; + } _reply.readException(); } finally { @@ -576,6 +685,7 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.power.IPowerManager sDefaultImpl; } static final int TRANSACTION_reboot = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_softReboot = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -595,8 +705,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_isWakeLockBlockerEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15); static final int TRANSACTION_setWakeLockBlockerEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16); static final int TRANSACTION_setBlockWakeLock = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.power.IPowerManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.power.IPowerManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.power.IPowerManager"; public void reboot() throws android.os.RemoteException; public void softReboot() throws android.os.RemoteException; public void goToSleep(long delay) throws android.os.RemoteException; @@ -615,39 +740,4 @@ public java.lang.String getInterfaceDescriptor() public boolean isWakeLockBlockerEnabled() throws android.os.RemoteException; public void setWakeLockBlockerEnabled(boolean enable) throws android.os.RemoteException; public void setBlockWakeLock(github.tornaco.android.thanos.core.power.SeenWakeLock wl, boolean block) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pref/IPrefChangeListener.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pref/IPrefChangeListener.java index 7aeaf402c..f76a24df4 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pref/IPrefChangeListener.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pref/IPrefChangeListener.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.pref.IPrefChangeListener { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pref.IPrefChangeListener"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.pref.IPrefChangeListener asInte @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,23 +53,20 @@ public static github.tornaco.android.thanos.core.pref.IPrefChangeListener asInte reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onPrefChanged: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.onPrefChanged(_arg0); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.pref.IPrefChangeListener { @@ -96,6 +91,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(key); boolean _status = mRemote.transact(Stub.TRANSACTION_onPrefChanged, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onPrefChanged(key); + return; + } _reply.readException(); } finally { @@ -103,9 +102,25 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.pref.IPrefChangeListener sDefaultImpl; } static final int TRANSACTION_onPrefChanged = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.pref.IPrefChangeListener impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.pref.IPrefChangeListener getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pref.IPrefChangeListener"; public void onPrefChanged(java.lang.String key) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pref/IPrefManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pref/IPrefManager.java index 47f81e953..f89388d67 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pref/IPrefManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/pref/IPrefManager.java @@ -55,6 +55,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.pref.IPrefManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pref.IPrefManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -82,9 +83,6 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -92,11 +90,9 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_putInt: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; @@ -104,10 +100,11 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a boolean _result = this.putInt(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getInt: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; @@ -115,10 +112,11 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a int _result = this.getInt(_arg0, _arg1); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_putString: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; @@ -126,10 +124,11 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a boolean _result = this.putString(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getString: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; @@ -137,10 +136,11 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a java.lang.String _result = this.getString(_arg0, _arg1); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_putBoolean: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; @@ -148,10 +148,11 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a boolean _result = this.putBoolean(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getBoolean: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; @@ -159,10 +160,11 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a boolean _result = this.getBoolean(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_putLong: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); long _arg1; @@ -170,10 +172,11 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a boolean _result = this.putLong(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getLong: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); long _arg1; @@ -181,32 +184,33 @@ public static github.tornaco.android.thanos.core.pref.IPrefManager asInterface(a long _result = this.getLong(_arg0, _arg1); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_registerSettingsChangeListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pref.IPrefChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.pref.IPrefChangeListener.Stub.asInterface(data.readStrongBinder()); boolean _result = this.registerSettingsChangeListener(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_unRegisterSettingsChangeListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pref.IPrefChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.pref.IPrefChangeListener.Stub.asInterface(data.readStrongBinder()); boolean _result = this.unRegisterSettingsChangeListener(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.pref.IPrefManager { @@ -233,6 +237,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(key); _data.writeInt(value); boolean _status = mRemote.transact(Stub.TRANSACTION_putInt, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().putInt(key, value); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -252,6 +259,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(key); _data.writeInt(def); boolean _status = mRemote.transact(Stub.TRANSACTION_getInt, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getInt(key, def); + } _reply.readException(); _result = _reply.readInt(); } @@ -271,6 +281,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(key); _data.writeString(value); boolean _status = mRemote.transact(Stub.TRANSACTION_putString, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().putString(key, value); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -290,6 +303,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(key); _data.writeString(def); boolean _status = mRemote.transact(Stub.TRANSACTION_getString, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getString(key, def); + } _reply.readException(); _result = _reply.readString(); } @@ -309,6 +325,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(key); _data.writeInt(((value)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_putBoolean, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().putBoolean(key, value); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -328,6 +347,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(key); _data.writeInt(((def)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_getBoolean, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getBoolean(key, def); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -347,6 +369,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(key); _data.writeLong(value); boolean _status = mRemote.transact(Stub.TRANSACTION_putLong, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().putLong(key, value); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -366,6 +391,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(key); _data.writeLong(def); boolean _status = mRemote.transact(Stub.TRANSACTION_getLong, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getLong(key, def); + } _reply.readException(); _result = _reply.readLong(); } @@ -382,8 +410,11 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_registerSettingsChangeListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().registerSettingsChangeListener(listener); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -400,8 +431,11 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterSettingsChangeListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().unRegisterSettingsChangeListener(listener); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -411,6 +445,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.pref.IPrefManager sDefaultImpl; } static final int TRANSACTION_putInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_getInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -422,8 +457,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_getLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7); static final int TRANSACTION_registerSettingsChangeListener = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8); static final int TRANSACTION_unRegisterSettingsChangeListener = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.pref.IPrefManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.pref.IPrefManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.pref.IPrefManager"; public boolean putInt(java.lang.String key, int value) throws android.os.RemoteException; public int getInt(java.lang.String key, int def) throws android.os.RemoteException; public boolean putString(java.lang.String key, java.lang.String value) throws android.os.RemoteException; diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/ILogSink.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/ILogSink.java index ee502f6df..107549132 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/ILogSink.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/ILogSink.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.profile.ILogSink { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.ILogSink"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.profile.ILogSink asInterface(an @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,22 +53,19 @@ public static github.tornaco.android.thanos.core.profile.ILogSink asInterface(an reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_log: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.log(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.profile.ILogSink { @@ -94,14 +89,34 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(message); boolean _status = mRemote.transact(Stub.TRANSACTION_log, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().log(message); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.profile.ILogSink sDefaultImpl; } static final int TRANSACTION_log = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.profile.ILogSink impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.profile.ILogSink getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.ILogSink"; public void log(java.lang.String message) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IProfileManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IProfileManager.java index db2687a2e..b144fd0f5 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IProfileManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IProfileManager.java @@ -203,6 +203,7 @@ public static class Default implements github.tornaco.android.thanos.core.profil return null; } // Engines. + @Override public void addAlarmEngine(github.tornaco.android.thanos.core.alarm.Alarm alarm) throws android.os.RemoteException { } @@ -217,6 +218,7 @@ public static class Default implements github.tornaco.android.thanos.core.profil { } // Danmu API + @Override public void setDanmuUISettings(github.tornaco.android.thanos.core.profile.DanmuUISettings settings) throws android.os.RemoteException { } @@ -232,6 +234,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.profile.IProfileManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.IProfileManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -259,9 +262,6 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -269,26 +269,26 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_setAutoApplyForNewInstalledAppsEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setAutoApplyForNewInstalledAppsEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isAutoApplyForNewInstalledAppsEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isAutoApplyForNewInstalledAppsEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_addRule: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; @@ -301,54 +301,60 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter _arg4 = data.readInt(); this.addRule(_arg0, _arg1, _arg2, _arg3, _arg4); reply.writeNoException(); - break; + return true; } case TRANSACTION_deleteRule: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); this.deleteRule(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_enableRule: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.enableRule(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_disableRule: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.disableRule(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isRuleEnabled: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.isRuleEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isRuleExists: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.isRuleExists(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_checkRule: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.profile.IRuleCheckCallback _arg1; @@ -357,39 +363,44 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter _arg2 = data.readInt(); this.checkRule(_arg0, _arg1, _arg2); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAllRules: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.RuleInfo[] _result = this.getAllRules(); reply.writeNoException(); reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + return true; } case TRANSACTION_getEnabledRules: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.RuleInfo[] _result = this.getEnabledRules(); reply.writeNoException(); reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + return true; } case TRANSACTION_setProfileEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setProfileEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isProfileEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isProfileEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_addGlobalRuleVar: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String[] _arg1; @@ -397,10 +408,11 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter boolean _result = this.addGlobalRuleVar(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_appendGlobalRuleVar: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String[] _arg1; @@ -408,156 +420,201 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter boolean _result = this.appendGlobalRuleVar(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_removeGlobalRuleVar: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.removeGlobalRuleVar(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getAllGlobalRuleVarNames: { + data.enforceInterface(descriptor); java.lang.String[] _result = this.getAllGlobalRuleVarNames(); reply.writeNoException(); reply.writeStringArray(_result); - break; + return true; } case TRANSACTION_getGlobalRuleVarByName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String[] _result = this.getGlobalRuleVarByName(_arg0); reply.writeNoException(); reply.writeStringArray(_result); - break; + return true; } case TRANSACTION_getAllGlobalRuleVar: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.GlobalVar[] _result = this.getAllGlobalRuleVar(); reply.writeNoException(); reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + return true; } case TRANSACTION_isGlobalRuleVarByNameExists: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isGlobalRuleVarByNameExists(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setProfileEngineUiAutomationEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setProfileEngineUiAutomationEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isProfileEngineUiAutomationEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isProfileEngineUiAutomationEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setProfileEnginePushEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setProfileEnginePushEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isProfileEnginePushEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isProfileEnginePushEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setShellSuSupportInstalled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setShellSuSupportInstalled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isShellSuSupportInstalled: { + data.enforceInterface(descriptor); boolean _result = this.isShellSuSupportInstalled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_addConfigTemplate: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.ConfigTemplate _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.addConfigTemplate(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_deleteConfigTemplate: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.ConfigTemplate _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.deleteConfigTemplate(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getAllConfigTemplates: { + data.enforceInterface(descriptor); java.util.List _result = this.getAllConfigTemplates(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getConfigTemplateById: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.profile.ConfigTemplate _result = this.getConfigTemplateById(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_setAutoConfigTemplateSelection: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.setAutoConfigTemplateSelection(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAutoConfigTemplateSelectionId: { + data.enforceInterface(descriptor); java.lang.String _result = this.getAutoConfigTemplateSelectionId(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_applyConfigTemplateForPackage: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.pm.Pkg _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.pm.Pkg.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.pm.Pkg.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } github.tornaco.android.thanos.core.profile.ConfigTemplate _arg1; - _arg1 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR); + if ((0!=data.readInt())) { + _arg1 = github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR.createFromParcel(data); + } + else { + _arg1 = null; + } boolean _result = this.applyConfigTemplateForPackage(_arg0, _arg1); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_addRuleIfNotExists: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; @@ -570,10 +627,11 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter _arg4 = data.readInt(); this.addRuleIfNotExists(_arg0, _arg1, _arg2, _arg3, _arg4); reply.writeNoException(); - break; + return true; } case TRANSACTION_publishStringFact: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; @@ -584,10 +642,11 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter _arg3 = data.createStringArray(); this.publishStringFact(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - break; + return true; } case TRANSACTION_updateRule: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; @@ -598,207 +657,280 @@ public static github.tornaco.android.thanos.core.profile.IProfileManager asInter _arg3 = data.readInt(); this.updateRule(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - break; + return true; } case TRANSACTION_registerRuleChangeListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.IRuleChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.profile.IRuleChangeListener.Stub.asInterface(data.readStrongBinder()); this.registerRuleChangeListener(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_unRegisterRuleChangeListener: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.IRuleChangeListener _arg0; _arg0 = github.tornaco.android.thanos.core.profile.IRuleChangeListener.Stub.asInterface(data.readStrongBinder()); this.unRegisterRuleChangeListener(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getRuleById: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); github.tornaco.android.thanos.core.profile.RuleInfo _result = this.getRuleById(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_enableRuleByName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.enableRuleByName(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_disableRuleByName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.disableRuleByName(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_dump: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.IPrinter _arg0; _arg0 = github.tornaco.android.thanos.core.IPrinter.Stub.asInterface(data.readStrongBinder()); this.dump(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getLogFD: { + data.enforceInterface(descriptor); android.os.ParcelFileDescriptor _result = this.getLogFD(); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_getLogPath: { + data.enforceInterface(descriptor); java.lang.String _result = this.getLogPath(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_clearLogs: { + data.enforceInterface(descriptor); this.clearLogs(); reply.writeNoException(); - break; + return true; } case TRANSACTION_setLogEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setLogEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isLogEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isLogEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_executeAction: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.executeAction(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_addConsoleLogSink: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.ILogSink _arg0; _arg0 = github.tornaco.android.thanos.core.profile.ILogSink.Stub.asInterface(data.readStrongBinder()); this.addConsoleLogSink(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_removeConsoleLogSink: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.ILogSink _arg0; _arg0 = github.tornaco.android.thanos.core.profile.ILogSink.Stub.asInterface(data.readStrongBinder()); this.removeConsoleLogSink(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_parseRuleOrNull: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; _arg1 = data.readInt(); github.tornaco.android.thanos.core.profile.RuleInfo _result = this.parseRuleOrNull(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_getRuleByName: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.profile.RuleInfo _result = this.getRuleByName(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_setCustomSuCommand: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.setCustomSuCommand(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getCustomSuCommand: { + data.enforceInterface(descriptor); java.lang.String _result = this.getCustomSuCommand(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_addAlarmEngine: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.alarm.Alarm _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.alarm.Alarm.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.alarm.Alarm.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.addAlarmEngine(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_removeAlarmEngine: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.alarm.Alarm _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.alarm.Alarm.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.alarm.Alarm.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.removeAlarmEngine(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getAllAlarms: { + data.enforceInterface(descriptor); java.util.List _result = this.getAllAlarms(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_setAlarmEnabled: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.alarm.Alarm _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.alarm.Alarm.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.alarm.Alarm.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _arg1; _arg1 = (0!=data.readInt()); this.setAlarmEnabled(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_setDanmuUISettings: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.DanmuUISettings _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.profile.DanmuUISettings.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.profile.DanmuUISettings.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.setDanmuUISettings(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getDanmuUISettings: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.DanmuUISettings _result = this.getDanmuUISettings(); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.profile.IProfileManager { @@ -823,6 +955,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setAutoApplyForNewInstalledAppsEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setAutoApplyForNewInstalledAppsEnabled(enable); + return; + } _reply.readException(); } finally { @@ -838,6 +974,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isAutoApplyForNewInstalledAppsEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isAutoApplyForNewInstalledAppsEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -856,9 +995,13 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(author); _data.writeInt(versionCode); _data.writeString(ruleJson); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); _data.writeInt(format); boolean _status = mRemote.transact(Stub.TRANSACTION_addRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addRule(author, versionCode, ruleJson, callback, format); + return; + } _reply.readException(); } finally { @@ -874,6 +1017,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_deleteRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().deleteRule(ruleId); + return; + } _reply.readException(); } finally { @@ -890,6 +1037,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_enableRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().enableRule(ruleId); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -908,6 +1058,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_disableRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().disableRule(ruleId); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -926,6 +1079,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_isRuleEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isRuleEnabled(ruleId); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -944,6 +1100,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_isRuleExists, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isRuleExists(ruleId); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -960,9 +1119,13 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(ruleJson); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); _data.writeInt(format); boolean _status = mRemote.transact(Stub.TRANSACTION_checkRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().checkRule(ruleJson, callback, format); + return; + } _reply.readException(); } finally { @@ -978,6 +1141,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllRules, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllRules(); + } _reply.readException(); _result = _reply.createTypedArray(github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR); } @@ -995,6 +1161,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getEnabledRules, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getEnabledRules(); + } _reply.readException(); _result = _reply.createTypedArray(github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR); } @@ -1012,6 +1181,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setProfileEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setProfileEnabled(enable); + return; + } _reply.readException(); } finally { @@ -1027,6 +1200,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isProfileEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isProfileEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1046,6 +1222,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(varName); _data.writeStringArray(varArray); boolean _status = mRemote.transact(Stub.TRANSACTION_addGlobalRuleVar, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().addGlobalRuleVar(varName, varArray); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1065,6 +1244,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(varName); _data.writeStringArray(varArray); boolean _status = mRemote.transact(Stub.TRANSACTION_appendGlobalRuleVar, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().appendGlobalRuleVar(varName, varArray); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1083,6 +1265,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(varName); boolean _status = mRemote.transact(Stub.TRANSACTION_removeGlobalRuleVar, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().removeGlobalRuleVar(varName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1100,6 +1285,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllGlobalRuleVarNames, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllGlobalRuleVarNames(); + } _reply.readException(); _result = _reply.createStringArray(); } @@ -1118,6 +1306,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(varName); boolean _status = mRemote.transact(Stub.TRANSACTION_getGlobalRuleVarByName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getGlobalRuleVarByName(varName); + } _reply.readException(); _result = _reply.createStringArray(); } @@ -1135,6 +1326,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllGlobalRuleVar, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllGlobalRuleVar(); + } _reply.readException(); _result = _reply.createTypedArray(github.tornaco.android.thanos.core.profile.GlobalVar.CREATOR); } @@ -1153,6 +1347,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(varName); boolean _status = mRemote.transact(Stub.TRANSACTION_isGlobalRuleVarByNameExists, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isGlobalRuleVarByNameExists(varName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1170,6 +1367,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setProfileEngineUiAutomationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setProfileEngineUiAutomationEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -1185,6 +1386,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isProfileEngineUiAutomationEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isProfileEngineUiAutomationEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1202,6 +1406,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setProfileEnginePushEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setProfileEnginePushEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -1217,6 +1425,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isProfileEnginePushEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isProfileEnginePushEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1234,6 +1445,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setShellSuSupportInstalled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setShellSuSupportInstalled(enable); + return; + } _reply.readException(); } finally { @@ -1249,6 +1464,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isShellSuSupportInstalled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isShellSuSupportInstalled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1265,8 +1483,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, template, 0); + if ((template!=null)) { + _data.writeInt(1); + template.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_addConfigTemplate, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().addConfigTemplate(template); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1283,8 +1510,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, template, 0); + if ((template!=null)) { + _data.writeInt(1); + template.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_deleteConfigTemplate, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().deleteConfigTemplate(template); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1302,6 +1538,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllConfigTemplates, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllConfigTemplates(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR); } @@ -1320,8 +1559,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_getConfigTemplateById, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getConfigTemplateById(id); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.profile.ConfigTemplate.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1337,6 +1584,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_setAutoConfigTemplateSelection, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setAutoConfigTemplateSelection(id); + return; + } _reply.readException(); } finally { @@ -1352,6 +1603,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAutoConfigTemplateSelectionId, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAutoConfigTemplateSelectionId(); + } _reply.readException(); _result = _reply.readString(); } @@ -1368,9 +1622,24 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, pkg, 0); - _Parcel.writeTypedObject(_data, template, 0); + if ((pkg!=null)) { + _data.writeInt(1); + pkg.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } + if ((template!=null)) { + _data.writeInt(1); + template.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_applyConfigTemplateForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().applyConfigTemplateForPackage(pkg, template); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1389,9 +1658,13 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(author); _data.writeInt(versionCode); _data.writeString(ruleJson); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); _data.writeInt(format); boolean _status = mRemote.transact(Stub.TRANSACTION_addRuleIfNotExists, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addRuleIfNotExists(author, versionCode, ruleJson, callback, format); + return; + } _reply.readException(); } finally { @@ -1410,6 +1683,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeLong(delayMills); _data.writeStringArray(args); boolean _status = mRemote.transact(Stub.TRANSACTION_publishStringFact, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().publishStringFact(source, factValue, delayMills, args); + return; + } _reply.readException(); } finally { @@ -1425,9 +1702,13 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); _data.writeString(ruleJson); - _data.writeStrongInterface(callback); + _data.writeStrongBinder((((callback!=null))?(callback.asBinder()):(null))); _data.writeInt(format); boolean _status = mRemote.transact(Stub.TRANSACTION_updateRule, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().updateRule(ruleId, ruleJson, callback, format); + return; + } _reply.readException(); } finally { @@ -1441,8 +1722,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_registerRuleChangeListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().registerRuleChangeListener(listener); + return; + } _reply.readException(); } finally { @@ -1456,8 +1741,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(listener); + _data.writeStrongBinder((((listener!=null))?(listener.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterRuleChangeListener, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unRegisterRuleChangeListener(listener); + return; + } _reply.readException(); } finally { @@ -1474,8 +1763,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_getRuleById, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRuleById(ruleId); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1492,6 +1789,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(ruleName); boolean _status = mRemote.transact(Stub.TRANSACTION_enableRuleByName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().enableRuleByName(ruleName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1510,6 +1810,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(ruleName); boolean _status = mRemote.transact(Stub.TRANSACTION_disableRuleByName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().disableRuleByName(ruleName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1525,8 +1828,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(p); + _data.writeStrongBinder((((p!=null))?(p.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_dump, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().dump(p); + return; + } _reply.readException(); } finally { @@ -1542,8 +1849,16 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getLogFD, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getLogFD(); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, android.os.ParcelFileDescriptor.CREATOR); + if ((0!=_reply.readInt())) { + _result = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1559,6 +1874,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getLogPath, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getLogPath(); + } _reply.readException(); _result = _reply.readString(); } @@ -1575,6 +1893,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_clearLogs, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().clearLogs(); + return; + } _reply.readException(); } finally { @@ -1590,6 +1912,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setLogEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setLogEnabled(enable); + return; + } _reply.readException(); } finally { @@ -1605,6 +1931,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isLogEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isLogEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -1622,6 +1951,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(action); boolean _status = mRemote.transact(Stub.TRANSACTION_executeAction, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().executeAction(action); + return; + } _reply.readException(); } finally { @@ -1635,8 +1968,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(sink); + _data.writeStrongBinder((((sink!=null))?(sink.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_addConsoleLogSink, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addConsoleLogSink(sink); + return; + } _reply.readException(); } finally { @@ -1650,8 +1987,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(sink); + _data.writeStrongBinder((((sink!=null))?(sink.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_removeConsoleLogSink, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().removeConsoleLogSink(sink); + return; + } _reply.readException(); } finally { @@ -1669,8 +2010,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(ruleString); _data.writeInt(format); boolean _status = mRemote.transact(Stub.TRANSACTION_parseRuleOrNull, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().parseRuleOrNull(ruleString, format); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1687,8 +2036,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(ruleName); boolean _status = mRemote.transact(Stub.TRANSACTION_getRuleByName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getRuleByName(ruleName); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1704,6 +2061,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(command); boolean _status = mRemote.transact(Stub.TRANSACTION_setCustomSuCommand, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setCustomSuCommand(command); + return; + } _reply.readException(); } finally { @@ -1719,6 +2080,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getCustomSuCommand, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getCustomSuCommand(); + } _reply.readException(); _result = _reply.readString(); } @@ -1729,14 +2093,25 @@ public java.lang.String getInterfaceDescriptor() return _result; } // Engines. + @Override public void addAlarmEngine(github.tornaco.android.thanos.core.alarm.Alarm alarm) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, alarm, 0); + if ((alarm!=null)) { + _data.writeInt(1); + alarm.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_addAlarmEngine, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().addAlarmEngine(alarm); + return; + } _reply.readException(); } finally { @@ -1750,8 +2125,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, alarm, 0); + if ((alarm!=null)) { + _data.writeInt(1); + alarm.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_removeAlarmEngine, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().removeAlarmEngine(alarm); + return; + } _reply.readException(); } finally { @@ -1767,6 +2152,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllAlarms, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllAlarms(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.alarm.AlarmRecord.CREATOR); } @@ -1782,9 +2170,19 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, alarm, 0); + if ((alarm!=null)) { + _data.writeInt(1); + alarm.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setAlarmEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setAlarmEnabled(alarm, enabled); + return; + } _reply.readException(); } finally { @@ -1793,14 +2191,25 @@ public java.lang.String getInterfaceDescriptor() } } // Danmu API + @Override public void setDanmuUISettings(github.tornaco.android.thanos.core.profile.DanmuUISettings settings) throws android.os.RemoteException { android.os.Parcel _data = android.os.Parcel.obtain(); android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, settings, 0); + if ((settings!=null)) { + _data.writeInt(1); + settings.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_setDanmuUISettings, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setDanmuUISettings(settings); + return; + } _reply.readException(); } finally { @@ -1816,8 +2225,16 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getDanmuUISettings, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getDanmuUISettings(); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.profile.DanmuUISettings.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.profile.DanmuUISettings.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -1825,6 +2242,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.profile.IProfileManager sDefaultImpl; } static final int TRANSACTION_setAutoApplyForNewInstalledAppsEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_isAutoApplyForNewInstalledAppsEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -1886,8 +2304,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_setAlarmEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 57); static final int TRANSACTION_setDanmuUISettings = (android.os.IBinder.FIRST_CALL_TRANSACTION + 58); static final int TRANSACTION_getDanmuUISettings = (android.os.IBinder.FIRST_CALL_TRANSACTION + 59); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.profile.IProfileManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.profile.IProfileManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.IProfileManager"; public void setAutoApplyForNewInstalledAppsEnabled(boolean enable) throws android.os.RemoteException; public boolean isAutoApplyForNewInstalledAppsEnabled() throws android.os.RemoteException; public void addRule(java.lang.String author, int versionCode, java.lang.String ruleJson, github.tornaco.android.thanos.core.profile.IRuleAddCallback callback, int format) throws android.os.RemoteException; @@ -1943,46 +2376,13 @@ public java.lang.String getInterfaceDescriptor() public void setCustomSuCommand(java.lang.String command) throws android.os.RemoteException; public java.lang.String getCustomSuCommand() throws android.os.RemoteException; // Engines. + public void addAlarmEngine(github.tornaco.android.thanos.core.alarm.Alarm alarm) throws android.os.RemoteException; public void removeAlarmEngine(github.tornaco.android.thanos.core.alarm.Alarm alarm) throws android.os.RemoteException; public java.util.List getAllAlarms() throws android.os.RemoteException; public void setAlarmEnabled(github.tornaco.android.thanos.core.alarm.Alarm alarm, boolean enabled) throws android.os.RemoteException; // Danmu API + public void setDanmuUISettings(github.tornaco.android.thanos.core.profile.DanmuUISettings settings) throws android.os.RemoteException; public github.tornaco.android.thanos.core.profile.DanmuUISettings getDanmuUISettings() throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleAddCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleAddCallback.java index 58cf25eac..2df099a95 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleAddCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleAddCallback.java @@ -21,6 +21,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.profile.IRuleAddCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.IRuleAddCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -48,9 +49,6 @@ public static github.tornaco.android.thanos.core.profile.IRuleAddCallback asInte @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -58,29 +56,27 @@ public static github.tornaco.android.thanos.core.profile.IRuleAddCallback asInte reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onRuleAddSuccess: { + data.enforceInterface(descriptor); this.onRuleAddSuccess(); - break; + return true; } case TRANSACTION_onRuleAddFail: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; _arg1 = data.readString(); this.onRuleAddFail(_arg0, _arg1); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.profile.IRuleAddCallback { @@ -103,6 +99,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_onRuleAddSuccess, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onRuleAddSuccess(); + return; + } } finally { _data.recycle(); @@ -116,16 +116,36 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(errorCode); _data.writeString(errorMessage); boolean _status = mRemote.transact(Stub.TRANSACTION_onRuleAddFail, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onRuleAddFail(errorCode, errorMessage); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.profile.IRuleAddCallback sDefaultImpl; } static final int TRANSACTION_onRuleAddSuccess = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onRuleAddFail = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.profile.IRuleAddCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.profile.IRuleAddCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.IRuleAddCallback"; public void onRuleAddSuccess() throws android.os.RemoteException; public void onRuleAddFail(int errorCode, java.lang.String errorMessage) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleChangeListener.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleChangeListener.java index 3d6fc9e35..591807cc9 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleChangeListener.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleChangeListener.java @@ -27,6 +27,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.profile.IRuleChangeListener { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.IRuleChangeListener"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -54,9 +55,6 @@ public static github.tornaco.android.thanos.core.profile.IRuleChangeListener asI @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -64,45 +62,45 @@ public static github.tornaco.android.thanos.core.profile.IRuleChangeListener asI reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onRuleEnabledStateChanged: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _arg1; _arg1 = (0!=data.readInt()); this.onRuleEnabledStateChanged(_arg0, _arg1); - break; + return true; } case TRANSACTION_onRuleUpdated: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); this.onRuleUpdated(_arg0); - break; + return true; } case TRANSACTION_onRuleRemoved: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); this.onRuleRemoved(_arg0); - break; + return true; } case TRANSACTION_onRuleAdd: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); this.onRuleAdd(_arg0); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.profile.IRuleChangeListener { @@ -127,6 +125,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(ruleId); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_onRuleEnabledStateChanged, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onRuleEnabledStateChanged(ruleId, enabled); + return; + } } finally { _data.recycle(); @@ -139,6 +141,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_onRuleUpdated, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onRuleUpdated(ruleId); + return; + } } finally { _data.recycle(); @@ -151,6 +157,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_onRuleRemoved, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onRuleRemoved(ruleId); + return; + } } finally { _data.recycle(); @@ -163,18 +173,38 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(ruleId); boolean _status = mRemote.transact(Stub.TRANSACTION_onRuleAdd, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onRuleAdd(ruleId); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.profile.IRuleChangeListener sDefaultImpl; } static final int TRANSACTION_onRuleEnabledStateChanged = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onRuleUpdated = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_onRuleRemoved = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_onRuleAdd = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.profile.IRuleChangeListener impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.profile.IRuleChangeListener getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.IRuleChangeListener"; public void onRuleEnabledStateChanged(int ruleId, boolean enabled) throws android.os.RemoteException; public void onRuleUpdated(int ruleId) throws android.os.RemoteException; public void onRuleRemoved(int ruleId) throws android.os.RemoteException; diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleCheckCallback.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleCheckCallback.java index 686d872ee..25c0fad88 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleCheckCallback.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/profile/IRuleCheckCallback.java @@ -21,6 +21,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.profile.IRuleCheckCallback { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.IRuleCheckCallback"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -48,9 +49,6 @@ public static github.tornaco.android.thanos.core.profile.IRuleCheckCallback asIn @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -58,31 +56,34 @@ public static github.tornaco.android.thanos.core.profile.IRuleCheckCallback asIn reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onValid: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.profile.RuleInfo _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.profile.RuleInfo.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onValid(_arg0); - break; + return true; } case TRANSACTION_onInvalid: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _arg1; _arg1 = data.readString(); this.onInvalid(_arg0, _arg1); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.profile.IRuleCheckCallback { @@ -104,8 +105,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _data = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, rule, 0); + if ((rule!=null)) { + _data.writeInt(1); + rule.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onValid, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onValid(rule); + return; + } } finally { _data.recycle(); @@ -119,37 +130,36 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(errorCode); _data.writeString(errorMessage); boolean _status = mRemote.transact(Stub.TRANSACTION_onInvalid, _data, null, android.os.IBinder.FLAG_ONEWAY); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onInvalid(errorCode, errorMessage); + return; + } } finally { _data.recycle(); } } + public static github.tornaco.android.thanos.core.profile.IRuleCheckCallback sDefaultImpl; } static final int TRANSACTION_onValid = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_onInvalid = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.profile.IRuleCheckCallback"; - public void onValid(github.tornaco.android.thanos.core.profile.RuleInfo rule) throws android.os.RemoteException; - public void onInvalid(int errorCode, java.lang.String errorMessage) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.profile.IRuleCheckCallback impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.profile.IRuleCheckCallback getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public void onValid(github.tornaco.android.thanos.core.profile.RuleInfo rule) throws android.os.RemoteException; + public void onInvalid(int errorCode, java.lang.String errorMessage) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/IChannelHandler.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/IChannelHandler.java index 3e2b52b8c..4cdf71877 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/IChannelHandler.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/IChannelHandler.java @@ -18,6 +18,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.push.IChannelHandler { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.push.IChannelHandler"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -45,9 +46,6 @@ public static github.tornaco.android.thanos.core.push.IChannelHandler asInterfac @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -55,23 +53,25 @@ public static github.tornaco.android.thanos.core.push.IChannelHandler asInterfac reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_onMessageArrive: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.onMessageArrive(_arg0); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.push.IChannelHandler { @@ -94,8 +94,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_onMessageArrive, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onMessageArrive(intent); + return; + } _reply.readException(); } finally { @@ -103,30 +113,25 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.push.IChannelHandler sDefaultImpl; } static final int TRANSACTION_onMessageArrive = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.push.IChannelHandler"; - public void onMessageArrive(android.content.Intent intent) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.push.IChannelHandler impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.push.IChannelHandler getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public void onMessageArrive(android.content.Intent intent) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/IPushManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/IPushManager.java index 47a2c0767..8696ac46c 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/IPushManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/IPushManager.java @@ -27,6 +27,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.push.IPushManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.push.IPushManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -54,9 +55,6 @@ public static github.tornaco.android.thanos.core.push.IPushManager asInterface(a @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -64,49 +62,59 @@ public static github.tornaco.android.thanos.core.push.IPushManager asInterface(a reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_registerChannel: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.push.PushChannel _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.push.PushChannel.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.push.PushChannel.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.registerChannel(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_unRegisterChannel: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.push.PushChannel _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.push.PushChannel.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.push.PushChannel.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } this.unRegisterChannel(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_registerChannelHandler: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.push.IChannelHandler _arg1; _arg1 = github.tornaco.android.thanos.core.push.IChannelHandler.Stub.asInterface(data.readStrongBinder()); this.registerChannelHandler(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_unRegisterChannelHandler: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.push.IChannelHandler _arg0; _arg0 = github.tornaco.android.thanos.core.push.IChannelHandler.Stub.asInterface(data.readStrongBinder()); this.unRegisterChannelHandler(_arg0); reply.writeNoException(); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.push.IPushManager { @@ -129,8 +137,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, channel, 0); + if ((channel!=null)) { + _data.writeInt(1); + channel.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_registerChannel, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().registerChannel(channel); + return; + } _reply.readException(); } finally { @@ -144,8 +162,18 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, channel, 0); + if ((channel!=null)) { + _data.writeInt(1); + channel.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterChannel, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unRegisterChannel(channel); + return; + } _reply.readException(); } finally { @@ -160,8 +188,12 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(channelId); - _data.writeStrongInterface(handler); + _data.writeStrongBinder((((handler!=null))?(handler.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_registerChannelHandler, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().registerChannelHandler(channelId, handler); + return; + } _reply.readException(); } finally { @@ -175,8 +207,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(handler); + _data.writeStrongBinder((((handler!=null))?(handler.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_unRegisterChannelHandler, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().unRegisterChannelHandler(handler); + return; + } _reply.readException(); } finally { @@ -184,36 +220,31 @@ public java.lang.String getInterfaceDescriptor() _data.recycle(); } } + public static github.tornaco.android.thanos.core.push.IPushManager sDefaultImpl; } static final int TRANSACTION_registerChannel = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_unRegisterChannel = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_registerChannelHandler = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_unRegisterChannelHandler = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.push.IPushManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.push.IPushManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.push.IPushManager"; public void registerChannel(github.tornaco.android.thanos.core.push.PushChannel channel) throws android.os.RemoteException; public void unRegisterChannel(github.tornaco.android.thanos.core.push.PushChannel channel) throws android.os.RemoteException; public void registerChannelHandler(java.lang.String channelId, github.tornaco.android.thanos.core.push.IChannelHandler handler) throws android.os.RemoteException; public void unRegisterChannelHandler(github.tornaco.android.thanos.core.push.IChannelHandler handler) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/wechat/IPushDelegateManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/wechat/IPushDelegateManager.java index 55a93bfc2..34c99ac3e 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/wechat/IPushDelegateManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/push/wechat/IPushDelegateManager.java @@ -68,6 +68,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -95,9 +96,6 @@ public static github.tornaco.android.thanos.core.push.wechat.IPushDelegateManage @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -105,129 +103,145 @@ public static github.tornaco.android.thanos.core.push.wechat.IPushDelegateManage reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_wechatEnabled: { + data.enforceInterface(descriptor); boolean _result = this.wechatEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setWeChatEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setWeChatEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_wechatSoundEnabled: { + data.enforceInterface(descriptor); boolean _result = this.wechatSoundEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setWechatSoundEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setWechatSoundEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_wechatContentEnabled: { + data.enforceInterface(descriptor); boolean _result = this.wechatContentEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setWechatContentEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setWechatContentEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_wechatVibrateEnabled: { + data.enforceInterface(descriptor); boolean _result = this.wechatVibrateEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setWechatVibrateEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setWechatVibrateEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_mockWechatMessage: { + data.enforceInterface(descriptor); this.mockWechatMessage(); reply.writeNoException(); - break; + return true; } case TRANSACTION_startWechatOnPushEnabled: { + data.enforceInterface(descriptor); boolean _result = this.startWechatOnPushEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setStartWechatOnPushEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setStartWechatOnPushEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_skipIfWeChatAppRunningEnabled: { + data.enforceInterface(descriptor); boolean _result = this.skipIfWeChatAppRunningEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setSkipIfWeChatAppRunningEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSkipIfWeChatAppRunningEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_shouldHookBroadcastPerformResult: { + data.enforceInterface(descriptor); boolean _result = this.shouldHookBroadcastPerformResult(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_onHookBroadcastPerformResult: { + data.enforceInterface(descriptor); android.content.Intent _arg0; - _arg0 = _Parcel.readTypedObject(data, android.content.Intent.CREATOR); + if ((0!=data.readInt())) { + _arg0 = android.content.Intent.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } int _arg1; _arg1 = data.readInt(); int _result = this.onHookBroadcastPerformResult(_arg0, _arg1); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager { @@ -252,6 +266,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_wechatEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().wechatEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -269,6 +286,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setWeChatEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setWeChatEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -284,6 +305,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_wechatSoundEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().wechatSoundEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -301,6 +325,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setWechatSoundEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setWechatSoundEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -316,6 +344,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_wechatContentEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().wechatContentEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -333,6 +364,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setWechatContentEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setWechatContentEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -348,6 +383,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_wechatVibrateEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().wechatVibrateEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -365,6 +403,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setWechatVibrateEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setWechatVibrateEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -379,6 +421,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_mockWechatMessage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().mockWechatMessage(); + return; + } _reply.readException(); } finally { @@ -394,6 +440,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_startWechatOnPushEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().startWechatOnPushEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -411,6 +460,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setStartWechatOnPushEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setStartWechatOnPushEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -426,6 +479,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_skipIfWeChatAppRunningEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().skipIfWeChatAppRunningEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -443,6 +499,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSkipIfWeChatAppRunningEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSkipIfWeChatAppRunningEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -458,6 +518,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_shouldHookBroadcastPerformResult, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().shouldHookBroadcastPerformResult(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -474,9 +537,18 @@ public java.lang.String getInterfaceDescriptor() int _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, intent, 0); + if ((intent!=null)) { + _data.writeInt(1); + intent.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } _data.writeInt(resultCode); boolean _status = mRemote.transact(Stub.TRANSACTION_onHookBroadcastPerformResult, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().onHookBroadcastPerformResult(intent, resultCode); + } _reply.readException(); _result = _reply.readInt(); } @@ -486,6 +558,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager sDefaultImpl; } static final int TRANSACTION_wechatEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_setWeChatEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -502,8 +575,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_setSkipIfWeChatAppRunningEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12); static final int TRANSACTION_shouldHookBroadcastPerformResult = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13); static final int TRANSACTION_onHookBroadcastPerformResult = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.push.wechat.IPushDelegateManager"; public boolean wechatEnabled() throws android.os.RemoteException; public void setWeChatEnabled(boolean enabled) throws android.os.RemoteException; public boolean wechatSoundEnabled() throws android.os.RemoteException; @@ -519,25 +607,4 @@ public java.lang.String getInterfaceDescriptor() public void setSkipIfWeChatAppRunningEnabled(boolean enabled) throws android.os.RemoteException; public boolean shouldHookBroadcastPerformResult() throws android.os.RemoteException; public int onHookBroadcastPerformResult(android.content.Intent intent, int resultCode) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/secure/IPrivacyManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/secure/IPrivacyManager.java index dfbcafed2..bbb591888 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/secure/IPrivacyManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/secure/IPrivacyManager.java @@ -140,6 +140,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.secure.IPrivacyManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.secure.IPrivacyManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -167,9 +168,6 @@ public static github.tornaco.android.thanos.core.secure.IPrivacyManager asInterf @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -177,276 +175,326 @@ public static github.tornaco.android.thanos.core.secure.IPrivacyManager asInterf reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_isPrivacyEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isPrivacyEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setPrivacyEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setPrivacyEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getPrivacyDataCheatPkgCount: { + data.enforceInterface(descriptor); int _result = this.getPrivacyDataCheatPkgCount(); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_getPrivacyDataCheatRequestCount: { + data.enforceInterface(descriptor); long _result = this.getPrivacyDataCheatRequestCount(); reply.writeNoException(); reply.writeLong(_result); - break; + return true; } case TRANSACTION_getOriginalDeviceId: { + data.enforceInterface(descriptor); java.lang.String _result = this.getOriginalDeviceId(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalLine1Number: { + data.enforceInterface(descriptor); java.lang.String _result = this.getOriginalLine1Number(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalSimSerialNumber: { + data.enforceInterface(descriptor); java.lang.String _result = this.getOriginalSimSerialNumber(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalAndroidId: { + data.enforceInterface(descriptor); java.lang.String _result = this.getOriginalAndroidId(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalImei: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.getOriginalImei(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalMeid: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.getOriginalMeid(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getPhoneCount: { + data.enforceInterface(descriptor); int _result = this.getPhoneCount(); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_getAccessibleSubscriptionInfoList: { + data.enforceInterface(descriptor); android.telephony.SubscriptionInfo[] _result = this.getAccessibleSubscriptionInfoList(); reply.writeNoException(); reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + return true; } case TRANSACTION_getPrivacyCheatRecords: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.secure.PrivacyCheatRecord[] _result = this.getPrivacyCheatRecords(); reply.writeNoException(); reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + return true; } case TRANSACTION_clearPrivacyCheatRecords: { + data.enforceInterface(descriptor); this.clearPrivacyCheatRecords(); reply.writeNoException(); - break; + return true; } case TRANSACTION_addOrUpdateFieldsProfile: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.secure.field.Fields _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.secure.field.Fields.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.secure.field.Fields.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.addOrUpdateFieldsProfile(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_deleteFieldsProfile: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.secure.field.Fields _arg0; - _arg0 = _Parcel.readTypedObject(data, github.tornaco.android.thanos.core.secure.field.Fields.CREATOR); + if ((0!=data.readInt())) { + _arg0 = github.tornaco.android.thanos.core.secure.field.Fields.CREATOR.createFromParcel(data); + } + else { + _arg0 = null; + } boolean _result = this.deleteFieldsProfile(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_deleteFieldsProfileById: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.deleteFieldsProfileById(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getAllFieldsProfiles: { + data.enforceInterface(descriptor); java.util.List _result = this.getAllFieldsProfiles(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_selectFieldsProfileForPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; _arg1 = data.readString(); this.selectFieldsProfileForPackage(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_getSelectedFieldsProfileIdForPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _result = this.getSelectedFieldsProfileIdForPackage(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getSelectedFieldsProfileForPackage: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _arg1; _arg1 = data.readInt(); github.tornaco.android.thanos.core.secure.field.Fields _result = this.getSelectedFieldsProfileForPackage(_arg0, _arg1); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_getFieldsProfileById: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); github.tornaco.android.thanos.core.secure.field.Fields _result = this.getFieldsProfileById(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } case TRANSACTION_isUidFieldsProfileSelected: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.isUidFieldsProfileSelected(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_isPackageFieldsProfileSelected: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isPackageFieldsProfileSelected(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_getUsageForFieldsProfile: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); int _result = this.getUsageForFieldsProfile(_arg0); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_getUsagePackagesForFieldsProfile: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.util.List _result = this.getUsagePackagesForFieldsProfile(_arg0); reply.writeNoException(); reply.writeStringList(_result); - break; + return true; } case TRANSACTION_getOriginalSimCountryIso: { + data.enforceInterface(descriptor); java.lang.String _result = this.getOriginalSimCountryIso(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalSimOp: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.getOriginalSimOp(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalSimOpName: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.getOriginalSimOpName(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalNetworkCountryIso: { + data.enforceInterface(descriptor); java.lang.String _result = this.getOriginalNetworkCountryIso(); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalNetworkOp: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.getOriginalNetworkOp(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } case TRANSACTION_getOriginalNetworkOpName: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); java.lang.String _result = this.getOriginalNetworkOpName(_arg0); reply.writeNoException(); reply.writeString(_result); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.secure.IPrivacyManager { @@ -471,6 +519,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isPrivacyEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPrivacyEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -488,6 +539,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPrivacyEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPrivacyEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -503,6 +558,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPrivacyDataCheatPkgCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPrivacyDataCheatPkgCount(); + } _reply.readException(); _result = _reply.readInt(); } @@ -520,6 +578,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPrivacyDataCheatRequestCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPrivacyDataCheatRequestCount(); + } _reply.readException(); _result = _reply.readLong(); } @@ -537,6 +598,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalDeviceId, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalDeviceId(); + } _reply.readException(); _result = _reply.readString(); } @@ -554,6 +618,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalLine1Number, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalLine1Number(); + } _reply.readException(); _result = _reply.readString(); } @@ -571,6 +638,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalSimSerialNumber, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalSimSerialNumber(); + } _reply.readException(); _result = _reply.readString(); } @@ -588,6 +658,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalAndroidId, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalAndroidId(); + } _reply.readException(); _result = _reply.readString(); } @@ -606,6 +679,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(slotIndex); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalImei, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalImei(slotIndex); + } _reply.readException(); _result = _reply.readString(); } @@ -624,6 +700,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(slotIndex); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalMeid, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalMeid(slotIndex); + } _reply.readException(); _result = _reply.readString(); } @@ -641,6 +720,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPhoneCount, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPhoneCount(); + } _reply.readException(); _result = _reply.readInt(); } @@ -658,6 +740,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAccessibleSubscriptionInfoList, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAccessibleSubscriptionInfoList(); + } _reply.readException(); _result = _reply.createTypedArray(android.telephony.SubscriptionInfo.CREATOR); } @@ -675,6 +760,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getPrivacyCheatRecords, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getPrivacyCheatRecords(); + } _reply.readException(); _result = _reply.createTypedArray(github.tornaco.android.thanos.core.secure.PrivacyCheatRecord.CREATOR); } @@ -691,6 +779,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_clearPrivacyCheatRecords, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().clearPrivacyCheatRecords(); + return; + } _reply.readException(); } finally { @@ -705,8 +797,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, f, 0); + if ((f!=null)) { + _data.writeInt(1); + f.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_addOrUpdateFieldsProfile, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().addOrUpdateFieldsProfile(f); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -723,8 +824,17 @@ public java.lang.String getInterfaceDescriptor() boolean _result; try { _data.writeInterfaceToken(DESCRIPTOR); - _Parcel.writeTypedObject(_data, f, 0); + if ((f!=null)) { + _data.writeInt(1); + f.writeToParcel(_data, 0); + } + else { + _data.writeInt(0); + } boolean _status = mRemote.transact(Stub.TRANSACTION_deleteFieldsProfile, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().deleteFieldsProfile(f); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -743,6 +853,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_deleteFieldsProfileById, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().deleteFieldsProfileById(id); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -760,6 +873,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getAllFieldsProfiles, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getAllFieldsProfiles(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.secure.field.Fields.CREATOR); } @@ -778,6 +894,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkg); _data.writeString(profileId); boolean _status = mRemote.transact(Stub.TRANSACTION_selectFieldsProfileForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().selectFieldsProfileForPackage(pkg, profileId); + return; + } _reply.readException(); } finally { @@ -794,6 +914,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkg); boolean _status = mRemote.transact(Stub.TRANSACTION_getSelectedFieldsProfileIdForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSelectedFieldsProfileIdForPackage(pkg); + } _reply.readException(); _result = _reply.readString(); } @@ -813,8 +936,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkg); _data.writeInt(checkingOp); boolean _status = mRemote.transact(Stub.TRANSACTION_getSelectedFieldsProfileForPackage, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSelectedFieldsProfileForPackage(pkg, checkingOp); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.secure.field.Fields.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.secure.field.Fields.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -831,8 +962,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_getFieldsProfileById, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getFieldsProfileById(id); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.secure.field.Fields.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.secure.field.Fields.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -849,6 +988,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(uid); boolean _status = mRemote.transact(Stub.TRANSACTION_isUidFieldsProfileSelected, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isUidFieldsProfileSelected(uid); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -867,6 +1009,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkg); boolean _status = mRemote.transact(Stub.TRANSACTION_isPackageFieldsProfileSelected, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPackageFieldsProfileSelected(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -885,6 +1030,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_getUsageForFieldsProfile, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getUsageForFieldsProfile(id); + } _reply.readException(); _result = _reply.readInt(); } @@ -903,6 +1051,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(id); boolean _status = mRemote.transact(Stub.TRANSACTION_getUsagePackagesForFieldsProfile, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getUsagePackagesForFieldsProfile(id); + } _reply.readException(); _result = _reply.createStringArrayList(); } @@ -920,6 +1071,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalSimCountryIso, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalSimCountryIso(); + } _reply.readException(); _result = _reply.readString(); } @@ -938,6 +1092,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(subId); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalSimOp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalSimOp(subId); + } _reply.readException(); _result = _reply.readString(); } @@ -956,6 +1113,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(subId); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalSimOpName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalSimOpName(subId); + } _reply.readException(); _result = _reply.readString(); } @@ -973,6 +1133,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalNetworkCountryIso, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalNetworkCountryIso(); + } _reply.readException(); _result = _reply.readString(); } @@ -991,6 +1154,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(subId); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalNetworkOp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalNetworkOp(subId); + } _reply.readException(); _result = _reply.readString(); } @@ -1009,6 +1175,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(subId); boolean _status = mRemote.transact(Stub.TRANSACTION_getOriginalNetworkOpName, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getOriginalNetworkOpName(subId); + } _reply.readException(); _result = _reply.readString(); } @@ -1018,6 +1187,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.secure.IPrivacyManager sDefaultImpl; } static final int TRANSACTION_isPrivacyEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_setPrivacyEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -1051,8 +1221,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_getOriginalNetworkCountryIso = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29); static final int TRANSACTION_getOriginalNetworkOp = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30); static final int TRANSACTION_getOriginalNetworkOpName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.secure.IPrivacyManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.secure.IPrivacyManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.secure.IPrivacyManager"; public boolean isPrivacyEnabled() throws android.os.RemoteException; public void setPrivacyEnabled(boolean enabled) throws android.os.RemoteException; public int getPrivacyDataCheatPkgCount() throws android.os.RemoteException; @@ -1085,39 +1270,4 @@ public java.lang.String getInterfaceDescriptor() public java.lang.String getOriginalNetworkCountryIso() throws android.os.RemoteException; public java.lang.String getOriginalNetworkOp(int subId) throws android.os.RemoteException; public java.lang.String getOriginalNetworkOpName(int subId) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/secure/ops/IAppOpsService.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/secure/ops/IAppOpsService.java index 4bea74f6f..e287af1bf 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/secure/ops/IAppOpsService.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/secure/ops/IAppOpsService.java @@ -86,6 +86,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.secure.ops.IAppOpsService { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.secure.ops.IAppOpsService"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -113,9 +114,6 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -123,11 +121,9 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_setMode: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _arg1; @@ -138,18 +134,20 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt _arg3 = data.readInt(); this.setMode(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - break; + return true; } case TRANSACTION_resetAllModes: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.resetAllModes(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_checkOperation: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _arg1; @@ -159,25 +157,28 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt int _result = this.checkOperation(_arg0, _arg1, _arg2); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_isOpsEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isOpsEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setOpsEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setOpsEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_onStartOp: { + data.enforceInterface(descriptor); android.os.IBinder _arg0; _arg0 = data.readStrongBinder(); int _arg1; @@ -188,10 +189,11 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt _arg3 = data.readString(); this.onStartOp(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - break; + return true; } case TRANSACTION_onFinishOp: { + data.enforceInterface(descriptor); android.os.IBinder _arg0; _arg0 = data.readStrongBinder(); int _arg1; @@ -202,48 +204,53 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt _arg3 = data.readString(); this.onFinishOp(_arg0, _arg1, _arg2, _arg3); reply.writeNoException(); - break; + return true; } case TRANSACTION_setOpRemindEnable: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setOpRemindEnable(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isOpRemindEnabled: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); boolean _result = this.isOpRemindEnabled(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_setPkgOpRemindEnable: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setPkgOpRemindEnable(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isPkgOpRemindEnable: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isPkgOpRemindEnable(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_checkOperationNonCheck: { + data.enforceInterface(descriptor); int _arg0; _arg0 = data.readInt(); int _arg1; @@ -253,18 +260,20 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt int _result = this.checkOperationNonCheck(_arg0, _arg1, _arg2); reply.writeNoException(); reply.writeInt(_result); - break; + return true; } case TRANSACTION_dump: { + data.enforceInterface(descriptor); github.tornaco.android.thanos.core.IPrinter _arg0; _arg0 = github.tornaco.android.thanos.core.IPrinter.Stub.asInterface(data.readStrongBinder()); this.dump(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_onSettingsGetString: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; @@ -273,10 +282,11 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt _arg2 = data.readString(); this.onSettingsGetString(_arg0, _arg1, _arg2); reply.writeNoException(); - break; + return true; } case TRANSACTION_onSettingsPutString: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.lang.String _arg1; @@ -285,59 +295,64 @@ public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService asInt _arg2 = data.readString(); this.onSettingsPutString(_arg0, _arg1, _arg2); reply.writeNoException(); - break; + return true; } case TRANSACTION_getSettingsReadRecords: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.util.List _result = this.getSettingsReadRecords(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_getSettingsWriteRecords: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); java.util.List _result = this.getSettingsWriteRecords(_arg0); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } case TRANSACTION_clearSettingsReadRecords: { + data.enforceInterface(descriptor); this.clearSettingsReadRecords(); reply.writeNoException(); - break; + return true; } case TRANSACTION_clearSettingsWriteRecords: { + data.enforceInterface(descriptor); this.clearSettingsWriteRecords(); reply.writeNoException(); - break; + return true; } case TRANSACTION_setSettingsRecordEnabled: { + data.enforceInterface(descriptor); boolean _arg0; _arg0 = (0!=data.readInt()); this.setSettingsRecordEnabled(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_isSettingsRecordEnabled: { + data.enforceInterface(descriptor); boolean _result = this.isSettingsRecordEnabled(); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.secure.ops.IAppOpsService { @@ -365,6 +380,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(packageName); _data.writeInt(mode); boolean _status = mRemote.transact(Stub.TRANSACTION_setMode, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setMode(code, uid, packageName, mode); + return; + } _reply.readException(); } finally { @@ -380,6 +399,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(reqPackageName); boolean _status = mRemote.transact(Stub.TRANSACTION_resetAllModes, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().resetAllModes(reqPackageName); + return; + } _reply.readException(); } finally { @@ -398,6 +421,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(uid); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_checkOperation, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkOperation(code, uid, packageName); + } _reply.readException(); _result = _reply.readInt(); } @@ -415,6 +441,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isOpsEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isOpsEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -432,6 +461,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enabled)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setOpsEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setOpsEnabled(enabled); + return; + } _reply.readException(); } finally { @@ -450,6 +483,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(uid); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_onStartOp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onStartOp(token, code, uid, packageName); + return; + } _reply.readException(); } finally { @@ -468,6 +505,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(uid); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_onFinishOp, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onFinishOp(token, code, uid, packageName); + return; + } _reply.readException(); } finally { @@ -484,6 +525,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(code); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setOpRemindEnable, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setOpRemindEnable(code, enable); + return; + } _reply.readException(); } finally { @@ -500,6 +545,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(code); boolean _status = mRemote.transact(Stub.TRANSACTION_isOpRemindEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isOpRemindEnabled(code); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -518,6 +566,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(pkg); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setPkgOpRemindEnable, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setPkgOpRemindEnable(pkg, enable); + return; + } _reply.readException(); } finally { @@ -534,6 +586,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(pkg); boolean _status = mRemote.transact(Stub.TRANSACTION_isPkgOpRemindEnable, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isPkgOpRemindEnable(pkg); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -554,6 +609,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInt(uid); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_checkOperationNonCheck, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().checkOperationNonCheck(code, uid, packageName); + } _reply.readException(); _result = _reply.readInt(); } @@ -569,8 +627,12 @@ public java.lang.String getInterfaceDescriptor() android.os.Parcel _reply = android.os.Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); - _data.writeStrongInterface(p); + _data.writeStrongBinder((((p!=null))?(p.asBinder()):(null))); boolean _status = mRemote.transact(Stub.TRANSACTION_dump, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().dump(p); + return; + } _reply.readException(); } finally { @@ -588,6 +650,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(value); _data.writeString(callerPackageName); boolean _status = mRemote.transact(Stub.TRANSACTION_onSettingsGetString, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onSettingsGetString(name, value, callerPackageName); + return; + } _reply.readException(); } finally { @@ -605,6 +671,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(value); _data.writeString(callerPackageName); boolean _status = mRemote.transact(Stub.TRANSACTION_onSettingsPutString, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().onSettingsPutString(name, value, callerPackageName); + return; + } _reply.readException(); } finally { @@ -621,6 +691,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(filterCallerPackageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getSettingsReadRecords, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSettingsReadRecords(filterCallerPackageName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.secure.ops.SettingsAccessRecord.CREATOR); } @@ -639,6 +712,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(filterCallerPackageName); boolean _status = mRemote.transact(Stub.TRANSACTION_getSettingsWriteRecords, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getSettingsWriteRecords(filterCallerPackageName); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.secure.ops.SettingsAccessRecord.CREATOR); } @@ -655,6 +731,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_clearSettingsReadRecords, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().clearSettingsReadRecords(); + return; + } _reply.readException(); } finally { @@ -669,6 +749,10 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_clearSettingsWriteRecords, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().clearSettingsWriteRecords(); + return; + } _reply.readException(); } finally { @@ -684,6 +768,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeInt(((enable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setSettingsRecordEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setSettingsRecordEnabled(enable); + return; + } _reply.readException(); } finally { @@ -699,6 +787,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_isSettingsRecordEnabled, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isSettingsRecordEnabled(); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -708,6 +799,7 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService sDefaultImpl; } static final int TRANSACTION_setMode = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_resetAllModes = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); @@ -730,8 +822,23 @@ public java.lang.String getInterfaceDescriptor() static final int TRANSACTION_clearSettingsWriteRecords = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18); static final int TRANSACTION_setSettingsRecordEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19); static final int TRANSACTION_isSettingsRecordEnabled = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.secure.ops.IAppOpsService impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.secure.ops.IAppOpsService getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.secure.ops.IAppOpsService"; public void setMode(int code, int uid, java.lang.String packageName, int mode) throws android.os.RemoteException; public void resetAllModes(java.lang.String reqPackageName) throws android.os.RemoteException; public int checkOperation(int code, int uid, java.lang.String packageName) throws android.os.RemoteException; @@ -753,39 +860,4 @@ public java.lang.String getInterfaceDescriptor() public void clearSettingsWriteRecords() throws android.os.RemoteException; public void setSettingsRecordEnabled(boolean enable) throws android.os.RemoteException; public boolean isSettingsRecordEnabled() throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/su/ISu.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/su/ISu.java index 43de3aa96..dc946bd87 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/su/ISu.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/su/ISu.java @@ -19,6 +19,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.su.ISu { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.su.ISu"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -46,9 +47,6 @@ public static github.tornaco.android.thanos.core.su.ISu asInterface(android.os.I @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -56,24 +54,27 @@ public static github.tornaco.android.thanos.core.su.ISu asInterface(android.os.I reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_exe: { + data.enforceInterface(descriptor); java.lang.String[] _arg0; _arg0 = data.createStringArray(); github.tornaco.android.thanos.core.su.SuRes _result = this.exe(_arg0); reply.writeNoException(); - _Parcel.writeTypedObject(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + if ((_result!=null)) { + reply.writeInt(1); + _result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); + } + else { + reply.writeInt(0); + } + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.su.ISu { @@ -99,8 +100,16 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeStringArray(command); boolean _status = mRemote.transact(Stub.TRANSACTION_exe, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().exe(command); + } _reply.readException(); - _result = _Parcel.readTypedObject(_reply, github.tornaco.android.thanos.core.su.SuRes.CREATOR); + if ((0!=_reply.readInt())) { + _result = github.tornaco.android.thanos.core.su.SuRes.CREATOR.createFromParcel(_reply); + } + else { + _result = null; + } } finally { _reply.recycle(); @@ -108,30 +117,25 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.su.ISu sDefaultImpl; } static final int TRANSACTION_exe = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); - } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.su.ISu"; - public github.tornaco.android.thanos.core.su.SuRes exe(java.lang.String[] command) throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.su.ISu impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; } + return false; + } + public static github.tornaco.android.thanos.core.su.ISu getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; } } + public github.tornaco.android.thanos.core.su.SuRes exe(java.lang.String[] command) throws android.os.RemoteException; } diff --git a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/wm/IWindowManager.java b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/wm/IWindowManager.java index 1ed75f4b4..e8516b420 100644 --- a/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/wm/IWindowManager.java +++ b/android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/wm/IWindowManager.java @@ -33,6 +33,7 @@ public android.os.IBinder asBinder() { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements github.tornaco.android.thanos.core.wm.IWindowManager { + private static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.wm.IWindowManager"; /** Construct the stub at attach it to the interface. */ public Stub() { @@ -60,9 +61,6 @@ public static github.tornaco.android.thanos.core.wm.IWindowManager asInterface(a @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { java.lang.String descriptor = DESCRIPTOR; - if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) { - data.enforceInterface(descriptor); - } switch (code) { case INTERFACE_TRANSACTION: @@ -70,56 +68,57 @@ public static github.tornaco.android.thanos.core.wm.IWindowManager asInterface(a reply.writeString(descriptor); return true; } - } - switch (code) - { case TRANSACTION_getScreenSize: { + data.enforceInterface(descriptor); int[] _result = this.getScreenSize(); reply.writeNoException(); reply.writeIntArray(_result); - break; + return true; } case TRANSACTION_setDialogForceCancelable: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _arg1; _arg1 = (0!=data.readInt()); this.setDialogForceCancelable(_arg0, _arg1); reply.writeNoException(); - break; + return true; } case TRANSACTION_isDialogForceCancelable: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); boolean _result = this.isDialogForceCancelable(_arg0); reply.writeNoException(); reply.writeInt(((_result)?(1):(0))); - break; + return true; } case TRANSACTION_reportDialogHasBeenForceSetCancelable: { + data.enforceInterface(descriptor); java.lang.String _arg0; _arg0 = data.readString(); this.reportDialogHasBeenForceSetCancelable(_arg0); reply.writeNoException(); - break; + return true; } case TRANSACTION_getVisibleWindows: { + data.enforceInterface(descriptor); java.util.List _result = this.getVisibleWindows(); reply.writeNoException(); - _Parcel.writeTypedList(reply, _result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE); - break; + reply.writeTypedList(_result); + return true; } default: { return super.onTransact(code, data, reply, flags); } } - return true; } private static class Proxy implements github.tornaco.android.thanos.core.wm.IWindowManager { @@ -144,6 +143,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getScreenSize, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getScreenSize(); + } _reply.readException(); _result = _reply.createIntArray(); } @@ -162,6 +164,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeString(packageName); _data.writeInt(((forceCancelable)?(1):(0))); boolean _status = mRemote.transact(Stub.TRANSACTION_setDialogForceCancelable, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().setDialogForceCancelable(packageName, forceCancelable); + return; + } _reply.readException(); } finally { @@ -178,6 +184,9 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_isDialogForceCancelable, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().isDialogForceCancelable(packageName); + } _reply.readException(); _result = (0!=_reply.readInt()); } @@ -195,6 +204,10 @@ public java.lang.String getInterfaceDescriptor() _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(packageName); boolean _status = mRemote.transact(Stub.TRANSACTION_reportDialogHasBeenForceSetCancelable, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + getDefaultImpl().reportDialogHasBeenForceSetCancelable(packageName); + return; + } _reply.readException(); } finally { @@ -210,6 +223,9 @@ public java.lang.String getInterfaceDescriptor() try { _data.writeInterfaceToken(DESCRIPTOR); boolean _status = mRemote.transact(Stub.TRANSACTION_getVisibleWindows, _data, _reply, 0); + if (!_status && getDefaultImpl() != null) { + return getDefaultImpl().getVisibleWindows(); + } _reply.readException(); _result = _reply.createTypedArrayList(github.tornaco.android.thanos.core.wm.WindowState.CREATOR); } @@ -219,52 +235,33 @@ public java.lang.String getInterfaceDescriptor() } return _result; } + public static github.tornaco.android.thanos.core.wm.IWindowManager sDefaultImpl; } static final int TRANSACTION_getScreenSize = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_setDialogForceCancelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_isDialogForceCancelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_reportDialogHasBeenForceSetCancelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); static final int TRANSACTION_getVisibleWindows = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); + public static boolean setDefaultImpl(github.tornaco.android.thanos.core.wm.IWindowManager impl) { + // Only one user of this interface can use this function + // at a time. This is a heuristic to detect if two different + // users in the same process use this function. + if (Stub.Proxy.sDefaultImpl != null) { + throw new IllegalStateException("setDefaultImpl() called twice"); + } + if (impl != null) { + Stub.Proxy.sDefaultImpl = impl; + return true; + } + return false; + } + public static github.tornaco.android.thanos.core.wm.IWindowManager getDefaultImpl() { + return Stub.Proxy.sDefaultImpl; + } } - public static final java.lang.String DESCRIPTOR = "github.tornaco.android.thanos.core.wm.IWindowManager"; public int[] getScreenSize() throws android.os.RemoteException; public void setDialogForceCancelable(java.lang.String packageName, boolean forceCancelable) throws android.os.RemoteException; public boolean isDialogForceCancelable(java.lang.String packageName) throws android.os.RemoteException; public void reportDialogHasBeenForceSetCancelable(java.lang.String packageName) throws android.os.RemoteException; public java.util.List getVisibleWindows() throws android.os.RemoteException; - /** @hide */ - static class _Parcel { - static private T readTypedObject( - android.os.Parcel parcel, - android.os.Parcelable.Creator c) { - if (parcel.readInt() != 0) { - return c.createFromParcel(parcel); - } else { - return null; - } - } - static private void writeTypedObject( - android.os.Parcel parcel, T value, int parcelableFlags) { - if (value != null) { - parcel.writeInt(1); - value.writeToParcel(parcel, parcelableFlags); - } else { - parcel.writeInt(0); - } - } - static private void writeTypedList( - android.os.Parcel parcel, java.util.List value, int parcelableFlags) { - if (value == null) { - parcel.writeInt(-1); - } else { - int N = value.size(); - int i = 0; - parcel.writeInt(N); - while (i < N) { - writeTypedObject(parcel, value.get(i), parcelableFlags); - i++; - } - } - } - } }