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

Commit eec56731 authored by Govinda Wasserman's avatar Govinda Wasserman
Browse files

Adds Assistant Handles learning state to backed up settings

This solves the issue where the device would forget the learned state
when restoring from a backup.

Test: Tested locally
BUG: 159807978
Change-Id: Ia1d5926621c4b45402036aaf06cbab19c12869bd
parent 34990bab
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
@@ -9077,6 +9077,22 @@ public final class Settings {
                ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
                ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES
        };
        };
        /**
         * How long Assistant handles have enabled in milliseconds.
         *
         * @hide
         */
        public static final String ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS =
                "reminder_exp_learning_time_elapsed";
        /**
         * How many times the Assistant has been triggered using the touch gesture.
         *
         * @hide
         */
        public static final String ASSIST_HANDLES_LEARNING_EVENT_COUNT =
                "reminder_exp_learning_event_count";
        /**
        /**
         * These entries are considered common between the personal and the managed profile,
         * These entries are considered common between the personal and the managed profile,
         * since the managed profile doesn't get to change them.
         * since the managed profile doesn't get to change them.
+9 −1
Original line number Original line Diff line number Diff line
@@ -120,6 +120,14 @@ message SecureSettingsProto {
    }
    }
    optional Assist assist = 7;
    optional Assist assist = 7;


    message AssistHandles {
        option (android.msg_privacy).dest = DEST_EXPLICIT;

        optional SettingProto learning_time_elapsed_millis = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
        optional SettingProto learning_event_count = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional AssistHandles assist_handles = 86;

    message Autofill {
    message Autofill {
        option (android.msg_privacy).dest = DEST_EXPLICIT;
        option (android.msg_privacy).dest = DEST_EXPLICIT;


@@ -617,5 +625,5 @@ message SecureSettingsProto {


    // Please insert fields in alphabetical order and group them into messages
    // Please insert fields in alphabetical order and group them into messages
    // if possible (to avoid reaching the method limit).
    // if possible (to avoid reaching the method limit).
    // Next tag = 86;
    // Next tag = 87;
}
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -175,6 +175,8 @@ public class SecureSettings {
        Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED,
        Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED,
        Settings.Secure.PANIC_GESTURE_ENABLED,
        Settings.Secure.PANIC_GESTURE_ENABLED,
        Settings.Secure.PANIC_SOUND_ENABLED,
        Settings.Secure.PANIC_SOUND_ENABLED,
        Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED
        Settings.Secure.ADAPTIVE_CONNECTIVITY_ENABLED,
        Settings.Secure.ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS,
        Settings.Secure.ASSIST_HANDLES_LEARNING_EVENT_COUNT
    };
    };
}
}
+3 −0
Original line number Original line Diff line number Diff line
@@ -264,5 +264,8 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.PANIC_GESTURE_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.PANIC_GESTURE_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.PANIC_SOUND_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.PANIC_SOUND_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.ADAPTIVE_CONNECTIVITY_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.ADAPTIVE_CONNECTIVITY_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(
                Secure.ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS, NONE_NEGATIVE_LONG_VALIDATOR);
        VALIDATORS.put(Secure.ASSIST_HANDLES_LEARNING_EVENT_COUNT, NON_NEGATIVE_INTEGER_VALIDATOR);
    }
    }
}
}
+9 −0
Original line number Original line Diff line number Diff line
@@ -1875,6 +1875,15 @@ class SettingsProtoDumpUtil {
                SecureSettingsProto.Assist.GESTURE_SETUP_COMPLETE);
                SecureSettingsProto.Assist.GESTURE_SETUP_COMPLETE);
        p.end(assistToken);
        p.end(assistToken);


        final long assistHandlesToken = p.start(SecureSettingsProto.ASSIST_HANDLES);
        dumpSetting(s, p,
                Settings.Secure.ASSIST_HANDLES_LEARNING_TIME_ELAPSED_MILLIS,
                SecureSettingsProto.AssistHandles.LEARNING_TIME_ELAPSED_MILLIS);
        dumpSetting(s, p,
                Settings.Secure.ASSIST_HANDLES_LEARNING_EVENT_COUNT,
                SecureSettingsProto.AssistHandles.LEARNING_EVENT_COUNT);
        p.end(assistHandlesToken);

        final long autofillToken = p.start(SecureSettingsProto.AUTOFILL);
        final long autofillToken = p.start(SecureSettingsProto.AUTOFILL);
        dumpSetting(s, p,
        dumpSetting(s, p,
                Settings.Secure.AUTOFILL_SERVICE,
                Settings.Secure.AUTOFILL_SERVICE,
Loading