Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -3955,6 +3955,7 @@ package android.app { public class ActivityManager { method public int addAppTask(@NonNull android.app.Activity, @NonNull android.content.Intent, @Nullable android.app.ActivityManager.TaskDescription, @NonNull android.graphics.Bitmap); method public void appNotResponding(@NonNull String); method public boolean clearApplicationUserData(); method public void clearWatchHeapLimit(); method @RequiresPermission(android.Manifest.permission.DUMP) public void dumpPackageState(java.io.FileDescriptor, String); core/java/android/app/ActivityManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -4547,4 +4547,17 @@ public class ActivityManager { throw e.rethrowFromSystemServer(); } } /** * Method for the app to tell system that it's wedged and would like to trigger an ANR. * * @param reason The description of that what happened */ public void appNotResponding(@NonNull final String reason) { try { getService().appNotResponding(reason); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } } core/java/android/app/IActivityManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -583,4 +583,9 @@ interface IActivityManager { * unlockProgressListener can be null if monitoring progress is not necessary. */ boolean startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener); /** * Method for the app to tell system that it's wedged and would like to trigger an ANR. */ void appNotResponding(String reason); } services/core/java/com/android/server/am/ActivityManagerService.java +20 −0 Original line number Diff line number Diff line Loading @@ -7558,6 +7558,26 @@ public class ActivityManagerService extends IActivityManager.Stub }); } @Override public void appNotResponding(final String reason) { final int callingPid = Binder.getCallingPid(); synchronized (mPidsSelfLocked) { final ProcessRecord app = mPidsSelfLocked.get(callingPid); if (app == null) { throw new SecurityException("Unknown process: " + callingPid); } mHandler.post(new Runnable() { @Override public void run() { app.appNotResponding( null, app.info, null, null, false, "App requested: " + reason); } }); } } public final void installSystemProviders() { List<ProviderInfo> providers; synchronized (this) { Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -3955,6 +3955,7 @@ package android.app { public class ActivityManager { method public int addAppTask(@NonNull android.app.Activity, @NonNull android.content.Intent, @Nullable android.app.ActivityManager.TaskDescription, @NonNull android.graphics.Bitmap); method public void appNotResponding(@NonNull String); method public boolean clearApplicationUserData(); method public void clearWatchHeapLimit(); method @RequiresPermission(android.Manifest.permission.DUMP) public void dumpPackageState(java.io.FileDescriptor, String);
core/java/android/app/ActivityManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -4547,4 +4547,17 @@ public class ActivityManager { throw e.rethrowFromSystemServer(); } } /** * Method for the app to tell system that it's wedged and would like to trigger an ANR. * * @param reason The description of that what happened */ public void appNotResponding(@NonNull final String reason) { try { getService().appNotResponding(reason); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
core/java/android/app/IActivityManager.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -583,4 +583,9 @@ interface IActivityManager { * unlockProgressListener can be null if monitoring progress is not necessary. */ boolean startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener); /** * Method for the app to tell system that it's wedged and would like to trigger an ANR. */ void appNotResponding(String reason); }
services/core/java/com/android/server/am/ActivityManagerService.java +20 −0 Original line number Diff line number Diff line Loading @@ -7558,6 +7558,26 @@ public class ActivityManagerService extends IActivityManager.Stub }); } @Override public void appNotResponding(final String reason) { final int callingPid = Binder.getCallingPid(); synchronized (mPidsSelfLocked) { final ProcessRecord app = mPidsSelfLocked.get(callingPid); if (app == null) { throw new SecurityException("Unknown process: " + callingPid); } mHandler.post(new Runnable() { @Override public void run() { app.appNotResponding( null, app.info, null, null, false, "App requested: " + reason); } }); } } public final void installSystemProviders() { List<ProviderInfo> providers; synchronized (this) { Loading