diff options
| author | Dianne Hackborn <hackbod@google.com> | 2012-05-08 18:53:51 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2012-05-09 14:53:20 -0700 |
| commit | a53de0629f3b94472c0f160f5bbe1090b020feab (patch) | |
| tree | d3816b90689fee8b1aee48cdc834ce0f597e99d3 /core/java/android/os/ServiceManagerNative.java | |
| parent | 8b2e37e5a0e10d234ffe6815e9a462283cad3d78 (diff) | |
Add callback hack to find out when to load system properties.
Use this to reload the trace and layout bounds properties.
This is ONLY for debugging.
Change-Id: I1c4bdb52c823520c352c5bac45fa9ee31160793c
Diffstat (limited to 'core/java/android/os/ServiceManagerNative.java')
| -rw-r--r-- | core/java/android/os/ServiceManagerNative.java | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/core/java/android/os/ServiceManagerNative.java b/core/java/android/os/ServiceManagerNative.java index 43b5128e6a3d..be244264875e 100644 --- a/core/java/android/os/ServiceManagerNative.java +++ b/core/java/android/os/ServiceManagerNative.java @@ -16,6 +16,8 @@ package android.os; +import java.util.ArrayList; + /** * Native implementation of the service manager. Most clients will only @@ -151,14 +153,32 @@ class ServiceManagerProxy implements IServiceManager { } public String[] listServices() throws RemoteException { - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); - data.writeInterfaceToken(IServiceManager.descriptor); - mRemote.transact(LIST_SERVICES_TRANSACTION, data, reply, 0); - String[] list = reply.readStringArray(); - reply.recycle(); - data.recycle(); - return list; + ArrayList<String> services = new ArrayList<String>(); + int n = 0; + while (true) { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); + data.writeInterfaceToken(IServiceManager.descriptor); + data.writeInt(n); + n++; + try { + boolean res = mRemote.transact(LIST_SERVICES_TRANSACTION, data, reply, 0); + if (!res) { + break; + } + } catch (RuntimeException e) { + // The result code that is returned by the C++ code can + // cause the call to throw an exception back instead of + // returning a nice result... so eat it here and go on. + break; + } + services.add(reply.readString()); + reply.recycle(); + data.recycle(); + } + String[] array = new String[services.size()]; + services.toArray(array); + return array; } public void setPermissionController(IPermissionController controller) |
