Loading StubLibraries.bp +3 −3 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ droidstubs { }, last_released: { api_file: ":android.api.public.latest", removed_api_file: "api/removed.txt", removed_api_file: ":removed.api.public.latest", baseline_file: ":public-api-incompatibilities-with-last-released", }, api_lint: { Loading Loading @@ -152,7 +152,7 @@ droidstubs { }, last_released: { api_file: ":android.api.system.latest", removed_api_file: "api/system-removed.txt", removed_api_file: ":removed.api.system.latest", baseline_file: ":system-api-incompatibilities-with-last-released" }, api_lint: { Loading Loading @@ -216,7 +216,7 @@ droidstubs { }, last_released: { api_file: ":android.api.module-lib.latest", removed_api_file: "api/module-lib-removed.txt", removed_api_file: ":removed.api.module-lib.latest", baseline_file: ":module-lib-api-incompatibilities-with-last-released" }, api_lint: { Loading apex/Android.bp +12 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,9 @@ stubs_defaults { api_file: "api/current.txt", removed_api_file: "api/removed.txt", }, api_lint: { enabled: true, }, }, dist: { targets: ["sdk", "win_sdk"], Loading @@ -93,6 +96,9 @@ stubs_defaults { api_file: "api/system-current.txt", removed_api_file: "api/system-removed.txt", }, api_lint: { enabled: true, }, }, dist: { targets: ["sdk", "win_sdk"], Loading Loading @@ -147,6 +153,9 @@ stubs_defaults { api_file: "api/module-lib-current.txt", removed_api_file: "api/module-lib-removed.txt", }, api_lint: { enabled: true, }, }, dist: { targets: ["sdk", "win_sdk"], Loading @@ -173,6 +182,9 @@ stubs_defaults { api_file: "api/current.txt", removed_api_file: "api/removed.txt", }, api_lint: { enabled: true, }, }, dist: { targets: ["sdk", "win_sdk"], Loading apex/extservices/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ apex { apex_defaults { name: "com.android.extservices-defaults", updatable: true, min_sdk_version: "R", min_sdk_version: "current", key: "com.android.extservices.key", certificate: ":com.android.extservices.certificate", apps: ["ExtServices"], Loading apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java +13 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,14 @@ public interface AppStandbyInternal { public abstract void onAppIdleStateChanged(String packageName, @UserIdInt int userId, boolean idle, int bucket, int reason); /** * Callback to inform listeners that the parole state has changed. This means apps are * allowed to do work even if they're idle or in a low bucket. */ public void onParoleStateChanged(boolean isParoleOn) { // No-op by default } /** * Optional callback to inform the listener that the app has transitioned into * an active state due to user interaction. Loading Loading @@ -92,6 +100,11 @@ public interface AppStandbyInternal { boolean isAppIdleFiltered(String packageName, int appId, int userId, long elapsedRealtime); /** * @return true if currently app idle parole mode is on. */ boolean isInParole(); int[] getIdleUidsForUser(int userId); void setAppIdleAsync(String packageName, boolean idle, int userId); Loading apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +38 −3 Original line number Diff line number Diff line Loading @@ -214,8 +214,7 @@ public class AppStandbyController implements AppStandbyInternal { private AppIdleHistory mAppIdleHistory; @GuardedBy("mPackageAccessListeners") private ArrayList<AppIdleStateChangeListener> mPackageAccessListeners = new ArrayList<>(); private final ArrayList<AppIdleStateChangeListener> mPackageAccessListeners = new ArrayList<>(); /** Whether we've queried the list of carrier privileged apps. */ @GuardedBy("mAppIdleLock") Loading @@ -235,6 +234,7 @@ public class AppStandbyController implements AppStandbyInternal { static final int MSG_FORCE_IDLE_STATE = 4; static final int MSG_CHECK_IDLE_STATES = 5; static final int MSG_REPORT_CONTENT_PROVIDER_USAGE = 8; static final int MSG_PAROLE_STATE_CHANGED = 9; static final int MSG_ONE_TIME_CHECK_IDLE_STATES = 10; /** Check the state of one app: arg1 = userId, arg2 = uid, obj = (String) packageName */ static final int MSG_CHECK_PACKAGE_IDLE_STATE = 11; Loading Loading @@ -390,7 +390,16 @@ public class AppStandbyController implements AppStandbyInternal { @VisibleForTesting void setAppIdleEnabled(boolean enabled) { synchronized (mAppIdleLock) { if (mAppIdleEnabled != enabled) { final boolean oldParoleState = isInParole(); mAppIdleEnabled = enabled; if (isInParole() != oldParoleState) { postParoleStateChanged(); } } } } @Override Loading Loading @@ -563,10 +572,22 @@ public class AppStandbyController implements AppStandbyInternal { if (mIsCharging != isCharging) { if (DEBUG) Slog.d(TAG, "Setting mIsCharging to " + isCharging); mIsCharging = isCharging; postParoleStateChanged(); } } } @Override public boolean isInParole() { return !mAppIdleEnabled || mIsCharging; } private void postParoleStateChanged() { if (DEBUG) Slog.d(TAG, "Posting MSG_PAROLE_STATE_CHANGED"); mHandler.removeMessages(MSG_PAROLE_STATE_CHANGED); mHandler.sendEmptyMessage(MSG_PAROLE_STATE_CHANGED); } @Override public void postCheckIdleStates(int userId) { mHandler.sendMessage(mHandler.obtainMessage(MSG_CHECK_IDLE_STATES, userId, 0)); Loading Loading @@ -1502,6 +1523,15 @@ public class AppStandbyController implements AppStandbyInternal { } } private void informParoleStateChanged() { final boolean paroled = isInParole(); synchronized (mPackageAccessListeners) { for (AppIdleStateChangeListener listener : mPackageAccessListeners) { listener.onParoleStateChanged(paroled); } } } @Override public void flushToDisk(int userId) { synchronized (mAppIdleLock) { Loading Loading @@ -1920,6 +1950,11 @@ public class AppStandbyController implements AppStandbyInternal { args.recycle(); break; case MSG_PAROLE_STATE_CHANGED: if (DEBUG) Slog.d(TAG, "Parole state: " + isInParole()); informParoleStateChanged(); break; case MSG_CHECK_PACKAGE_IDLE_STATE: checkAndUpdateStandbyState((String) msg.obj, msg.arg1, msg.arg2, mInjector.elapsedRealtime()); Loading Loading
StubLibraries.bp +3 −3 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ droidstubs { }, last_released: { api_file: ":android.api.public.latest", removed_api_file: "api/removed.txt", removed_api_file: ":removed.api.public.latest", baseline_file: ":public-api-incompatibilities-with-last-released", }, api_lint: { Loading Loading @@ -152,7 +152,7 @@ droidstubs { }, last_released: { api_file: ":android.api.system.latest", removed_api_file: "api/system-removed.txt", removed_api_file: ":removed.api.system.latest", baseline_file: ":system-api-incompatibilities-with-last-released" }, api_lint: { Loading Loading @@ -216,7 +216,7 @@ droidstubs { }, last_released: { api_file: ":android.api.module-lib.latest", removed_api_file: "api/module-lib-removed.txt", removed_api_file: ":removed.api.module-lib.latest", baseline_file: ":module-lib-api-incompatibilities-with-last-released" }, api_lint: { Loading
apex/Android.bp +12 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,9 @@ stubs_defaults { api_file: "api/current.txt", removed_api_file: "api/removed.txt", }, api_lint: { enabled: true, }, }, dist: { targets: ["sdk", "win_sdk"], Loading @@ -93,6 +96,9 @@ stubs_defaults { api_file: "api/system-current.txt", removed_api_file: "api/system-removed.txt", }, api_lint: { enabled: true, }, }, dist: { targets: ["sdk", "win_sdk"], Loading Loading @@ -147,6 +153,9 @@ stubs_defaults { api_file: "api/module-lib-current.txt", removed_api_file: "api/module-lib-removed.txt", }, api_lint: { enabled: true, }, }, dist: { targets: ["sdk", "win_sdk"], Loading @@ -173,6 +182,9 @@ stubs_defaults { api_file: "api/current.txt", removed_api_file: "api/removed.txt", }, api_lint: { enabled: true, }, }, dist: { targets: ["sdk", "win_sdk"], Loading
apex/extservices/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ apex { apex_defaults { name: "com.android.extservices-defaults", updatable: true, min_sdk_version: "R", min_sdk_version: "current", key: "com.android.extservices.key", certificate: ":com.android.extservices.certificate", apps: ["ExtServices"], Loading
apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java +13 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,14 @@ public interface AppStandbyInternal { public abstract void onAppIdleStateChanged(String packageName, @UserIdInt int userId, boolean idle, int bucket, int reason); /** * Callback to inform listeners that the parole state has changed. This means apps are * allowed to do work even if they're idle or in a low bucket. */ public void onParoleStateChanged(boolean isParoleOn) { // No-op by default } /** * Optional callback to inform the listener that the app has transitioned into * an active state due to user interaction. Loading Loading @@ -92,6 +100,11 @@ public interface AppStandbyInternal { boolean isAppIdleFiltered(String packageName, int appId, int userId, long elapsedRealtime); /** * @return true if currently app idle parole mode is on. */ boolean isInParole(); int[] getIdleUidsForUser(int userId); void setAppIdleAsync(String packageName, boolean idle, int userId); Loading
apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +38 −3 Original line number Diff line number Diff line Loading @@ -214,8 +214,7 @@ public class AppStandbyController implements AppStandbyInternal { private AppIdleHistory mAppIdleHistory; @GuardedBy("mPackageAccessListeners") private ArrayList<AppIdleStateChangeListener> mPackageAccessListeners = new ArrayList<>(); private final ArrayList<AppIdleStateChangeListener> mPackageAccessListeners = new ArrayList<>(); /** Whether we've queried the list of carrier privileged apps. */ @GuardedBy("mAppIdleLock") Loading @@ -235,6 +234,7 @@ public class AppStandbyController implements AppStandbyInternal { static final int MSG_FORCE_IDLE_STATE = 4; static final int MSG_CHECK_IDLE_STATES = 5; static final int MSG_REPORT_CONTENT_PROVIDER_USAGE = 8; static final int MSG_PAROLE_STATE_CHANGED = 9; static final int MSG_ONE_TIME_CHECK_IDLE_STATES = 10; /** Check the state of one app: arg1 = userId, arg2 = uid, obj = (String) packageName */ static final int MSG_CHECK_PACKAGE_IDLE_STATE = 11; Loading Loading @@ -390,7 +390,16 @@ public class AppStandbyController implements AppStandbyInternal { @VisibleForTesting void setAppIdleEnabled(boolean enabled) { synchronized (mAppIdleLock) { if (mAppIdleEnabled != enabled) { final boolean oldParoleState = isInParole(); mAppIdleEnabled = enabled; if (isInParole() != oldParoleState) { postParoleStateChanged(); } } } } @Override Loading Loading @@ -563,10 +572,22 @@ public class AppStandbyController implements AppStandbyInternal { if (mIsCharging != isCharging) { if (DEBUG) Slog.d(TAG, "Setting mIsCharging to " + isCharging); mIsCharging = isCharging; postParoleStateChanged(); } } } @Override public boolean isInParole() { return !mAppIdleEnabled || mIsCharging; } private void postParoleStateChanged() { if (DEBUG) Slog.d(TAG, "Posting MSG_PAROLE_STATE_CHANGED"); mHandler.removeMessages(MSG_PAROLE_STATE_CHANGED); mHandler.sendEmptyMessage(MSG_PAROLE_STATE_CHANGED); } @Override public void postCheckIdleStates(int userId) { mHandler.sendMessage(mHandler.obtainMessage(MSG_CHECK_IDLE_STATES, userId, 0)); Loading Loading @@ -1502,6 +1523,15 @@ public class AppStandbyController implements AppStandbyInternal { } } private void informParoleStateChanged() { final boolean paroled = isInParole(); synchronized (mPackageAccessListeners) { for (AppIdleStateChangeListener listener : mPackageAccessListeners) { listener.onParoleStateChanged(paroled); } } } @Override public void flushToDisk(int userId) { synchronized (mAppIdleLock) { Loading Loading @@ -1920,6 +1950,11 @@ public class AppStandbyController implements AppStandbyInternal { args.recycle(); break; case MSG_PAROLE_STATE_CHANGED: if (DEBUG) Slog.d(TAG, "Parole state: " + isInParole()); informParoleStateChanged(); break; case MSG_CHECK_PACKAGE_IDLE_STATE: checkAndUpdateStandbyState((String) msg.obj, msg.arg1, msg.arg2, mInjector.elapsedRealtime()); Loading