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

Commit eef7185b authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "Added Settings for Quick unlock option"

parents 1a093cb4 4d0342f0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -181,6 +181,8 @@
    <string name="pref_trackball_unlock_summary">Pressing the trackball unlocks the device</string>
    <string name="pref_menu_unlock_title">Menu unlock</string>
    <string name="pref_menu_unlock_summary">Pressing the menu button unlocks the device</string>
    <string name="pref_lockscreen_quick_unlock_control_title">Quick Unlock</string>
    <string name="pref_lockscreen_quick_unlock_control_summary">No need to press OK when entering Pin or Password. Delete counts as bad try.</string>


    <!-- Long Press Home -->
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
            android:dependency="lockscreen_music_controls"
            android:title="@string/pref_lockscreen_always_music_controls_title" 
            android:summary="@string/pref_lockscreen_always_music_controls_summary" />
        <CheckBoxPreference android:key="lockscreen_quick_unlock_control"
            android:title="@string/pref_lockscreen_quick_unlock_control_title" android:summary="@string/pref_lockscreen_quick_unlock_control_summary" />
    </PreferenceCategory>

    <PreferenceCategory android:title="@string/button_settings_title" android:key="pref_category_button_settings">
+13 −0
Original line number Diff line number Diff line
@@ -18,12 +18,14 @@ public class InputActivity extends PreferenceActivity {
    private static final String TRACKBALL_UNLOCK_PREF = "pref_trackball_unlock";
    private static final String MENU_UNLOCK_PREF = "pref_menu_unlock";
    private static final String BUTTON_CATEGORY = "pref_category_button_settings";
    private static final String LOCKSCREEN_QUICK_UNLOCK_CONTROL = "lockscreen_quick_unlock_control";
    
    private CheckBoxPreference mMusicControlPref;
    private CheckBoxPreference mAlwaysMusicControlPref;
    private CheckBoxPreference mTrackballWakePref;
    private CheckBoxPreference mTrackballUnlockPref;
    private CheckBoxPreference mMenuUnlockPref;
    private CheckBoxPreference mQuickUnlockScreenPref;

    @Override
    public void onCreate(Bundle savedInstanceState) {
@@ -44,6 +46,12 @@ public class InputActivity extends PreferenceActivity {
        mAlwaysMusicControlPref.setChecked(Settings.System.getInt(getContentResolver(), 
                Settings.System.LOCKSCREEN_ALWAYS_MUSIC_CONTROLS, 0) == 1);

        /* Quick Unlock Screen Control */
        mQuickUnlockScreenPref = (CheckBoxPreference)
                prefSet.findPreference(LOCKSCREEN_QUICK_UNLOCK_CONTROL);
        mQuickUnlockScreenPref.setChecked(Settings.System.getInt(getContentResolver(),
                Settings.System.LOCKSCREEN_QUICK_UNLOCK_CONTROL, 0) == 1);

        /* Trackball Wake */
        mTrackballWakePref = (CheckBoxPreference) prefSet.findPreference(TRACKBALL_WAKE_PREF);
        mTrackballWakePref.setChecked(Settings.System.getInt(getContentResolver(), 
@@ -78,6 +86,11 @@ public class InputActivity extends PreferenceActivity {
            Settings.System.putInt(getContentResolver(),
                    Settings.System.LOCKSCREEN_ALWAYS_MUSIC_CONTROLS, value ? 1 : 0);
            return true;
        } else if (preference == mQuickUnlockScreenPref) {
            value = mQuickUnlockScreenPref.isChecked();
            Settings.System.putInt(getContentResolver(),
                    Settings.System.LOCKSCREEN_QUICK_UNLOCK_CONTROL, value ? 1 : 0);
            return true;
        } else if (preference == mTrackballWakePref) {
            value = mTrackballWakePref.isChecked();
            Settings.System.putInt(getContentResolver(),