Loading services/core/java/com/android/server/am/ActivityManagerService.java +17 −15 Original line number Diff line number Diff line Loading @@ -730,7 +730,7 @@ public class ActivityManagerService extends IActivityManager.Stub /** Whether some specified important processes are allowed to use FIFO priority. */ boolean mAllowSpecifiedFifoScheduling = true; @GuardedBy("this") @GuardedBy("mStrictModeCallbacks") private final SparseArray<IUnsafeIntentStrictModeCallback> mStrictModeCallbacks = new SparseArray<>(); Loading Loading @@ -9535,13 +9535,14 @@ public class ActivityManagerService extends IActivityManager.Stub * @param callback The binder used to communicate the violations. */ @Override public synchronized void registerStrictModeCallback(IBinder callback) { int callingPid = Binder.getCallingPid(); public void registerStrictModeCallback(IBinder callback) { final int callingPid = Binder.getCallingPid(); synchronized (mStrictModeCallbacks) { mStrictModeCallbacks.put(callingPid, IUnsafeIntentStrictModeCallback.Stub.asInterface(callback)); try { callback.linkToDeath(() -> { synchronized (ActivityManagerService.this) { synchronized (mStrictModeCallbacks) { mStrictModeCallbacks.remove(callingPid); } }, 0); Loading @@ -9549,6 +9550,7 @@ public class ActivityManagerService extends IActivityManager.Stub mStrictModeCallbacks.remove(callingPid); } } } // Depending on the policy in effect, there could be a bunch of // these in quick succession so we try to batch these together to Loading Loading @@ -19907,7 +19909,7 @@ public class ActivityManagerService extends IActivityManager.Stub public void triggerUnsafeIntentStrictMode(int callingPid, int type, Intent intent) { final IUnsafeIntentStrictModeCallback callback; final Intent i = intent.cloneFilter(); synchronized (ActivityManagerService.this) { synchronized (mStrictModeCallbacks) { callback = mStrictModeCallbacks.get(callingPid); } if (callback != null) { Loading @@ -19915,7 +19917,7 @@ public class ActivityManagerService extends IActivityManager.Stub try { callback.onUnsafeIntent(type, i); } catch (RemoteException e) { synchronized (ActivityManagerService.this) { synchronized (mStrictModeCallbacks) { mStrictModeCallbacks.remove(callingPid); } } Loading
services/core/java/com/android/server/am/ActivityManagerService.java +17 −15 Original line number Diff line number Diff line Loading @@ -730,7 +730,7 @@ public class ActivityManagerService extends IActivityManager.Stub /** Whether some specified important processes are allowed to use FIFO priority. */ boolean mAllowSpecifiedFifoScheduling = true; @GuardedBy("this") @GuardedBy("mStrictModeCallbacks") private final SparseArray<IUnsafeIntentStrictModeCallback> mStrictModeCallbacks = new SparseArray<>(); Loading Loading @@ -9535,13 +9535,14 @@ public class ActivityManagerService extends IActivityManager.Stub * @param callback The binder used to communicate the violations. */ @Override public synchronized void registerStrictModeCallback(IBinder callback) { int callingPid = Binder.getCallingPid(); public void registerStrictModeCallback(IBinder callback) { final int callingPid = Binder.getCallingPid(); synchronized (mStrictModeCallbacks) { mStrictModeCallbacks.put(callingPid, IUnsafeIntentStrictModeCallback.Stub.asInterface(callback)); try { callback.linkToDeath(() -> { synchronized (ActivityManagerService.this) { synchronized (mStrictModeCallbacks) { mStrictModeCallbacks.remove(callingPid); } }, 0); Loading @@ -9549,6 +9550,7 @@ public class ActivityManagerService extends IActivityManager.Stub mStrictModeCallbacks.remove(callingPid); } } } // Depending on the policy in effect, there could be a bunch of // these in quick succession so we try to batch these together to Loading Loading @@ -19907,7 +19909,7 @@ public class ActivityManagerService extends IActivityManager.Stub public void triggerUnsafeIntentStrictMode(int callingPid, int type, Intent intent) { final IUnsafeIntentStrictModeCallback callback; final Intent i = intent.cloneFilter(); synchronized (ActivityManagerService.this) { synchronized (mStrictModeCallbacks) { callback = mStrictModeCallbacks.get(callingPid); } if (callback != null) { Loading @@ -19915,7 +19917,7 @@ public class ActivityManagerService extends IActivityManager.Stub try { callback.onUnsafeIntent(type, i); } catch (RemoteException e) { synchronized (ActivityManagerService.this) { synchronized (mStrictModeCallbacks) { mStrictModeCallbacks.remove(callingPid); } }