Loading services/java/com/android/server/am/ActivityManagerService.java +24 −13 Original line number Original line Diff line number Diff line Loading @@ -153,7 +153,6 @@ import java.util.Iterator; import java.util.List; import java.util.List; import java.util.Locale; import java.util.Locale; import java.util.Map; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong; Loading Loading @@ -3571,15 +3570,32 @@ public final class ActivityManagerService extends ActivityManagerNative public void closeSystemDialogs(String reason) { public void closeSystemDialogs(String reason) { enforceNotIsolatedCaller("closeSystemDialogs"); enforceNotIsolatedCaller("closeSystemDialogs"); final int pid = Binder.getCallingPid(); final int uid = Binder.getCallingUid(); final int uid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { synchronized (this) { closeSystemDialogsLocked(uid, reason); // Only allow this from foreground processes, so that background // applications can't abuse it to prevent system UI from being shown. if (uid >= Process.FIRST_APPLICATION_UID) { ProcessRecord proc; synchronized (mPidsSelfLocked) { proc = mPidsSelfLocked.get(pid); } if (proc.curRawAdj > ProcessList.PERCEPTIBLE_APP_ADJ) { Slog.w(TAG, "Ignoring closeSystemDialogs " + reason + " from background process " + proc); return; } } closeSystemDialogsLocked(reason); } } } finally { Binder.restoreCallingIdentity(origId); Binder.restoreCallingIdentity(origId); } } } void closeSystemDialogsLocked(int callingUid, String reason) { void closeSystemDialogsLocked(String reason) { Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); if (reason != null) { if (reason != null) { Loading @@ -3595,14 +3611,9 @@ public final class ActivityManagerService extends ActivityManagerNative } } } } final long origId = Binder.clearCallingIdentity(); try { broadcastIntentLocked(null, null, intent, null, broadcastIntentLocked(null, null, intent, null, null, 0, null, null, null, false, false, -1, null, 0, null, null, null, false, false, -1, callingUid, UserHandle.USER_ALL); Process.SYSTEM_UID, UserHandle.USER_ALL); } finally { Binder.restoreCallingIdentity(origId); } } } public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) Loading Loading
services/java/com/android/server/am/ActivityManagerService.java +24 −13 Original line number Original line Diff line number Diff line Loading @@ -153,7 +153,6 @@ import java.util.Iterator; import java.util.List; import java.util.List; import java.util.Locale; import java.util.Locale; import java.util.Map; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong; Loading Loading @@ -3571,15 +3570,32 @@ public final class ActivityManagerService extends ActivityManagerNative public void closeSystemDialogs(String reason) { public void closeSystemDialogs(String reason) { enforceNotIsolatedCaller("closeSystemDialogs"); enforceNotIsolatedCaller("closeSystemDialogs"); final int pid = Binder.getCallingPid(); final int uid = Binder.getCallingUid(); final int uid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { synchronized (this) { closeSystemDialogsLocked(uid, reason); // Only allow this from foreground processes, so that background // applications can't abuse it to prevent system UI from being shown. if (uid >= Process.FIRST_APPLICATION_UID) { ProcessRecord proc; synchronized (mPidsSelfLocked) { proc = mPidsSelfLocked.get(pid); } if (proc.curRawAdj > ProcessList.PERCEPTIBLE_APP_ADJ) { Slog.w(TAG, "Ignoring closeSystemDialogs " + reason + " from background process " + proc); return; } } closeSystemDialogsLocked(reason); } } } finally { Binder.restoreCallingIdentity(origId); Binder.restoreCallingIdentity(origId); } } } void closeSystemDialogsLocked(int callingUid, String reason) { void closeSystemDialogsLocked(String reason) { Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); if (reason != null) { if (reason != null) { Loading @@ -3595,14 +3611,9 @@ public final class ActivityManagerService extends ActivityManagerNative } } } } final long origId = Binder.clearCallingIdentity(); try { broadcastIntentLocked(null, null, intent, null, broadcastIntentLocked(null, null, intent, null, null, 0, null, null, null, false, false, -1, null, 0, null, null, null, false, false, -1, callingUid, UserHandle.USER_ALL); Process.SYSTEM_UID, UserHandle.USER_ALL); } finally { Binder.restoreCallingIdentity(origId); } } } public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) Loading