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

Commit 4bf4642a authored by Roman Birg's avatar Roman Birg Committed by Gerrit Code Review
Browse files

Settings: use new LockSettings



Ref: CYNGNOS-620
Change-Id: I8f65f2ebf116aeda8ba1b8e60fae5eb20a725ef3
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent b1112330
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@

    <!-- Profile lock mode summaries. Do not translate. -->
    <string-array name="profile_lockmode_entries" translatable="false">
        <item>@string/profile_action_none</item>
        <item>@string/profile_action_system</item>
        <item>@string/profile_lockmode_insecure_summary</item>
        <item>@string/profile_lockmode_disabled_summary</item>
    </string-array>
+1 −0
Original line number Diff line number Diff line
@@ -634,6 +634,7 @@
    <string name="profile_menu_delete_title">Delete</string>

    <string name="profile_action_none">Leave unchanged</string>
    <string name="profile_action_system">System default</string>
    <string name="profile_action_disable">Turn off</string>
    <string name="profile_action_enable">Turn on</string>

+3 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import cyanogenmod.profiles.BrightnessSettings;
import cyanogenmod.profiles.ConnectionSettings;
import android.app.Dialog;
import android.app.NotificationGroup;
import cyanogenmod.profiles.LockSettings;
import cyanogenmod.profiles.RingModeSettings;
import cyanogenmod.profiles.StreamSettings;
import android.app.admin.DevicePolicyManager;
@@ -589,7 +590,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment

        int defaultIndex = 0; // no action
        for (int i = 0; i < LOCKMODE_MAPPING.length; i++) {
            if (LOCKMODE_MAPPING[i] == mProfile.getScreenLockMode()) {
            if (LOCKMODE_MAPPING[i] == mProfile.getScreenLockMode().getValue()) {
                defaultIndex = i;
                break;
            }
@@ -600,7 +601,7 @@ public class SetupActionsFragment extends SettingsPreferenceFragment
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int item) {
                        mProfile.setScreenLockMode(LOCKMODE_MAPPING[item]);
                        mProfile.setScreenLockMode(new LockSettings(LOCKMODE_MAPPING[item]));
                        updateProfile();
                        mAdapter.notifyDataSetChanged();
                        dialog.dismiss();
+2 −2
Original line number Diff line number Diff line
@@ -62,9 +62,9 @@ public class LockModeItem implements Item {
    }

    public static int getSummaryString(Profile profile) {
        switch (profile.getScreenLockMode()) {
        switch (profile.getScreenLockMode().getValue()) {
            case Profile.LockMode.DEFAULT:
                return R.string.profile_action_none; //"leave unchanged"
                return R.string.profile_action_system; //"leave unchanged"
            case Profile.LockMode.DISABLE:
                return R.string.profile_lockmode_disabled_summary;
            case Profile.LockMode.INSECURE: