diff options
author | 2019-06-21 14:51:53 -0700 | |
---|---|---|
committer | 2019-06-21 18:28:55 -0700 | |
commit | 3feab1b4744111f97f86b8b98a6d17f9796622c7 (patch) | |
tree | e277088aeda008d298255e2c4f4539c0a7a19194 | |
parent | 4507201da528441dba84891e3a166907ef8fce47 (diff) |
ServiceManagerNative: delete unused methods
This class is never instantiated (and should be deleted in the future),
doesn't need to inherit from anything, and only has one method that is
used (to get an instance of BpServiceManager defined here). Deleting
unused code, and we can delete the class once apps stop linking against
it.
Bug: 135768100
Test: TH
Change-Id: Ie19e099551b10599a4b7bab29b35d78d66cd3442
-rw-r--r-- | core/java/android/os/ServiceManagerNative.java | 75 |
1 files changed, 7 insertions, 68 deletions
diff --git a/core/java/android/os/ServiceManagerNative.java b/core/java/android/os/ServiceManagerNative.java index b7c026c7f87c..6fd3adb284a0 100644 --- a/core/java/android/os/ServiceManagerNative.java +++ b/core/java/android/os/ServiceManagerNative.java @@ -17,16 +17,18 @@ package android.os; import android.annotation.UnsupportedAppUsage; -import java.util.ArrayList; +import java.util.ArrayList; /** * Native implementation of the service manager. Most clients will only - * care about getDefault() and possibly asInterface(). + * care about asInterface(). + * * @hide */ -public abstract class ServiceManagerNative extends Binder implements IServiceManager -{ +public final class ServiceManagerNative { + private ServiceManagerNative() {} + /** * Cast a Binder object into a service manager interface, generating * a proxy if needed. @@ -38,76 +40,13 @@ public abstract class ServiceManagerNative extends Binder implements IServiceMan return null; } IServiceManager in = - (IServiceManager)obj.queryLocalInterface(descriptor); + (IServiceManager) obj.queryLocalInterface(IServiceManager.descriptor); if (in != null) { return in; } return new ServiceManagerProxy(obj); } - - public ServiceManagerNative() - { - attachInterface(this, descriptor); - } - - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) - { - try { - switch (code) { - case IServiceManager.GET_SERVICE_TRANSACTION: { - data.enforceInterface(IServiceManager.descriptor); - String name = data.readString(); - IBinder service = getService(name); - reply.writeStrongBinder(service); - return true; - } - - case IServiceManager.CHECK_SERVICE_TRANSACTION: { - data.enforceInterface(IServiceManager.descriptor); - String name = data.readString(); - IBinder service = checkService(name); - reply.writeStrongBinder(service); - return true; - } - - case IServiceManager.ADD_SERVICE_TRANSACTION: { - data.enforceInterface(IServiceManager.descriptor); - String name = data.readString(); - IBinder service = data.readStrongBinder(); - boolean allowIsolated = data.readInt() != 0; - int dumpPriority = data.readInt(); - addService(name, service, allowIsolated, dumpPriority); - return true; - } - - case IServiceManager.LIST_SERVICES_TRANSACTION: { - data.enforceInterface(IServiceManager.descriptor); - int dumpPriority = data.readInt(); - String[] list = listServices(dumpPriority); - reply.writeStringArray(list); - return true; - } - - case IServiceManager.SET_PERMISSION_CONTROLLER_TRANSACTION: { - data.enforceInterface(IServiceManager.descriptor); - IPermissionController controller = - IPermissionController.Stub.asInterface( - data.readStrongBinder()); - setPermissionController(controller); - return true; - } - } - } catch (RemoteException e) { - } - - return false; - } - - public IBinder asBinder() - { - return this; - } } class ServiceManagerProxy implements IServiceManager { |