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

Commit e5d998f9 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Control revoke-on-upgrade behavior for loc perm

By default: Revoke on upgrade, but can be disabled by setting the
location_permissions_upgrade_to_Q_mode to anything but 0.

Fixes: 127285709
Test: Upgraded from P to Q with and without
      location_permissions_upgrade_to_Q_mode set
      atest --test-mapping frameworks/base/core/java/android/provider:presubmit
Change-Id: I4dd1772e78f46c881a5f747fcf61583beec2d6a2
parent 319c4ee4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -6116,6 +6116,7 @@ package android.provider {
    field public static final String LAST_SETUP_SHOWN = "last_setup_shown";
    field public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = "location_access_check_delay_millis";
    field public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = "location_access_check_interval_millis";
    field public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE = "location_permissions_upgrade_to_q_mode";
    field public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = "lock_screen_allow_private_notifications";
    field public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = "lock_screen_show_notifications";
    field public static final String MANUAL_RINGER_TOGGLE_COUNT = "manual_ringer_toggle_count";
+13 −0
Original line number Diff line number Diff line
@@ -8559,6 +8559,19 @@ public final class Settings {
        public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS =
                "location_access_check_delay_millis";
        /**
         * What should happen to the location permissions when upgraded to Android Q.
         *
         * <ul>
         *     <li>0/unset == revoke permissions</li>
         *     <li>anything else == Don't do anything</li>
         * </ul>
         *
         * @hide
         */
        @SystemApi
        public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE =
                "location_permissions_upgrade_to_q_mode";
        /**
         * Comma separated list of enabled overlay packages for all android.theme.customization.*
+4 −0
Original line number Diff line number Diff line
@@ -235,6 +235,10 @@ message SecureSettingsProto {
        optional SettingProto mode = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
        // The App or module that changes the location mode.
        optional SettingProto changer = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];

        // What should happen to the location permissions when upgraded to Android Q.
        // 0 == revoke permissions. Anything else == do nothing.
        optional SettingProto permissions_upgrade_to_q_mode = 3 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional Location location = 31;

+1 −0
Original line number Diff line number Diff line
@@ -643,6 +643,7 @@ public class SettingsBackupTest {
                 Settings.Secure.LAST_SETUP_SHOWN,
                 Settings.Secure.LOCATION_CHANGER,
                 Settings.Secure.LOCATION_MODE,
                 Settings.Secure.LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE,
                 Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT, // Candidate?
                 Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT,
                 Settings.Secure.LOCK_TO_APP_EXIT_LOCKED,
+3 −0
Original line number Diff line number Diff line
@@ -1974,6 +1974,9 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Secure.LOCATION_CHANGER,
                SecureSettingsProto.Location.CHANGER);
        dumpSetting(s, p,
                Settings.Secure.LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE,
                SecureSettingsProto.Location.PERMISSIONS_UPGRADE_TO_Q_MODE);
        p.end(locationToken);

        final long locationAccessCheckToken = p.start(SecureSettingsProto.LOCATION_ACCESS_CHECK);
Loading