Merge "Use per user method when writing or reading Live Caption secure setting" into qt-r1-dev
am: 5191f05791
Change-Id: I0af6985b222d5cc3608e568dd5ed1b6a007cbd2c
This commit is contained in:
@@ -43,6 +43,7 @@ import android.os.Looper;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
|
import android.os.UserHandle;
|
||||||
import android.os.VibrationEffect;
|
import android.os.VibrationEffect;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
@@ -272,14 +273,14 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean areCaptionsEnabled() {
|
public boolean areCaptionsEnabled() {
|
||||||
int currentValue = Settings.Secure.getInt(mContext.getContentResolver(),
|
int currentValue = Settings.Secure.getIntForUser(mContext.getContentResolver(),
|
||||||
Settings.Secure.ODI_CAPTIONS_ENABLED, 0);
|
Settings.Secure.ODI_CAPTIONS_ENABLED, 0, UserHandle.USER_CURRENT);
|
||||||
return currentValue == 1;
|
return currentValue == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCaptionsEnabled(boolean isEnabled) {
|
public void setCaptionsEnabled(boolean isEnabled) {
|
||||||
Settings.Secure.putInt(mContext.getContentResolver(),
|
Settings.Secure.putIntForUser(mContext.getContentResolver(),
|
||||||
Settings.Secure.ODI_CAPTIONS_ENABLED, isEnabled ? 1 : 0);
|
Settings.Secure.ODI_CAPTIONS_ENABLED, isEnabled ? 1 : 0, UserHandle.USER_CURRENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user