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

Commit 6d9a2ca7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 10950137 from b08d95b7 to 24Q1-release

Change-Id: I012b2405d8d15712c9bbae3b516b654cf727f757
parents 4e53e755 b08d95b7
Loading
Loading
Loading
Loading
+29 −0
Original line number Original line Diff line number Diff line
@@ -36,7 +36,9 @@ aconfig_srcjars = [
    ":com.android.media.flags.bettertogether-aconfig-java{.generated_srcjars}",
    ":com.android.media.flags.bettertogether-aconfig-java{.generated_srcjars}",
    ":sdk_sandbox_flags_lib{.generated_srcjars}",
    ":sdk_sandbox_flags_lib{.generated_srcjars}",
    ":android.permission.flags-aconfig-java{.generated_srcjars}",
    ":android.permission.flags-aconfig-java{.generated_srcjars}",
    ":android.database.sqlite-aconfig-java{.generated_srcjars}",
    ":hwui_flags_java_lib{.generated_srcjars}",
    ":hwui_flags_java_lib{.generated_srcjars}",
    ":framework_graphics_flags_java_lib{.generated_srcjars}",
    ":display_flags_lib{.generated_srcjars}",
    ":display_flags_lib{.generated_srcjars}",
    ":com.android.internal.foldables.flags-aconfig-java{.generated_srcjars}",
    ":com.android.internal.foldables.flags-aconfig-java{.generated_srcjars}",
    ":android.multiuser.flags-aconfig-java{.generated_srcjars}",
    ":android.multiuser.flags-aconfig-java{.generated_srcjars}",
@@ -45,6 +47,7 @@ aconfig_srcjars = [
    ":android.view.contentprotection.flags-aconfig-java{.generated_srcjars}",
    ":android.view.contentprotection.flags-aconfig-java{.generated_srcjars}",
    ":android.service.voice.flags-aconfig-java{.generated_srcjars}",
    ":android.service.voice.flags-aconfig-java{.generated_srcjars}",
    ":android.service.autofill.flags-aconfig-java{.generated_srcjars}",
    ":android.service.autofill.flags-aconfig-java{.generated_srcjars}",
    ":com.android.net.flags-aconfig-java{.generated_srcjars}",
]
]


filegroup {
filegroup {
@@ -332,6 +335,19 @@ java_aconfig_library {


}
}


// SQLite
aconfig_declarations {
    name: "android.database.sqlite-aconfig",
    package: "android.database.sqlite",
    srcs: ["core/java/android/database/sqlite/*.aconfig"],
}

java_aconfig_library {
    name: "android.database.sqlite-aconfig-java",
    aconfig_declarations: "android.database.sqlite-aconfig",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Biometrics
// Biometrics
aconfig_declarations {
aconfig_declarations {
    name: "android.hardware.biometrics.flags-aconfig",
    name: "android.hardware.biometrics.flags-aconfig",
@@ -352,6 +368,12 @@ java_aconfig_library {
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
}


java_aconfig_library {
    name: "framework_graphics_flags_java_lib",
    aconfig_declarations: "framework_graphics_flags",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}

// Display
// Display
java_aconfig_library {
java_aconfig_library {
    name: "display_flags_lib",
    name: "display_flags_lib",
@@ -471,3 +493,10 @@ java_aconfig_library {
    aconfig_declarations: "android.companion.flags-aconfig",
    aconfig_declarations: "android.companion.flags-aconfig",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
}

// CoreNetworking
java_aconfig_library {
    name: "com.android.net.flags-aconfig-java",
    aconfig_declarations: "com.android.net.flags-aconfig",
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@ package: "com.android.server.job"


flag {
flag {
    name: "relax_prefetch_connectivity_constraint_only_on_charger"
    name: "relax_prefetch_connectivity_constraint_only_on_charger"
    namespace: "backstagepower"
    namespace: "backstage_power"
    description: "Only relax a prefetch job's connectivity constraint when the device is charging"
    description: "Only relax a prefetch job's connectivity constraint when the device is charging"
    bug: "299329948"
    bug: "299329948"
}
}
 No newline at end of file
+7 −131
Original line number Original line Diff line number Diff line
@@ -173,8 +173,6 @@ import com.android.server.usage.AppStandbyInternal.AppIdleStateChangeListener;


import dalvik.annotation.optimization.NeverCompile;
import dalvik.annotation.optimization.NeverCompile;


import libcore.util.EmptyArray;

import java.io.FileDescriptor;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.Retention;
@@ -260,7 +258,7 @@ public class AlarmManagerService extends SystemService {
    /**
    /**
     * A map from uid to the last op-mode we have seen for
     * A map from uid to the last op-mode we have seen for
     * {@link AppOpsManager#OP_SCHEDULE_EXACT_ALARM}. Used for evaluating permission state change
     * {@link AppOpsManager#OP_SCHEDULE_EXACT_ALARM}. Used for evaluating permission state change
     * when the denylist changes.
     * when the app-op changes.
     */
     */
    @VisibleForTesting
    @VisibleForTesting
    @GuardedBy("mLock")
    @GuardedBy("mLock")
@@ -671,9 +669,6 @@ public class AlarmManagerService extends SystemService {
    @VisibleForTesting
    @VisibleForTesting
    final class Constants implements DeviceConfig.OnPropertiesChangedListener,
    final class Constants implements DeviceConfig.OnPropertiesChangedListener,
            EconomyManagerInternal.TareStateChangeListener {
            EconomyManagerInternal.TareStateChangeListener {
        @VisibleForTesting
        static final int MAX_EXACT_ALARM_DENY_LIST_SIZE = 250;

        // Key names stored in the settings value.
        // Key names stored in the settings value.
        @VisibleForTesting
        @VisibleForTesting
        static final String KEY_MIN_FUTURITY = "min_futurity";
        static final String KEY_MIN_FUTURITY = "min_futurity";
@@ -727,8 +722,6 @@ public class AlarmManagerService extends SystemService {
        @VisibleForTesting
        @VisibleForTesting
        static final String KEY_PRIORITY_ALARM_DELAY = "priority_alarm_delay";
        static final String KEY_PRIORITY_ALARM_DELAY = "priority_alarm_delay";
        @VisibleForTesting
        @VisibleForTesting
        static final String KEY_EXACT_ALARM_DENY_LIST = "exact_alarm_deny_list";
        @VisibleForTesting
        static final String KEY_MIN_DEVICE_IDLE_FUZZ = "min_device_idle_fuzz";
        static final String KEY_MIN_DEVICE_IDLE_FUZZ = "min_device_idle_fuzz";
        @VisibleForTesting
        @VisibleForTesting
        static final String KEY_MAX_DEVICE_IDLE_FUZZ = "max_device_idle_fuzz";
        static final String KEY_MAX_DEVICE_IDLE_FUZZ = "max_device_idle_fuzz";
@@ -834,13 +827,6 @@ public class AlarmManagerService extends SystemService {
         */
         */
        public long PRIORITY_ALARM_DELAY = DEFAULT_PRIORITY_ALARM_DELAY;
        public long PRIORITY_ALARM_DELAY = DEFAULT_PRIORITY_ALARM_DELAY;


        /**
         * Read-only set of apps that won't get SCHEDULE_EXACT_ALARM when the app-op mode for
         * OP_SCHEDULE_EXACT_ALARM is MODE_DEFAULT. Since this is read-only and volatile, this can
         * be accessed without synchronizing on {@link #mLock}.
         */
        public volatile Set<String> EXACT_ALARM_DENY_LIST = Collections.emptySet();

        /**
        /**
         * Minimum time interval that an IDLE_UNTIL will be pulled earlier to a subsequent
         * Minimum time interval that an IDLE_UNTIL will be pulled earlier to a subsequent
         * WAKE_FROM_IDLE alarm.
         * WAKE_FROM_IDLE alarm.
@@ -1025,21 +1011,6 @@ public class AlarmManagerService extends SystemService {
                            PRIORITY_ALARM_DELAY = properties.getLong(KEY_PRIORITY_ALARM_DELAY,
                            PRIORITY_ALARM_DELAY = properties.getLong(KEY_PRIORITY_ALARM_DELAY,
                                    DEFAULT_PRIORITY_ALARM_DELAY);
                                    DEFAULT_PRIORITY_ALARM_DELAY);
                            break;
                            break;
                        case KEY_EXACT_ALARM_DENY_LIST:
                            final String rawValue = properties.getString(KEY_EXACT_ALARM_DENY_LIST,
                                    "");
                            final String[] values = rawValue.isEmpty()
                                    ? EmptyArray.STRING
                                    : rawValue.split(",", MAX_EXACT_ALARM_DENY_LIST_SIZE + 1);
                            if (values.length > MAX_EXACT_ALARM_DENY_LIST_SIZE) {
                                Slog.w(TAG, "Deny list too long, truncating to "
                                        + MAX_EXACT_ALARM_DENY_LIST_SIZE + " elements.");
                                updateExactAlarmDenyList(
                                        Arrays.copyOf(values, MAX_EXACT_ALARM_DENY_LIST_SIZE));
                            } else {
                                updateExactAlarmDenyList(values);
                            }
                            break;
                        case KEY_MIN_DEVICE_IDLE_FUZZ:
                        case KEY_MIN_DEVICE_IDLE_FUZZ:
                        case KEY_MAX_DEVICE_IDLE_FUZZ:
                        case KEY_MAX_DEVICE_IDLE_FUZZ:
                            if (!deviceIdleFuzzBoundariesUpdated) {
                            if (!deviceIdleFuzzBoundariesUpdated) {
@@ -1110,28 +1081,6 @@ public class AlarmManagerService extends SystemService {
            }
            }
        }
        }


        private void updateExactAlarmDenyList(String[] newDenyList) {
            final Set<String> newSet = Collections.unmodifiableSet(new ArraySet<>(newDenyList));
            final Set<String> removed = new ArraySet<>(EXACT_ALARM_DENY_LIST);
            final Set<String> added = new ArraySet<>(newDenyList);

            added.removeAll(EXACT_ALARM_DENY_LIST);
            removed.removeAll(newSet);
            if (added.size() > 0) {
                mHandler.obtainMessage(AlarmHandler.EXACT_ALARM_DENY_LIST_PACKAGES_ADDED, added)
                        .sendToTarget();
            }
            if (removed.size() > 0) {
                mHandler.obtainMessage(AlarmHandler.EXACT_ALARM_DENY_LIST_PACKAGES_REMOVED, removed)
                        .sendToTarget();
            }
            if (newDenyList.length == 0) {
                EXACT_ALARM_DENY_LIST = Collections.emptySet();
            } else {
                EXACT_ALARM_DENY_LIST = newSet;
            }
        }

        private void updateDeviceIdleFuzzBoundaries() {
        private void updateDeviceIdleFuzzBoundaries() {
            final DeviceConfig.Properties properties = DeviceConfig.getProperties(
            final DeviceConfig.Properties properties = DeviceConfig.getProperties(
                    DeviceConfig.NAMESPACE_ALARM_MANAGER,
                    DeviceConfig.NAMESPACE_ALARM_MANAGER,
@@ -1277,9 +1226,6 @@ public class AlarmManagerService extends SystemService {
            TimeUtils.formatDuration(PRIORITY_ALARM_DELAY, pw);
            TimeUtils.formatDuration(PRIORITY_ALARM_DELAY, pw);
            pw.println();
            pw.println();


            pw.print(KEY_EXACT_ALARM_DENY_LIST, EXACT_ALARM_DENY_LIST);
            pw.println();

            pw.print(KEY_MIN_DEVICE_IDLE_FUZZ);
            pw.print(KEY_MIN_DEVICE_IDLE_FUZZ);
            pw.print("=");
            pw.print("=");
            TimeUtils.formatDuration(MIN_DEVICE_IDLE_FUZZ, pw);
            TimeUtils.formatDuration(MIN_DEVICE_IDLE_FUZZ, pw);
@@ -2114,14 +2060,10 @@ public class AlarmManagerService extends SystemService {
                                            ? permissionState
                                            ? permissionState
                                            : (newMode == AppOpsManager.MODE_ALLOWED);
                                            : (newMode == AppOpsManager.MODE_ALLOWED);
                                } else {
                                } else {
                                    final boolean allowedByDefault =
                                            !mConstants.EXACT_ALARM_DENY_LIST.contains(packageName);
                                    hadPermission = (oldMode == AppOpsManager.MODE_DEFAULT)
                                    hadPermission = (oldMode == AppOpsManager.MODE_DEFAULT)
                                            ? allowedByDefault
                                            || (oldMode == AppOpsManager.MODE_ALLOWED);
                                            : (oldMode == AppOpsManager.MODE_ALLOWED);
                                    hasPermission = (newMode == AppOpsManager.MODE_DEFAULT)
                                    hasPermission = (newMode == AppOpsManager.MODE_DEFAULT)
                                            ? allowedByDefault
                                            || (newMode == AppOpsManager.MODE_ALLOWED);
                                            : (newMode == AppOpsManager.MODE_ALLOWED);
                                }
                                }


                                if (hadPermission && !hasPermission) {
                                if (hadPermission && !hasPermission) {
@@ -2769,11 +2711,8 @@ public class AlarmManagerService extends SystemService {
            // Compatibility permission check for older apps.
            // Compatibility permission check for older apps.
            final int mode = mAppOps.checkOpNoThrow(AppOpsManager.OP_SCHEDULE_EXACT_ALARM, uid,
            final int mode = mAppOps.checkOpNoThrow(AppOpsManager.OP_SCHEDULE_EXACT_ALARM, uid,
                    packageName);
                    packageName);
            if (mode == AppOpsManager.MODE_DEFAULT) {
            hasPermission = (mode == AppOpsManager.MODE_DEFAULT)
                hasPermission = !mConstants.EXACT_ALARM_DENY_LIST.contains(packageName);
                    || (mode == AppOpsManager.MODE_ALLOWED);
            } else {
                hasPermission = (mode == AppOpsManager.MODE_ALLOWED);
            }
        }
        }
        mStatLogger.logDurationStat(Stats.HAS_SCHEDULE_EXACT_ALARM, start);
        mStatLogger.logDurationStat(Stats.HAS_SCHEDULE_EXACT_ALARM, start);
        return hasPermission;
        return hasPermission;
@@ -3992,63 +3931,6 @@ public class AlarmManagerService extends SystemService {
        }
        }
    }
    }


    /**
     * Called when the {@link Constants#EXACT_ALARM_DENY_LIST}, changes with the packages that
     * either got added or deleted.
     * These packages may lose or gain the SCHEDULE_EXACT_ALARM permission.
     *
     * Note that these packages don't need to be installed on the device, but if they are and they
     * do undergo a permission change, we will handle them appropriately.
     *
     * This should not be called with the lock held as it calls out to other services.
     * This is not expected to get called frequently.
     */
    void handleChangesToExactAlarmDenyList(ArraySet<String> changedPackages, boolean added) {
        Slog.w(TAG, "Packages " + changedPackages + (added ? " added to" : " removed from")
                + " the exact alarm deny list.");

        final int[] startedUserIds = mActivityManagerInternal.getStartedUserIds();

        for (int i = 0; i < changedPackages.size(); i++) {
            final String changedPackage = changedPackages.valueAt(i);
            for (final int userId : startedUserIds) {
                final int uid = mPackageManagerInternal.getPackageUid(changedPackage, 0, userId);
                if (uid <= 0) {
                    continue;
                }
                if (!isExactAlarmChangeEnabled(changedPackage, userId)) {
                    continue;
                }
                if (isScheduleExactAlarmDeniedByDefault(changedPackage, userId)) {
                    continue;
                }
                if (hasUseExactAlarmInternal(changedPackage, uid)) {
                    continue;
                }
                if (!mExactAlarmCandidates.contains(UserHandle.getAppId(uid))) {
                    // Permission isn't requested, deny list doesn't matter.
                    continue;
                }
                final int appOpMode;
                synchronized (mLock) {
                    appOpMode = mLastOpScheduleExactAlarm.get(uid,
                            AppOpsManager.opToDefaultMode(AppOpsManager.OP_SCHEDULE_EXACT_ALARM));
                }
                if (appOpMode != AppOpsManager.MODE_DEFAULT) {
                    // Deny list doesn't matter.
                    continue;
                }
                // added: true => package was added to the deny list
                // added: false => package was removed from the deny list
                if (added) {
                    removeExactAlarmsOnPermissionRevoked(uid, changedPackage, /*killUid = */ true);
                } else {
                    sendScheduleExactAlarmPermissionStateChangedBroadcast(changedPackage, userId);
                }
            }
        }
    }

    /**
    /**
     * Called when an app loses the permission to use exact alarms. This will happen when the app
     * Called when an app loses the permission to use exact alarms. This will happen when the app
     * no longer has either {@link Manifest.permission#SCHEDULE_EXACT_ALARM} or
     * no longer has either {@link Manifest.permission#SCHEDULE_EXACT_ALARM} or
@@ -4931,8 +4813,8 @@ public class AlarmManagerService extends SystemService {
        public static final int CHARGING_STATUS_CHANGED = 6;
        public static final int CHARGING_STATUS_CHANGED = 6;
        public static final int REMOVE_FOR_CANCELED = 7;
        public static final int REMOVE_FOR_CANCELED = 7;
        public static final int REMOVE_EXACT_ALARMS = 8;
        public static final int REMOVE_EXACT_ALARMS = 8;
        public static final int EXACT_ALARM_DENY_LIST_PACKAGES_ADDED = 9;
        // Unused id 9
        public static final int EXACT_ALARM_DENY_LIST_PACKAGES_REMOVED = 10;
        // Unused id 10
        public static final int REFRESH_EXACT_ALARM_CANDIDATES = 11;
        public static final int REFRESH_EXACT_ALARM_CANDIDATES = 11;
        public static final int TARE_AFFORDABILITY_CHANGED = 12;
        public static final int TARE_AFFORDABILITY_CHANGED = 12;
        public static final int CHECK_EXACT_ALARM_PERMISSION_ON_UPDATE = 13;
        public static final int CHECK_EXACT_ALARM_PERMISSION_ON_UPDATE = 13;
@@ -5041,12 +4923,6 @@ public class AlarmManagerService extends SystemService {
                    String packageName = (String) msg.obj;
                    String packageName = (String) msg.obj;
                    removeExactAlarmsOnPermissionRevoked(uid, packageName, /*killUid = */true);
                    removeExactAlarmsOnPermissionRevoked(uid, packageName, /*killUid = */true);
                    break;
                    break;
                case EXACT_ALARM_DENY_LIST_PACKAGES_ADDED:
                    handleChangesToExactAlarmDenyList((ArraySet<String>) msg.obj, true);
                    break;
                case EXACT_ALARM_DENY_LIST_PACKAGES_REMOVED:
                    handleChangesToExactAlarmDenyList((ArraySet<String>) msg.obj, false);
                    break;
                case REFRESH_EXACT_ALARM_CANDIDATES:
                case REFRESH_EXACT_ALARM_CANDIDATES:
                    refreshExactAlarmCandidates();
                    refreshExactAlarmCandidates();
                    break;
                    break;
+44 −0
Original line number Original line Diff line number Diff line
@@ -438,6 +438,26 @@ java_api_library {
    full_api_surface_stub: "android_module_lib_stubs_current_full.from-text",
    full_api_surface_stub: "android_module_lib_stubs_current_full.from-text",
}
}


// This module generates a stub jar that is a union of the test and module lib
// non-updatable api contributions. Modules should not depend on the stub jar
// generated from this module, as this module is strictly used for hiddenapi only.
java_api_library {
    name: "android-non-updatable.stubs.test_module_lib",
    api_surface: "module_lib",
    api_contributions: [
        "api-stubs-docs-non-updatable.api.contribution",
        "system-api-stubs-docs-non-updatable.api.contribution",
        "test-api-stubs-docs-non-updatable.api.contribution",
        "module-lib-api-stubs-docs-non-updatable.api.contribution",
    ],
    defaults: ["android-non-updatable_from_text_defaults"],
    full_api_surface_stub: "android_test_module_lib_stubs_current.from-text",

    // This module is only used for hiddenapi, and other modules should not
    // depend on this module.
    visibility: ["//visibility:private"],
}

java_defaults {
java_defaults {
    name: "android_stubs_dists_default",
    name: "android_stubs_dists_default",
    dist: {
    dist: {
@@ -756,6 +776,30 @@ java_api_library {
    visibility: ["//visibility:public"],
    visibility: ["//visibility:public"],
}
}


java_api_library {
    name: "android_test_module_lib_stubs_current.from-text",
    api_surface: "module-lib",
    defaults: [
        "android_stubs_current_contributions",
        "android_system_stubs_current_contributions",
        "android_test_stubs_current_contributions",
        "android_module_lib_stubs_current_contributions",
    ],
    libs: [
        "android_module_lib_stubs_current_full.from-text",
        "stub-annotations",
    ],
    api_contributions: [
        "test-api-stubs-docs-non-updatable.api.contribution",
    ],

    // This module is only used to build android-non-updatable.stubs.test_module_lib
    // and other modules should not depend on this module.
    visibility: [
        "//visibility:private",
    ],
}

java_api_library {
java_api_library {
    name: "android_system_server_stubs_current.from-text",
    name: "android_system_server_stubs_current.from-text",
    api_surface: "system-server",
    api_surface: "system-server",
+0 −70

File changed.

Preview size limit exceeded, changes collapsed.

Loading