Loading res/values/cm_strings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,11 @@ <string name="status_bar_double_tap_to_sleep_title">Tap to sleep</string> <string name="status_bar_double_tap_to_sleep_summary">Double-tap on the status bar or lockscreen to turn off the display</string> <!-- Fingerprint wake-and-unlock --> <string name="fingerprint_wake_unlock_title">Touch fingerprint to unlock</string> <string name="fingerprint_wake_unlock_touch">Listens for events while the screen is off</string> <string name="fingerprint_wake_unlock_press">Only listens for events once the screen is on</string> <!-- High touch polling rate --> <string name="high_touch_polling_rate_title">High touch polling rate</string> <string name="high_touch_polling_rate_summary">Increase touchscreen polling rate</string> Loading res/xml/screen_lock_settings.xml +7 −0 Original line number Diff line number Diff line Loading @@ -54,4 +54,11 @@ android:title="@string/unlock_scramble_pin_layout_title" android:summary="@string/unlock_scramble_pin_layout_summary" /> <!-- Fingerprint wake-and-unlock toggle --> <SwitchPreference android:key="fingerprint_wake_unlock" android:title="@string/fingerprint_wake_unlock_title" android:summaryOn="@string/fingerprint_wake_unlock_touch" android:summaryOff="@string/fingerprint_wake_unlock_press" /> </PreferenceScreen> src/com/android/settings/security/screenlock/FingerprintUnlockPreferenceController.java 0 → 100644 +70 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.security.screenlock; import android.content.Context; import android.os.UserHandle; import androidx.preference.Preference; import androidx.preference.TwoStatePreference; import com.android.settings.core.PreferenceControllerMixin; import com.android.settingslib.core.AbstractPreferenceController; import lineageos.providers.LineageSettings; public class FingerprintUnlockPreferenceController extends AbstractPreferenceController implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener { static final String KEY_FINGERPRINT_WAKE_UNLOCK = "fingerprint_wake_unlock"; public FingerprintUnlockPreferenceController(Context context) { super(context); } private int getFingerprintSettings() { return LineageSettings.System.getIntForUser( mContext.getContentResolver(), LineageSettings.System.FINGERPRINT_WAKE_UNLOCK, 1, UserHandle.USER_CURRENT); } @Override public boolean isAvailable() { // Enable it for just powerbutton fps devices // Disable for devices config_fingerprintWakeAndUnlock set to false. return getFingerprintSettings() != 2 && mContext.getResources().getBoolean( com.android.internal.R.bool.config_is_powerbutton_fps); } @Override public String getPreferenceKey() { return KEY_FINGERPRINT_WAKE_UNLOCK; } @Override public void updateState(Preference preference) { ((TwoStatePreference) preference).setChecked(getFingerprintSettings() == 1); } @Override public boolean onPreferenceChange(Preference preference, Object newValue) { LineageSettings.System.putIntForUser(mContext.getContentResolver(), LineageSettings.System.FINGERPRINT_WAKE_UNLOCK, (Boolean) newValue ? 1 : 0, UserHandle.USER_CURRENT); return true; } } src/com/android/settings/security/screenlock/ScreenLockSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class ScreenLockSettings extends DashboardFragment context, MY_USER_ID, lockPatternUtils)); controllers.add(new PinScramblePreferenceController( context, MY_USER_ID, lockPatternUtils)); controllers.add(new FingerprintUnlockPreferenceController(context)); controllers.add(new OwnerInfoPreferenceController(context, parent)); return controllers; } Loading Loading
res/values/cm_strings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,11 @@ <string name="status_bar_double_tap_to_sleep_title">Tap to sleep</string> <string name="status_bar_double_tap_to_sleep_summary">Double-tap on the status bar or lockscreen to turn off the display</string> <!-- Fingerprint wake-and-unlock --> <string name="fingerprint_wake_unlock_title">Touch fingerprint to unlock</string> <string name="fingerprint_wake_unlock_touch">Listens for events while the screen is off</string> <string name="fingerprint_wake_unlock_press">Only listens for events once the screen is on</string> <!-- High touch polling rate --> <string name="high_touch_polling_rate_title">High touch polling rate</string> <string name="high_touch_polling_rate_summary">Increase touchscreen polling rate</string> Loading
res/xml/screen_lock_settings.xml +7 −0 Original line number Diff line number Diff line Loading @@ -54,4 +54,11 @@ android:title="@string/unlock_scramble_pin_layout_title" android:summary="@string/unlock_scramble_pin_layout_summary" /> <!-- Fingerprint wake-and-unlock toggle --> <SwitchPreference android:key="fingerprint_wake_unlock" android:title="@string/fingerprint_wake_unlock_title" android:summaryOn="@string/fingerprint_wake_unlock_touch" android:summaryOff="@string/fingerprint_wake_unlock_press" /> </PreferenceScreen>
src/com/android/settings/security/screenlock/FingerprintUnlockPreferenceController.java 0 → 100644 +70 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settings.security.screenlock; import android.content.Context; import android.os.UserHandle; import androidx.preference.Preference; import androidx.preference.TwoStatePreference; import com.android.settings.core.PreferenceControllerMixin; import com.android.settingslib.core.AbstractPreferenceController; import lineageos.providers.LineageSettings; public class FingerprintUnlockPreferenceController extends AbstractPreferenceController implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener { static final String KEY_FINGERPRINT_WAKE_UNLOCK = "fingerprint_wake_unlock"; public FingerprintUnlockPreferenceController(Context context) { super(context); } private int getFingerprintSettings() { return LineageSettings.System.getIntForUser( mContext.getContentResolver(), LineageSettings.System.FINGERPRINT_WAKE_UNLOCK, 1, UserHandle.USER_CURRENT); } @Override public boolean isAvailable() { // Enable it for just powerbutton fps devices // Disable for devices config_fingerprintWakeAndUnlock set to false. return getFingerprintSettings() != 2 && mContext.getResources().getBoolean( com.android.internal.R.bool.config_is_powerbutton_fps); } @Override public String getPreferenceKey() { return KEY_FINGERPRINT_WAKE_UNLOCK; } @Override public void updateState(Preference preference) { ((TwoStatePreference) preference).setChecked(getFingerprintSettings() == 1); } @Override public boolean onPreferenceChange(Preference preference, Object newValue) { LineageSettings.System.putIntForUser(mContext.getContentResolver(), LineageSettings.System.FINGERPRINT_WAKE_UNLOCK, (Boolean) newValue ? 1 : 0, UserHandle.USER_CURRENT); return true; } }
src/com/android/settings/security/screenlock/ScreenLockSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ public class ScreenLockSettings extends DashboardFragment context, MY_USER_ID, lockPatternUtils)); controllers.add(new PinScramblePreferenceController( context, MY_USER_ID, lockPatternUtils)); controllers.add(new FingerprintUnlockPreferenceController(context)); controllers.add(new OwnerInfoPreferenceController(context, parent)); return controllers; } Loading