Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ package android.app { public class ActivityManager { method public void addOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener, int); method public void alwaysShowUnsupportedCompileSdkWarning(android.content.ComponentName); method public int getPackageImportance(java.lang.String); method public long getTotalRam(); method public int getUidImportance(int); Loading core/java/android/app/ActivityManager.java +18 −0 Original line number Diff line number Diff line Loading @@ -3744,6 +3744,24 @@ public class ActivityManager { return SystemProperties.getBoolean("ro.test_harness", false); } /** * Unsupported compiled sdk warning should always be shown for the intput activity * even in cases where the system would normally not show the warning. E.g. when running in a * test harness. * * @param activity The component name of the activity to always show the warning for. * * @hide */ @TestApi public void alwaysShowUnsupportedCompileSdkWarning(ComponentName activity) { try { getService().alwaysShowUnsupportedCompileSdkWarning(activity); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Returns the launch count of each installed package. * Loading core/java/android/app/IActivityManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -703,4 +703,7 @@ interface IActivityManager { */ void registerRemoteAnimationForNextActivityStart(in String packageName, in RemoteAnimationAdapter adapter); /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ void alwaysShowUnsupportedCompileSdkWarning(in ComponentName activity); } services/core/java/com/android/server/am/ActivityManagerService.java +13 −0 Original line number Diff line number Diff line Loading @@ -26704,4 +26704,17 @@ public class ActivityManagerService extends IActivityManager.Stub } } } /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ @Override public void alwaysShowUnsupportedCompileSdkWarning(ComponentName activity) { synchronized (this) { final long origId = Binder.clearCallingIdentity(); try { mAppWarnings.alwaysShowUnsupportedCompileSdkWarning(activity); } finally { Binder.restoreCallingIdentity(origId); } } } } services/core/java/com/android/server/am/AppWarnings.java +19 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.server.am; import android.annotation.UiThread; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; import android.content.res.Configuration; import android.os.Build; Loading @@ -39,6 +41,7 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.HashSet; import java.util.Map; /** Loading @@ -64,6 +67,15 @@ class AppWarnings { private UnsupportedCompileSdkDialog mUnsupportedCompileSdkDialog; private DeprecatedTargetSdkVersionDialog mDeprecatedTargetSdkVersionDialog; /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ private HashSet<ComponentName> mAlwaysShowUnsupportedCompileSdkWarningActivities = new HashSet<>(); /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ void alwaysShowUnsupportedCompileSdkWarning(ComponentName activity) { mAlwaysShowUnsupportedCompileSdkWarningActivities.add(activity); } /** * Creates a new warning dialog manager. * <p> Loading Loading @@ -110,6 +122,13 @@ class AppWarnings { return; } if (ActivityManager.isRunningInTestHarness() && !mAlwaysShowUnsupportedCompileSdkWarningActivities.contains(r.realActivity)) { // Don't show warning if we are running in a test harness and we don't have to always // show for this activity. return; } // If the application was built against an pre-release SDK that's older than the current // platform OR if the current platform is pre-release and older than the SDK against which // the application was built OR both are pre-release with the same SDK_INT but different Loading Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ package android.app { public class ActivityManager { method public void addOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener, int); method public void alwaysShowUnsupportedCompileSdkWarning(android.content.ComponentName); method public int getPackageImportance(java.lang.String); method public long getTotalRam(); method public int getUidImportance(int); Loading
core/java/android/app/ActivityManager.java +18 −0 Original line number Diff line number Diff line Loading @@ -3744,6 +3744,24 @@ public class ActivityManager { return SystemProperties.getBoolean("ro.test_harness", false); } /** * Unsupported compiled sdk warning should always be shown for the intput activity * even in cases where the system would normally not show the warning. E.g. when running in a * test harness. * * @param activity The component name of the activity to always show the warning for. * * @hide */ @TestApi public void alwaysShowUnsupportedCompileSdkWarning(ComponentName activity) { try { getService().alwaysShowUnsupportedCompileSdkWarning(activity); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Returns the launch count of each installed package. * Loading
core/java/android/app/IActivityManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -703,4 +703,7 @@ interface IActivityManager { */ void registerRemoteAnimationForNextActivityStart(in String packageName, in RemoteAnimationAdapter adapter); /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ void alwaysShowUnsupportedCompileSdkWarning(in ComponentName activity); }
services/core/java/com/android/server/am/ActivityManagerService.java +13 −0 Original line number Diff line number Diff line Loading @@ -26704,4 +26704,17 @@ public class ActivityManagerService extends IActivityManager.Stub } } } /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ @Override public void alwaysShowUnsupportedCompileSdkWarning(ComponentName activity) { synchronized (this) { final long origId = Binder.clearCallingIdentity(); try { mAppWarnings.alwaysShowUnsupportedCompileSdkWarning(activity); } finally { Binder.restoreCallingIdentity(origId); } } } }
services/core/java/com/android/server/am/AppWarnings.java +19 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ package com.android.server.am; import android.annotation.UiThread; import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; import android.content.res.Configuration; import android.os.Build; Loading @@ -39,6 +41,7 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.HashSet; import java.util.Map; /** Loading @@ -64,6 +67,15 @@ class AppWarnings { private UnsupportedCompileSdkDialog mUnsupportedCompileSdkDialog; private DeprecatedTargetSdkVersionDialog mDeprecatedTargetSdkVersionDialog; /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ private HashSet<ComponentName> mAlwaysShowUnsupportedCompileSdkWarningActivities = new HashSet<>(); /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ void alwaysShowUnsupportedCompileSdkWarning(ComponentName activity) { mAlwaysShowUnsupportedCompileSdkWarningActivities.add(activity); } /** * Creates a new warning dialog manager. * <p> Loading Loading @@ -110,6 +122,13 @@ class AppWarnings { return; } if (ActivityManager.isRunningInTestHarness() && !mAlwaysShowUnsupportedCompileSdkWarningActivities.contains(r.realActivity)) { // Don't show warning if we are running in a test harness and we don't have to always // show for this activity. return; } // If the application was built against an pre-release SDK that's older than the current // platform OR if the current platform is pre-release and older than the SDK against which // the application was built OR both are pre-release with the same SDK_INT but different Loading