Merge "Add navigation mode to Settings.Secure" into qt-dev
am: eada1380b1
Change-Id: I2744f94b7a4e25bba5726e1d6b097dbc19040789
This commit is contained in:
@@ -8829,6 +8829,18 @@ public final class Settings {
|
|||||||
private static final Validator THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR =
|
private static final Validator THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR =
|
||||||
SettingsValidators.JSON_OBJECT_VALIDATOR;
|
SettingsValidators.JSON_OBJECT_VALIDATOR;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation bar mode.
|
||||||
|
* 0 = 3 button
|
||||||
|
* 1 = 2 button
|
||||||
|
* 2 = fully gestural
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final String NAVIGATION_MODE =
|
||||||
|
"navigation_mode";
|
||||||
|
private static final Validator NAVIGATION_MODE_VALIDATOR =
|
||||||
|
new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1", "2"});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls whether aware is enabled.
|
* Controls whether aware is enabled.
|
||||||
* @hide
|
* @hide
|
||||||
@@ -8972,6 +8984,7 @@ public final class Settings {
|
|||||||
SKIP_GESTURE,
|
SKIP_GESTURE,
|
||||||
SILENCE_GESTURE,
|
SILENCE_GESTURE,
|
||||||
THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
|
THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
|
||||||
|
NAVIGATION_MODE,
|
||||||
AWARE_ENABLED,
|
AWARE_ENABLED,
|
||||||
SKIP_GESTURE_COUNT,
|
SKIP_GESTURE_COUNT,
|
||||||
SILENCE_ALARMS_GESTURE_COUNT,
|
SILENCE_ALARMS_GESTURE_COUNT,
|
||||||
@@ -9157,6 +9170,7 @@ public final class Settings {
|
|||||||
VALIDATORS.put(SILENCE_GESTURE, SILENCE_GESTURE_VALIDATOR);
|
VALIDATORS.put(SILENCE_GESTURE, SILENCE_GESTURE_VALIDATOR);
|
||||||
VALIDATORS.put(THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
|
VALIDATORS.put(THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
|
||||||
THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR);
|
THEME_CUSTOMIZATION_OVERLAY_PACKAGES_VALIDATOR);
|
||||||
|
VALIDATORS.put(NAVIGATION_MODE, NAVIGATION_MODE_VALIDATOR);
|
||||||
VALIDATORS.put(AWARE_ENABLED, AWARE_ENABLED_VALIDATOR);
|
VALIDATORS.put(AWARE_ENABLED, AWARE_ENABLED_VALIDATOR);
|
||||||
VALIDATORS.put(SKIP_GESTURE_COUNT, SKIP_GESTURE_COUNT_VALIDATOR);
|
VALIDATORS.put(SKIP_GESTURE_COUNT, SKIP_GESTURE_COUNT_VALIDATOR);
|
||||||
VALIDATORS.put(SILENCE_ALARMS_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
|
VALIDATORS.put(SILENCE_ALARMS_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ message SecureSettingsProto {
|
|||||||
|
|
||||||
optional SettingProto multi_press_timeout = 38 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
optional SettingProto multi_press_timeout = 38 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
||||||
|
|
||||||
|
optional SettingProto navigation_mode = 76 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
||||||
message NfcPayment {
|
message NfcPayment {
|
||||||
option (android.msg_privacy).dest = DEST_EXPLICIT;
|
option (android.msg_privacy).dest = DEST_EXPLICIT;
|
||||||
|
|
||||||
@@ -552,5 +553,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 = 76;
|
// Next tag = 77;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2086,6 +2086,10 @@ class SettingsProtoDumpUtil {
|
|||||||
Settings.Secure.MULTI_PRESS_TIMEOUT,
|
Settings.Secure.MULTI_PRESS_TIMEOUT,
|
||||||
SecureSettingsProto.MULTI_PRESS_TIMEOUT);
|
SecureSettingsProto.MULTI_PRESS_TIMEOUT);
|
||||||
|
|
||||||
|
dumpSetting(s, p,
|
||||||
|
Settings.Secure.NAVIGATION_MODE,
|
||||||
|
SecureSettingsProto.NAVIGATION_MODE);
|
||||||
|
|
||||||
final long nfcPaymentToken = p.start(SecureSettingsProto.NFC_PAYMENT);
|
final long nfcPaymentToken = p.start(SecureSettingsProto.NFC_PAYMENT);
|
||||||
dumpSetting(s, p,
|
dumpSetting(s, p,
|
||||||
Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT,
|
Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT,
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ import android.os.PatternMatcher;
|
|||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.provider.Settings.Secure;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.SparseBooleanArray;
|
import android.util.SparseBooleanArray;
|
||||||
|
|
||||||
@@ -167,6 +169,10 @@ public class NavigationModeController implements Dumpable {
|
|||||||
mCurrentUserContext = getCurrentUserContext();
|
mCurrentUserContext = getCurrentUserContext();
|
||||||
int mode = getCurrentInteractionMode(mCurrentUserContext);
|
int mode = getCurrentInteractionMode(mCurrentUserContext);
|
||||||
mMode = mode;
|
mMode = mode;
|
||||||
|
mUiOffloadThread.submit(() -> {
|
||||||
|
Settings.Secure.putString(mCurrentUserContext.getContentResolver(),
|
||||||
|
Secure.NAVIGATION_MODE, String.valueOf(mode));
|
||||||
|
});
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.e(TAG, "updateCurrentInteractionMode: mode=" + mMode
|
Log.e(TAG, "updateCurrentInteractionMode: mode=" + mMode
|
||||||
+ " contextUser=" + mCurrentUserContext.getUserId());
|
+ " contextUser=" + mCurrentUserContext.getUserId());
|
||||||
|
|||||||
Reference in New Issue
Block a user