Use per user method when writing or reading Live Caption secure setting
Change-Id: Ib86af1a84f0791b8779dae96afd948eabbcf770e
Bug: 138493870.
Test: Manually.
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
index 69d2e31..d3862b6 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
@@ -43,6 +43,7 @@
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.UserHandle;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.provider.Settings;
@@ -272,14 +273,14 @@
}
public boolean areCaptionsEnabled() {
- int currentValue = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.ODI_CAPTIONS_ENABLED, 0);
+ int currentValue = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ODI_CAPTIONS_ENABLED, 0, UserHandle.USER_CURRENT);
return currentValue == 1;
}
public void setCaptionsEnabled(boolean isEnabled) {
- Settings.Secure.putInt(mContext.getContentResolver(),
- Settings.Secure.ODI_CAPTIONS_ENABLED, isEnabled ? 1 : 0);
+ Settings.Secure.putIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ODI_CAPTIONS_ENABLED, isEnabled ? 1 : 0, UserHandle.USER_CURRENT);
}
@Override