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

Commit eb6daa80 authored by eray orçunus's avatar eray orçunus Committed by Sam Mortimer
Browse files

lockscreen: Forward port option to pass swipe-up-to-unlock



 * Adapt settings to Nougat SecuritySubSettings class
 * Interface switches in security_settings_*_sub.xml
 * Additional changes for dependencies
 * Cleanup the names to 'directly_show_lock'
 * Reorder the new preferences

lockscreen: Add option to pass swipe-up-to-unlock (2/3)

* Option appears on PIN,pattern and password methods
* User should press back button to see notifications, clock etc.
* Instantly hides keyguard if Smart Lock has unlocked phone.

CYNGNOS-1873
Change-Id: I31256770869b20842c69edb4a7a57b2bad7b3ea7
Signed-off-by: default avatareray orçunus <erayorcunus@gmail.com>
parent 736ecbfa
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2012-2016 The CyanogenMod Project
     Copyright (C) 2017      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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Whether the keyguard will directly show the password entry -->
    <string name="lock_directly_show_password">Directly show password entry</string>
    <string name="lock_directly_show_password_summary">Skip the swipe to unlock screen and immediately begin password entry</string>
    <!-- Whether the keyguard will directly show the pattern view -->
    <string name="lock_directly_show_pattern">Directly show pattern view</string>
    <string name="lock_directly_show_pattern_summary">Skip the swipe to unlock screen and immediately begin pattern entry</string>
    <!-- Whether the keyguard will directly show the PIN entry -->
    <string name="lock_directly_show_pin">Directly show PIN entry</string>
    <string name="lock_directly_show_pin_summary">Skip the swipe to unlock screen and immediately begin PIN entry</string>
</resources>
+6 −0
Original line number Diff line number Diff line
@@ -30,6 +30,12 @@
        android:key="power_button_instantly_locks"
        android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" />

    <SwitchPreference
        android:key="directly_show_lock"
        android:title="@string/lock_directly_show_password"
        android:summary="@string/lock_directly_show_password_summary"
        android:persistent="false" />

    <com.android.settingslib.RestrictedPreference
        android:key="owner_info_settings"
        android:title="@string/owner_info_settings_title"
+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,12 @@
        android:key="power_button_instantly_locks"
        android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" />

    <SwitchPreference
        android:key="directly_show_lock"
        android:title="@string/lock_directly_show_pattern"
        android:summary="@string/lock_directly_show_pattern_summary"
        android:persistent="false" />

    <com.android.settingslib.RestrictedPreference
        android:key="owner_info_settings"
        android:title="@string/owner_info_settings_title"
+6 −0
Original line number Diff line number Diff line
@@ -30,6 +30,12 @@
        android:key="power_button_instantly_locks"
        android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" />

    <SwitchPreference
        android:key="directly_show_lock"
        android:title="@string/lock_directly_show_pin"
        android:summary="@string/lock_directly_show_pin_summary"
        android:persistent="false" />

    <com.android.settingslib.RestrictedPreference
        android:key="owner_info_settings"
        android:title="@string/owner_info_settings_title"
+8 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@ import android.os.UserManager;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.widget.LockPatternUtils;

import org.lineageos.internal.util.LineageLockPatternUtils;

public final class ChooseLockSettingsHelper {

    static final String EXTRA_KEY_TYPE = "type";
@@ -40,12 +42,14 @@ public final class ChooseLockSettingsHelper {


    @VisibleForTesting LockPatternUtils mLockPatternUtils;
    private LineageLockPatternUtils mLineageLockPatternUtils;
    private Activity mActivity;
    private Fragment mFragment;

    public ChooseLockSettingsHelper(Activity activity) {
        mActivity = activity;
        mLockPatternUtils = new LockPatternUtils(activity);
        mLineageLockPatternUtils = new LineageLockPatternUtils(activity);
    }

    public ChooseLockSettingsHelper(Activity activity, Fragment fragment) {
@@ -57,6 +61,10 @@ public final class ChooseLockSettingsHelper {
        return mLockPatternUtils;
    }

    public LineageLockPatternUtils lineageUtils() {
        return mLineageLockPatternUtils;
    }

    /**
     * If a pattern, password or PIN exists, prompt the user before allowing them to change it.
     *
Loading