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

Commit 379d80ba authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7456046 from 9088f944 to sc-release

Change-Id: I4360df16a00d0f3761e8e7fb6cd3aea3654800fc
parents 3d50516b 9088f944
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -1536,13 +1536,14 @@ public class DeviceIdleController extends SystemService
    @VisibleForTesting
    static final int MSG_REPORT_STATIONARY_STATUS = 7;
    private static final int MSG_FINISH_IDLE_OP = 8;
    private static final int MSG_REPORT_TEMP_APP_WHITELIST_CHANGED_TO_NPMS = 9;
    private static final int MSG_SEND_CONSTRAINT_MONITORING = 10;
    @VisibleForTesting
    static final int MSG_UPDATE_PRE_IDLE_TIMEOUT_FACTOR = 11;
    @VisibleForTesting
    static final int MSG_RESET_PRE_IDLE_TIMEOUT_FACTOR = 12;
    private static final int MSG_REPORT_TEMP_APP_WHITELIST_CHANGED = 13;
    private static final int MSG_REPORT_TEMP_APP_WHITELIST_ADDED_TO_NPMS = 14;
    private static final int MSG_REPORT_TEMP_APP_WHITELIST_REMOVED_TO_NPMS = 15;

    final class MyHandler extends Handler {
        MyHandler(Looper looper) {
@@ -1659,10 +1660,17 @@ public class DeviceIdleController extends SystemService
                        }
                    }
                } break;
                case MSG_REPORT_TEMP_APP_WHITELIST_CHANGED_TO_NPMS: {
                case MSG_REPORT_TEMP_APP_WHITELIST_ADDED_TO_NPMS: {
                    final int appId = msg.arg1;
                    final boolean added = (msg.arg2 == 1);
                    mNetworkPolicyManagerInternal.onTempPowerSaveWhitelistChange(appId, added);
                    final int reasonCode = msg.arg2;
                    final String reason = (String) msg.obj;
                    mNetworkPolicyManagerInternal.onTempPowerSaveWhitelistChange(appId, true,
                            reasonCode, reason);
                } break;
                case MSG_REPORT_TEMP_APP_WHITELIST_REMOVED_TO_NPMS: {
                    final int appId = msg.arg1;
                    mNetworkPolicyManagerInternal.onTempPowerSaveWhitelistChange(appId, false,
                            REASON_UNKNOWN, /* reason= */ null);
                } break;
                case MSG_SEND_CONSTRAINT_MONITORING: {
                    final IDeviceIdleConstraint constraint = (IDeviceIdleConstraint) msg.obj;
@@ -2811,14 +2819,15 @@ public class DeviceIdleController extends SystemService
                    // NPMS needs to update its state synchronously in certain situations so we
                    // can't have it use the TempAllowlistChangeListener path right now.
                    // TODO: see if there's a way to simplify/consolidate
                    mHandler.obtainMessage(MSG_REPORT_TEMP_APP_WHITELIST_CHANGED_TO_NPMS, appId, 1)
                            .sendToTarget();
                    mHandler.obtainMessage(MSG_REPORT_TEMP_APP_WHITELIST_ADDED_TO_NPMS, appId,
                            reasonCode, reason).sendToTarget();
                }
                reportTempWhitelistChangedLocked(uid, true);
            }
        }
        if (informWhitelistChanged) {
            mNetworkPolicyManagerInternal.onTempPowerSaveWhitelistChange(appId, true);
            mNetworkPolicyManagerInternal.onTempPowerSaveWhitelistChange(appId, true,
                    reasonCode, reason);
        }
    }

@@ -2890,8 +2899,8 @@ public class DeviceIdleController extends SystemService
        final int appId = UserHandle.getAppId(uid);
        updateTempWhitelistAppIdsLocked(uid, false, 0, 0, REASON_UNKNOWN,
                reason, INVALID_UID);
        mHandler.obtainMessage(MSG_REPORT_TEMP_APP_WHITELIST_CHANGED_TO_NPMS, appId, 0)
                .sendToTarget();
        mHandler.obtainMessage(MSG_REPORT_TEMP_APP_WHITELIST_REMOVED_TO_NPMS, appId,
                /* unused= */ 0).sendToTarget();
        reportTempWhitelistChangedLocked(uid, false);
        try {
            mBatteryStats.noteEvent(BatteryStats.HistoryItem.EVENT_TEMP_WHITELIST_FINISH,
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ package android.accessibilityservice {
  }

  public abstract class AccessibilityService extends android.app.Service {
    field public static final int ACCESSIBILITY_TAKE_SCREENSHOT_REQUEST_INTERVAL_TIMES_MS = 1000; // 0x3e8
    field public static final int ACCESSIBILITY_TAKE_SCREENSHOT_REQUEST_INTERVAL_TIMES_MS = 333; // 0x14d
  }

  public class AccessibilityServiceInfo implements android.os.Parcelable {
+1 −1
Original line number Diff line number Diff line
@@ -685,7 +685,7 @@ public abstract class AccessibilityService extends Service {
     * @hide
     */
    @TestApi
    public static final int ACCESSIBILITY_TAKE_SCREENSHOT_REQUEST_INTERVAL_TIMES_MS = 1000;
    public static final int ACCESSIBILITY_TAKE_SCREENSHOT_REQUEST_INTERVAL_TIMES_MS = 333;

    /** @hide */
    public static final String KEY_ACCESSIBILITY_SCREENSHOT_STATUS =
+4 −0
Original line number Diff line number Diff line
@@ -13088,6 +13088,10 @@ public class DevicePolicyManager {
     * @see #getCrossProfileCalendarPackages(ComponentName)
     * @hide
     */
    @RequiresPermission(anyOf = {
            permission.INTERACT_ACROSS_USERS_FULL,
            permission.INTERACT_ACROSS_USERS
    }, conditional = true)
    public boolean isPackageAllowedToAccessCalendar(@NonNull  String packageName) {
        throwIfParentInstance("isPackageAllowedToAccessCalendar");
        if (mService != null) {
+21 −2
Original line number Diff line number Diff line
@@ -571,7 +571,9 @@ public class SystemSensorManager extends SensorManager {
        }

        int sensorHandle = (sensor == null) ? -1 : sensor.getHandle();
        if (rate > CAPPED_SAMPLING_RATE_LEVEL
        if (sensor != null
                && isSensorInCappedSet(sensor.getType())
                && rate > CAPPED_SAMPLING_RATE_LEVEL
                && mIsPackageDebuggable
                && !mHasHighSamplingRateSensorsPermission
                && Compatibility.isChangeEnabled(CHANGE_ID_SAMPLING_RATE_SENSORS_PERMISSION)) {
@@ -782,7 +784,8 @@ public class SystemSensorManager extends SensorManager {
                Sensor sensor, int rateUs, int maxBatchReportLatencyUs) {
            if (mNativeSensorEventQueue == 0) throw new NullPointerException();
            if (sensor == null) throw new NullPointerException();
            if (rateUs < CAPPED_SAMPLING_PERIOD_US
            if (mManager.isSensorInCappedSet(sensor.getType())
                    && rateUs < CAPPED_SAMPLING_PERIOD_US
                    && mManager.mIsPackageDebuggable
                    && !mManager.mHasHighSamplingRateSensorsPermission
                    && Compatibility.isChangeEnabled(CHANGE_ID_SAMPLING_RATE_SENSORS_PERMISSION)) {
@@ -1015,4 +1018,20 @@ public class SystemSensorManager extends SensorManager {
                mNativeInstance, handle,
                parameter.type, parameter.floatValues, parameter.intValues) == 0;
    }

    /**
     * Checks if a sensor should be capped according to HIGH_SAMPLING_RATE_SENSORS
     * permission.
     *
     * This needs to be kept in sync with the list defined on the native side
     * in frameworks/native/services/sensorservice/SensorService.cpp
     */
    private boolean isSensorInCappedSet(int sensorType) {
        return (sensorType == Sensor.TYPE_ACCELEROMETER
                || sensorType == Sensor.TYPE_ACCELEROMETER_UNCALIBRATED
                || sensorType == Sensor.TYPE_GYROSCOPE
                || sensorType == Sensor.TYPE_GYROSCOPE_UNCALIBRATED
                || sensorType == Sensor.TYPE_MAGNETIC_FIELD
                || sensorType == Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED);
    }
}
Loading