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

Commit 6934a044 authored by Clara Bayarri's avatar Clara Bayarri
Browse files

Work Profile Passphrase Setting

Create a new section in Security Settings which includes all
settings for the Work Challenge.
Only some settings apply to the Work Challenge, so we reuse
the security settings layouts for items and compare them against
a whitelist to remove unwanted items.

Additionally, remove all usages of ChooseLockGeneric.KEY_USER_ID
in favor of Intent.EXTRA_USER_ID.

Change-Id: I3d1ba953a2056f7c61a7b3feeb8b49f1a352dff6
parent 00683f9d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3015,6 +3015,12 @@
    <!-- Displayed when user launches a widget configuration activity that was uninstalled -->
    <string name="activity_not_found">Application is not installed on your phone.</string>

    <!-- Profile Lock settings -->
    <!-- Security & location settings screen, header for profile specific section -->
    <string name="lock_settings_profile_title">Work profile</string>
    <!-- Security & location settings screen, setting option name -->
    <string name="lock_settings_profile_label">Work profile security</string>

    <!-- Applications Settings --> <skip />
    <!-- Applications settings screen, setting option name for the user to go to the screen to manage installed applications  -->
    <string name="manageapplications_settings_title">Manage apps</string>
@@ -5562,6 +5568,7 @@
    <string name="keywords_ignore_optimizations">ignore optimizations, doze, app standby</string>
    <string name="keywords_color_mode">vibrant, RGB, sRGB, color, natural, standard</string>
    <string name="keywords_lockscreen">slide to unlock, password, pattern, PIN</string>
    <string name="keywords_profile_challenge">work challenge, work, profile</string>

    <!-- NFC Wi-Fi pairing/setup strings-->

+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source 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.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
        android:title="@string/lock_settings_profile_label">

</PreferenceScreen>
+33 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source 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.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
                  android:title="@string/lock_settings_picker_title">

    <PreferenceCategory
        android:key="security_category_profile"
        android:title="@string/lock_settings_profile_title">

        <PreferenceScreen
            android:key="profile_challenge"
            android:title="@string/lock_settings_profile_label"
            settings:keywords="@string/keywords_profile_challenge"
            android:persistent="false"/>

    </PreferenceCategory>

</PreferenceScreen>
+4 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ import com.android.internal.widget.LockPatternUtils;

public class ChooseLockGeneric extends SettingsActivity {
    public static final String CONFIRM_CREDENTIALS = "confirm_credentials";
    public static final String KEY_USER_ID = "user_id";

    @Override
    public Intent getIntent() {
@@ -369,6 +368,10 @@ public class ChooseLockGeneric extends SettingsActivity {
                            visible = false;
                        }
                    } else if (KEY_UNLOCK_SET_NONE.equals(key)) {
                        if (mUserId != UserHandle.myUserId()) {
                            // Swipe doesn't make sense for profiles.
                            visible = false;
                        }
                        enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED;
                    } else if (KEY_UNLOCK_SET_PATTERN.equals(key)) {
                        enabled = quality <= DevicePolicyManager.PASSWORD_QUALITY_SOMETHING;
+3 −3
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ public class ChooseLockPassword extends SettingsActivity {
            boolean confirmCredentials, int userId) {
        Intent intent = createIntent(context, quality, minLength, maxLength,
                requirePasswordToDecrypt, confirmCredentials);
        intent.putExtra(ChooseLockGeneric.KEY_USER_ID, userId);
        intent.putExtra(Intent.EXTRA_USER_ID, userId);
        return intent;
    }

@@ -103,7 +103,7 @@ public class ChooseLockPassword extends SettingsActivity {
            int maxLength, boolean requirePasswordToDecrypt, String password, int userId) {
        Intent intent = createIntent(context, quality, minLength, maxLength,
                requirePasswordToDecrypt, password);
        intent.putExtra(ChooseLockGeneric.KEY_USER_ID, userId);
        intent.putExtra(Intent.EXTRA_USER_ID, userId);
        return intent;
    }

@@ -120,7 +120,7 @@ public class ChooseLockPassword extends SettingsActivity {
            int maxLength, boolean requirePasswordToDecrypt, long challenge, int userId) {
        Intent intent = createIntent(context, quality, minLength, maxLength,
                requirePasswordToDecrypt, challenge);
        intent.putExtra(ChooseLockGeneric.KEY_USER_ID, userId);
        intent.putExtra(Intent.EXTRA_USER_ID, userId);
        return intent;
    }

Loading