Loading core/java/android/app/ActivityManagerInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,9 @@ public abstract class ActivityManagerInternal { /** Kill the processes in the list due to their tasks been removed. */ public abstract void killProcessesForRemovedTask(ArrayList<Object> procsToKill); /** Kill the process immediately. */ public abstract void killProcess(String processName, int uid, String reason); /** * Returns {@code true} if {@code uid} is running an activity from {@code packageName}. */ Loading core/java/android/app/IActivityTaskManager.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -473,4 +473,14 @@ interface IActivityTaskManager { * contain one task. */ void setDisplayToSingleTaskInstance(int displayId); /** * Restarts the activity by killing its process if it is visible. If the activity is not * visible, the activity will not be restarted immediately and just keep the activity record in * the stack. It also resets the current override configuration so the activity will use the * configuration according to the latest state. * * @param activityToken The token of the target activity to restart. */ void restartActivityProcessIfVisible(in IBinder activityToken); } core/java/android/app/ITaskStackListener.aidl +12 −0 Original line number Diff line number Diff line Loading @@ -149,4 +149,16 @@ oneway interface ITaskStackListener { * Called when a task snapshot got updated. */ void onTaskSnapshotChanged(int taskId, in ActivityManager.TaskSnapshot snapshot); /** * Called when the resumed activity is in size compatibility mode and its override configuration * is different from the current one of system. * * @param displayId Id of the display where the activity resides. * @param activityToken Token of the size compatibility mode activity. It will be null when * switching to a activity that is not in size compatibility mode or the * configuration of the activity. * @see com.android.server.wm.AppWindowToken#inSizeCompatMode */ void onSizeCompatModeActivityChanged(int displayId, in IBinder activityToken); } core/java/android/app/TaskStackListener.java +7 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app; import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager.TaskSnapshot; import android.content.ComponentName; import android.os.IBinder; import android.os.RemoteException; /** Loading Loading @@ -155,4 +156,10 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { @UnsupportedAppUsage public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) throws RemoteException { } @Override @UnsupportedAppUsage public void onSizeCompatModeActivityChanged(int displayId, IBinder activityToken) throws RemoteException { } } services/core/java/com/android/server/am/ActivityManagerService.java +10 −0 Original line number Diff line number Diff line Loading @@ -17622,6 +17622,16 @@ public class ActivityManagerService extends IActivityManager.Stub } } @Override public void killProcess(String processName, int uid, String reason) { synchronized (ActivityManagerService.this) { final ProcessRecord proc = getProcessRecordLocked(processName, uid, true /* keepIfLarge */); mProcessList.removeProcessLocked(proc, false /* callerWillRestart */, true /* allowRestart */, reason); } } @Override public boolean hasRunningActivity(int uid, @Nullable String packageName) { if (packageName == null) return false; Loading
core/java/android/app/ActivityManagerInternal.java +3 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,9 @@ public abstract class ActivityManagerInternal { /** Kill the processes in the list due to their tasks been removed. */ public abstract void killProcessesForRemovedTask(ArrayList<Object> procsToKill); /** Kill the process immediately. */ public abstract void killProcess(String processName, int uid, String reason); /** * Returns {@code true} if {@code uid} is running an activity from {@code packageName}. */ Loading
core/java/android/app/IActivityTaskManager.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -473,4 +473,14 @@ interface IActivityTaskManager { * contain one task. */ void setDisplayToSingleTaskInstance(int displayId); /** * Restarts the activity by killing its process if it is visible. If the activity is not * visible, the activity will not be restarted immediately and just keep the activity record in * the stack. It also resets the current override configuration so the activity will use the * configuration according to the latest state. * * @param activityToken The token of the target activity to restart. */ void restartActivityProcessIfVisible(in IBinder activityToken); }
core/java/android/app/ITaskStackListener.aidl +12 −0 Original line number Diff line number Diff line Loading @@ -149,4 +149,16 @@ oneway interface ITaskStackListener { * Called when a task snapshot got updated. */ void onTaskSnapshotChanged(int taskId, in ActivityManager.TaskSnapshot snapshot); /** * Called when the resumed activity is in size compatibility mode and its override configuration * is different from the current one of system. * * @param displayId Id of the display where the activity resides. * @param activityToken Token of the size compatibility mode activity. It will be null when * switching to a activity that is not in size compatibility mode or the * configuration of the activity. * @see com.android.server.wm.AppWindowToken#inSizeCompatMode */ void onSizeCompatModeActivityChanged(int displayId, in IBinder activityToken); }
core/java/android/app/TaskStackListener.java +7 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app; import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager.TaskSnapshot; import android.content.ComponentName; import android.os.IBinder; import android.os.RemoteException; /** Loading Loading @@ -155,4 +156,10 @@ public abstract class TaskStackListener extends ITaskStackListener.Stub { @UnsupportedAppUsage public void onTaskSnapshotChanged(int taskId, TaskSnapshot snapshot) throws RemoteException { } @Override @UnsupportedAppUsage public void onSizeCompatModeActivityChanged(int displayId, IBinder activityToken) throws RemoteException { } }
services/core/java/com/android/server/am/ActivityManagerService.java +10 −0 Original line number Diff line number Diff line Loading @@ -17622,6 +17622,16 @@ public class ActivityManagerService extends IActivityManager.Stub } } @Override public void killProcess(String processName, int uid, String reason) { synchronized (ActivityManagerService.this) { final ProcessRecord proc = getProcessRecordLocked(processName, uid, true /* keepIfLarge */); mProcessList.removeProcessLocked(proc, false /* callerWillRestart */, true /* allowRestart */, reason); } } @Override public boolean hasRunningActivity(int uid, @Nullable String packageName) { if (packageName == null) return false;