Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9838,6 +9838,7 @@ package android.content { } public abstract interface ServiceConnection { method public default void onBindingDead(android.content.ComponentName); method public abstract void onServiceConnected(android.content.ComponentName, android.os.IBinder); method public abstract void onServiceDisconnected(android.content.ComponentName); } api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -10371,6 +10371,7 @@ package android.content { } public abstract interface ServiceConnection { method public default void onBindingDead(android.content.ComponentName); method public abstract void onServiceConnected(android.content.ComponentName, android.os.IBinder); method public abstract void onServiceDisconnected(android.content.ComponentName); } api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9871,6 +9871,7 @@ package android.content { } public abstract interface ServiceConnection { method public default void onBindingDead(android.content.ComponentName); method public abstract void onServiceConnected(android.content.ComponentName, android.os.IBinder); method public abstract void onServiceDisconnected(android.content.ComponentName); } core/java/android/app/IServiceConnection.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,6 @@ import android.content.ComponentName; /** @hide */ oneway interface IServiceConnection { void connected(in ComponentName name, IBinder service); void connected(in ComponentName name, IBinder service, boolean dead); } core/java/android/app/LoadedApk.java +22 −14 Original line number Diff line number Diff line Loading @@ -88,8 +88,8 @@ final class ServiceConnectionLeaked extends AndroidRuntimeException { * @hide */ public final class LoadedApk { private static final String TAG = "LoadedApk"; static final String TAG = "LoadedApk"; static final boolean DEBUG = false; private final ActivityThread mActivityThread; final String mPackageName; Loading Loading @@ -641,8 +641,7 @@ public final class LoadedApk { final String zip = (zipPaths.size() == 1) ? zipPaths.get(0) : TextUtils.join(File.pathSeparator, zipPaths); if (ActivityThread.localLOGV) Slog.v(ActivityThread.TAG, "Class path: " + zip + if (DEBUG) Slog.v(ActivityThread.TAG, "Class path: " + zip + ", JNI path: " + librarySearchPath); boolean needToSetupJitProfiles = false; Loading Loading @@ -1371,12 +1370,14 @@ public final class LoadedApk { LoadedApk.ServiceDispatcher sd = null; ArrayMap<ServiceConnection, LoadedApk.ServiceDispatcher> map = mServices.get(context); if (map != null) { if (DEBUG) Slog.d(TAG, "Returning existing dispatcher " + sd + " for conn " + c); sd = map.get(c); } if (sd == null) { sd = new ServiceDispatcher(c, context, handler, flags); if (DEBUG) Slog.d(TAG, "Creating new dispatcher " + sd + " for conn " + c); if (map == null) { map = new ArrayMap<ServiceConnection, LoadedApk.ServiceDispatcher>(); map = new ArrayMap<>(); mServices.put(context, map); } map.put(c, sd); Loading @@ -1396,6 +1397,7 @@ public final class LoadedApk { if (map != null) { sd = map.get(c); if (sd != null) { if (DEBUG) Slog.d(TAG, "Removing dispatcher " + sd + " for conn " + c); map.remove(c); sd.doForget(); if (map.size() == 0) { Loading Loading @@ -1461,10 +1463,11 @@ public final class LoadedApk { mDispatcher = new WeakReference<LoadedApk.ServiceDispatcher>(sd); } public void connected(ComponentName name, IBinder service) throws RemoteException { public void connected(ComponentName name, IBinder service, boolean dead) throws RemoteException { LoadedApk.ServiceDispatcher sd = mDispatcher.get(); if (sd != null) { sd.connected(name, service); sd.connected(name, service, dead); } } } Loading Loading @@ -1533,23 +1536,23 @@ public final class LoadedApk { return mUnbindLocation; } public void connected(ComponentName name, IBinder service) { public void connected(ComponentName name, IBinder service, boolean dead) { if (mActivityThread != null) { mActivityThread.post(new RunConnection(name, service, 0)); mActivityThread.post(new RunConnection(name, service, 0, dead)); } else { doConnected(name, service); doConnected(name, service, dead); } } public void death(ComponentName name, IBinder service) { if (mActivityThread != null) { mActivityThread.post(new RunConnection(name, service, 1)); mActivityThread.post(new RunConnection(name, service, 1, false)); } else { doDeath(name, service); } } public void doConnected(ComponentName name, IBinder service) { public void doConnected(ComponentName name, IBinder service, boolean dead) { ServiceDispatcher.ConnectionInfo old; ServiceDispatcher.ConnectionInfo info; Loading Loading @@ -1594,6 +1597,9 @@ public final class LoadedApk { if (old != null) { mConnection.onServiceDisconnected(name); } if (dead) { mConnection.onBindingDead(name); } // If there is a new service, it is now connected. if (service != null) { mConnection.onServiceConnected(name, service); Loading @@ -1616,15 +1622,16 @@ public final class LoadedApk { } private final class RunConnection implements Runnable { RunConnection(ComponentName name, IBinder service, int command) { RunConnection(ComponentName name, IBinder service, int command, boolean dead) { mName = name; mService = service; mCommand = command; mDead = dead; } public void run() { if (mCommand == 0) { doConnected(mName, mService); doConnected(mName, mService, mDead); } else if (mCommand == 1) { doDeath(mName, mService); } Loading @@ -1633,6 +1640,7 @@ public final class LoadedApk { final ComponentName mName; final IBinder mService; final int mCommand; final boolean mDead; } private final class DeathMonitor implements IBinder.DeathRecipient Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9838,6 +9838,7 @@ package android.content { } public abstract interface ServiceConnection { method public default void onBindingDead(android.content.ComponentName); method public abstract void onServiceConnected(android.content.ComponentName, android.os.IBinder); method public abstract void onServiceDisconnected(android.content.ComponentName); }
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -10371,6 +10371,7 @@ package android.content { } public abstract interface ServiceConnection { method public default void onBindingDead(android.content.ComponentName); method public abstract void onServiceConnected(android.content.ComponentName, android.os.IBinder); method public abstract void onServiceDisconnected(android.content.ComponentName); }
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9871,6 +9871,7 @@ package android.content { } public abstract interface ServiceConnection { method public default void onBindingDead(android.content.ComponentName); method public abstract void onServiceConnected(android.content.ComponentName, android.os.IBinder); method public abstract void onServiceDisconnected(android.content.ComponentName); }
core/java/android/app/IServiceConnection.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,6 @@ import android.content.ComponentName; /** @hide */ oneway interface IServiceConnection { void connected(in ComponentName name, IBinder service); void connected(in ComponentName name, IBinder service, boolean dead); }
core/java/android/app/LoadedApk.java +22 −14 Original line number Diff line number Diff line Loading @@ -88,8 +88,8 @@ final class ServiceConnectionLeaked extends AndroidRuntimeException { * @hide */ public final class LoadedApk { private static final String TAG = "LoadedApk"; static final String TAG = "LoadedApk"; static final boolean DEBUG = false; private final ActivityThread mActivityThread; final String mPackageName; Loading Loading @@ -641,8 +641,7 @@ public final class LoadedApk { final String zip = (zipPaths.size() == 1) ? zipPaths.get(0) : TextUtils.join(File.pathSeparator, zipPaths); if (ActivityThread.localLOGV) Slog.v(ActivityThread.TAG, "Class path: " + zip + if (DEBUG) Slog.v(ActivityThread.TAG, "Class path: " + zip + ", JNI path: " + librarySearchPath); boolean needToSetupJitProfiles = false; Loading Loading @@ -1371,12 +1370,14 @@ public final class LoadedApk { LoadedApk.ServiceDispatcher sd = null; ArrayMap<ServiceConnection, LoadedApk.ServiceDispatcher> map = mServices.get(context); if (map != null) { if (DEBUG) Slog.d(TAG, "Returning existing dispatcher " + sd + " for conn " + c); sd = map.get(c); } if (sd == null) { sd = new ServiceDispatcher(c, context, handler, flags); if (DEBUG) Slog.d(TAG, "Creating new dispatcher " + sd + " for conn " + c); if (map == null) { map = new ArrayMap<ServiceConnection, LoadedApk.ServiceDispatcher>(); map = new ArrayMap<>(); mServices.put(context, map); } map.put(c, sd); Loading @@ -1396,6 +1397,7 @@ public final class LoadedApk { if (map != null) { sd = map.get(c); if (sd != null) { if (DEBUG) Slog.d(TAG, "Removing dispatcher " + sd + " for conn " + c); map.remove(c); sd.doForget(); if (map.size() == 0) { Loading Loading @@ -1461,10 +1463,11 @@ public final class LoadedApk { mDispatcher = new WeakReference<LoadedApk.ServiceDispatcher>(sd); } public void connected(ComponentName name, IBinder service) throws RemoteException { public void connected(ComponentName name, IBinder service, boolean dead) throws RemoteException { LoadedApk.ServiceDispatcher sd = mDispatcher.get(); if (sd != null) { sd.connected(name, service); sd.connected(name, service, dead); } } } Loading Loading @@ -1533,23 +1536,23 @@ public final class LoadedApk { return mUnbindLocation; } public void connected(ComponentName name, IBinder service) { public void connected(ComponentName name, IBinder service, boolean dead) { if (mActivityThread != null) { mActivityThread.post(new RunConnection(name, service, 0)); mActivityThread.post(new RunConnection(name, service, 0, dead)); } else { doConnected(name, service); doConnected(name, service, dead); } } public void death(ComponentName name, IBinder service) { if (mActivityThread != null) { mActivityThread.post(new RunConnection(name, service, 1)); mActivityThread.post(new RunConnection(name, service, 1, false)); } else { doDeath(name, service); } } public void doConnected(ComponentName name, IBinder service) { public void doConnected(ComponentName name, IBinder service, boolean dead) { ServiceDispatcher.ConnectionInfo old; ServiceDispatcher.ConnectionInfo info; Loading Loading @@ -1594,6 +1597,9 @@ public final class LoadedApk { if (old != null) { mConnection.onServiceDisconnected(name); } if (dead) { mConnection.onBindingDead(name); } // If there is a new service, it is now connected. if (service != null) { mConnection.onServiceConnected(name, service); Loading @@ -1616,15 +1622,16 @@ public final class LoadedApk { } private final class RunConnection implements Runnable { RunConnection(ComponentName name, IBinder service, int command) { RunConnection(ComponentName name, IBinder service, int command, boolean dead) { mName = name; mService = service; mCommand = command; mDead = dead; } public void run() { if (mCommand == 0) { doConnected(mName, mService); doConnected(mName, mService, mDead); } else if (mCommand == 1) { doDeath(mName, mService); } Loading @@ -1633,6 +1640,7 @@ public final class LoadedApk { final ComponentName mName; final IBinder mService; final int mCommand; final boolean mDead; } private final class DeathMonitor implements IBinder.DeathRecipient Loading