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

Commit 2646300e authored by Kevin Chyn's avatar Kevin Chyn Committed by android-build-merger
Browse files

Merge "Cache attention toggle in settings" into qt-dev

am: 13c1c27b

Change-Id: If7add23abcfcbdbe77886d7d7716763f91008df7
parents 29870ede 13c1c27b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.hardware.face.FaceManager;
import android.hardware.face.FaceManager.GetFeatureCallback;
import android.hardware.face.FaceManager.SetFeatureCallback;
import android.provider.Settings;

import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
@@ -46,6 +47,10 @@ public class FaceSettingsAttentionPreferenceController extends FaceSettingsPrefe
                mPreference.setEnabled(true);
                if (!success) {
                    mPreference.setChecked(!mPreference.isChecked());
                } else {
                    Settings.Secure.putIntForUser(mContext.getContentResolver(),
                            Settings.Secure.FACE_UNLOCK_ATTENTION_REQUIRED,
                            mPreference.isChecked() ? 1 : 0, getUserId());
                }
            }
        }