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

Commit 2777f0df authored by Nadav Bar's avatar Nadav Bar Committed by android-build-merger
Browse files

Merge "Use per user method when writing or reading Live Caption secure...

Merge "Use per user method when writing or reading Live Caption secure setting" into qt-r1-dev am: 5191f057 am: e1fc69e1
am: 603cf820

Change-Id: I8092d110d6358758c7c00f55e4848f7a2caca658
parents af0279c9 603cf820
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import android.os.Looper;
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;
@@ -275,14 +276,14 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
    }

    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