Add navigation mode to Settings.Secure
Bug: 132443163
Test: builds
Change-Id: I90c3fd843dc111ca6fcd7f618f01c321fd055f83
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index c94ee0e..636808e 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -2086,6 +2086,10 @@
Settings.Secure.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);
dumpSetting(s, p,
Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java
index 6e56854..805a6e5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java
@@ -33,6 +33,8 @@
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
+import android.provider.Settings;
+import android.provider.Settings.Secure;
import android.util.Log;
import android.util.SparseBooleanArray;
@@ -150,6 +152,10 @@
mCurrentUserContext = getCurrentUserContext();
int mode = getCurrentInteractionMode(mCurrentUserContext);
mMode = mode;
+ mUiOffloadThread.submit(() -> {
+ Settings.Secure.putString(mCurrentUserContext.getContentResolver(),
+ Secure.NAVIGATION_MODE, String.valueOf(mode));
+ });
if (DEBUG) {
Log.e(TAG, "updateCurrentInteractionMode: mode=" + mMode
+ " contextUser=" + mCurrentUserContext.getUserId());