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

Commit 4df38aa2 authored by Dan Sandler's avatar Dan Sandler
Browse files

Back up and restore Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS.

This setting tracks whether the user has seen the "immersive
mode cling" (see ImmersiveModeConfirmation.java):

   Viewing full screen
   To exit, swipe down from the top.

Because this setting has never been backed up, the cling has
reappeared for every user the first time they invoke a
fullscreen activity on a new device.

After this change, each user will only see this dialog once,
ever, as long as they are restoring from a backup.

Manual testing instructions:

    1. invoke a full screen activity so you can acknowledge
       the cling. this will do:
       $ adb shell am start -n android/com.android.internal.app.PlatLogoActivity
       $ adb shell settings get secure immersive_mode_confirmations
       -> confirmed
    2. force a backup (after logging in to a Google account):
       $ adb shell bmgr backupnow com.android.providers.settings
    3. delete the key:
       $ adb shell settings delete secure immersive_mode_confirmations
       $ adb shell settings get secure immersive_mode_confirmations
       -> null
    4. find your backup set token:
       $ adb shell bmgr list sets
       -> abcd1234 : Nexus 5
    5. force a restore:
       $ adb shell bmgr restore abcd1234 com.android.providers.settings
    6. confirm that the key came back:
       $ adb shell settings get secure immersive_mode_confirmations
       -> confirmed

Bug: 328507468
Test: atest SettingsBackupTest
Flag: n/a for this kind of change
Change-Id: I637d8ecfb60ed3986a60c142aa40ad8d38c53e76
parent 94e78278
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -268,6 +268,7 @@ public class SecureSettings {
        Settings.Secure.EVEN_DIMMER_MIN_NITS,
        Settings.Secure.STYLUS_POINTER_ICON_ENABLED,
        Settings.Secure.CAMERA_EXTENSIONS_FALLBACK,
        Settings.Secure.VISUAL_QUERY_ACCESSIBILITY_DETECTION_ENABLED
        Settings.Secure.VISUAL_QUERY_ACCESSIBILITY_DETECTION_ENABLED,
        Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS
    };
}
+1 −0
Original line number Diff line number Diff line
@@ -423,5 +423,6 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.AUTOFILL_SERVICE, AUTOFILL_SERVICE_VALIDATOR);
        VALIDATORS.put(Secure.STYLUS_POINTER_ICON_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.CAMERA_EXTENSIONS_FALLBACK, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.IMMERSIVE_MODE_CONFIRMATIONS, ANY_STRING_VALIDATOR);
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -702,7 +702,6 @@ public class SettingsBackupTest {
                 Settings.Secure.ENABLED_PRINT_SERVICES,
                 Settings.Secure.GLOBAL_ACTIONS_PANEL_AVAILABLE,
                 Settings.Secure.GLOBAL_ACTIONS_PANEL_DEBUG_ENABLED,
                 Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS,
                 Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR,
                 Settings.Secure.INPUT_METHOD_SELECTOR_VISIBILITY,
                 Settings.Secure.INPUT_METHODS_SUBTYPE_HISTORY,