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

Commit 8f9b6894 authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge Android R QPR1

Bug: 172690556
Merged-In: Ib81ba3288a986546bc570c3759c55d026add591a
Change-Id: I2acfeb6cfc83a80056a685355cc367a5514da069
parents a086c295 3cfbcbee
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -128,7 +128,7 @@ class BlobStoreConfig {
         */
         */
        public static final String KEY_USE_REVOCABLE_FD_FOR_READS =
        public static final String KEY_USE_REVOCABLE_FD_FOR_READS =
                "use_revocable_fd_for_reads";
                "use_revocable_fd_for_reads";
        public static final boolean DEFAULT_USE_REVOCABLE_FD_FOR_READS = true;
        public static final boolean DEFAULT_USE_REVOCABLE_FD_FOR_READS = false;
        public static boolean USE_REVOCABLE_FD_FOR_READS =
        public static boolean USE_REVOCABLE_FD_FOR_READS =
                DEFAULT_USE_REVOCABLE_FD_FOR_READS;
                DEFAULT_USE_REVOCABLE_FD_FOR_READS;


+19 −4
Original line number Original line Diff line number Diff line
@@ -455,9 +455,6 @@ public class AppStandbyController implements AppStandbyInternal {


            mSystemServicesReady = true;
            mSystemServicesReady = true;


            // Offload to handler thread to avoid boot time impact.
            mHandler.post(AppStandbyController.this::updatePowerWhitelistCache);

            boolean userFileExists;
            boolean userFileExists;
            synchronized (mAppIdleLock) {
            synchronized (mAppIdleLock) {
                userFileExists = mAppIdleHistory.userFileExists(UserHandle.USER_SYSTEM);
                userFileExists = mAppIdleHistory.userFileExists(UserHandle.USER_SYSTEM);
@@ -474,7 +471,9 @@ public class AppStandbyController implements AppStandbyInternal {
            setChargingState(mInjector.isCharging());
            setChargingState(mInjector.isCharging());


            // Offload to handler thread after boot completed to avoid boot time impact. This means
            // Offload to handler thread after boot completed to avoid boot time impact. This means
            // that headless system apps may be put in a lower bucket until boot has completed.
            // that app standby buckets may be slightly out of date and headless system apps may be
            // put in a lower bucket until boot has completed.
            mHandler.post(AppStandbyController.this::updatePowerWhitelistCache);
            mHandler.post(this::loadHeadlessSystemAppCache);
            mHandler.post(this::loadHeadlessSystemAppCache);
        }
        }
    }
    }
@@ -1121,6 +1120,10 @@ public class AppStandbyController implements AppStandbyInternal {
            if (isDeviceProvisioningPackage(packageName)) {
            if (isDeviceProvisioningPackage(packageName)) {
                return STANDBY_BUCKET_EXEMPTED;
                return STANDBY_BUCKET_EXEMPTED;
            }
            }

            if (mInjector.isWellbeingPackage(packageName)) {
                return STANDBY_BUCKET_WORKING_SET;
            }
        }
        }


        // Check this last, as it can be the most expensive check
        // Check this last, as it can be the most expensive check
@@ -1930,6 +1933,7 @@ public class AppStandbyController implements AppStandbyInternal {
         */
         */
        @GuardedBy("mPowerWhitelistedApps")
        @GuardedBy("mPowerWhitelistedApps")
        private final ArraySet<String> mPowerWhitelistedApps = new ArraySet<>();
        private final ArraySet<String> mPowerWhitelistedApps = new ArraySet<>();
        private String mWellbeingApp = null;


        Injector(Context context, Looper looper) {
        Injector(Context context, Looper looper) {
            mContext = context;
            mContext = context;
@@ -1963,6 +1967,9 @@ public class AppStandbyController implements AppStandbyInternal {
                if (activityManager.isLowRamDevice() || ActivityManager.isSmallBatteryDevice()) {
                if (activityManager.isLowRamDevice() || ActivityManager.isSmallBatteryDevice()) {
                    mAutoRestrictedBucketDelayMs = 12 * ONE_HOUR;
                    mAutoRestrictedBucketDelayMs = 12 * ONE_HOUR;
                }
                }

                final PackageManager packageManager = mContext.getPackageManager();
                mWellbeingApp = packageManager.getWellbeingPackageName();
            }
            }
            mBootPhase = phase;
            mBootPhase = phase;
        }
        }
@@ -2007,6 +2014,14 @@ public class AppStandbyController implements AppStandbyInternal {
            }
            }
        }
        }


        /**
         * Returns {@code true} if the supplied package is the wellbeing app. Otherwise,
         * returns {@code false}.
         */
        boolean isWellbeingPackage(String packageName) {
            return mWellbeingApp != null && mWellbeingApp.equals(packageName);
        }

        void updatePowerWhitelistCache() {
        void updatePowerWhitelistCache() {
            try {
            try {
                // Don't call out to DeviceIdleController with the lock held.
                // Don't call out to DeviceIdleController with the lock held.
+1 −1
Original line number Original line Diff line number Diff line
{
{
  "name": "com.android.permission",
  "name": "com.android.permission",
  "version": 300900700
  "version": 300000000
}
}
+4 −0
Original line number Original line Diff line number Diff line
@@ -554,6 +554,10 @@ status_t IncidentService::command(FILE* in, FILE* out, FILE* err, Vector<String8
            return NO_ERROR;
            return NO_ERROR;
        }
        }
        if (!args[0].compare(String8("section"))) {
        if (!args[0].compare(String8("section"))) {
            if (argCount == 1) {
                fprintf(out, "Not enough arguments for section\n");
                return NO_ERROR;
            }
            int id = atoi(args[1]);
            int id = atoi(args[1]);
            int idx = 0;
            int idx = 0;
            while (SECTION_LIST[idx] != NULL) {
            while (SECTION_LIST[idx] != NULL) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -45167,7 +45167,7 @@ package android.telephony {
    method public long getNci();
    method public long getNci();
    method @IntRange(from=0, to=3279165) public int getNrarfcn();
    method @IntRange(from=0, to=3279165) public int getNrarfcn();
    method @IntRange(from=0, to=1007) public int getPci();
    method @IntRange(from=0, to=1007) public int getPci();
    method @IntRange(from=0, to=16777215) public int getTac();
    method @IntRange(from=0, to=65535) public int getTac();
    method public void writeToParcel(android.os.Parcel, int);
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CellIdentityNr> CREATOR;
    field @NonNull public static final android.os.Parcelable.Creator<android.telephony.CellIdentityNr> CREATOR;
  }
  }
Loading