Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 961afe9a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6470414 from 877bb420 to mainline-release

Change-Id: If65a16ac6013c010de1664a788df927fbbca850c
parents 9fde5d00 877bb420
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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: {
@@ -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: {
@@ -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: {
+12 −0
Original line number Diff line number Diff line
@@ -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"],
@@ -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"],
@@ -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"],
@@ -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"],
+1 −1
Original line number Diff line number Diff line
@@ -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"],
+13 −0
Original line number Diff line number Diff line
@@ -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.
@@ -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);
+38 −3
Original line number Diff line number Diff line
@@ -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")
@@ -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;
@@ -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
@@ -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));
@@ -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) {
@@ -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