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

Commit ccade402 authored by Alex Chau's avatar Alex Chau
Browse files

Enforce Keyguard policy in Notification Settings

- Applied getKeyguardDisabledFeatures for notification settings and
    notification setup page (after settings a screenlock)
- If a notification settings is disabled, the next least secure setting
    will be chosen
- Although KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS can be set be
    profile, it will not be reflected in both settings page. This is
    because it does not affect the owner (user 0), as mentioned in
    DevicePolicyManagerService.PROFILE_KEYGUARD_FEATURES_AFFECT_OWNER
- Skip RedactionInterstitial if there is <= 1 options for the user
- Tested with both Setup wizard and settings case, both pattern and
    password, as well as toggling the policy on and off

Bug: 19307118
Bug: 17099898

Change-Id: If640d5576caa0163e9942569f7b4643a30bbfe0a
parent 2c55f738
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
            android:textAppearance="?android:attr/textAppearanceMedium" />

    <RadioGroup
            android:id="@+id/radio_group"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/redaction_vertical_margins"
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
            android:text="@string/lock_screen_notifications_interstitial_message" />

        <RadioGroup
            android:id="@+id/radio_group"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/redaction_vertical_margins"
+4 −1
Original line number Diff line number Diff line
@@ -559,7 +559,10 @@ public class ChooseLockPassword extends SettingsActivity {
            getActivity().finish();
            mDone = true;
            if (!wasSecureBefore) {
                startActivity(getRedactionInterstitialIntent(getActivity()));
                Intent intent = getRedactionInterstitialIntent(getActivity());
                if (intent != null) {
                    startActivity(intent);
                }
            }
        }

+8 −2
Original line number Diff line number Diff line
@@ -641,7 +641,10 @@ public class ChooseLockPattern extends SettingsActivity {
                startVerifyPattern(utils, wasSecureBefore);
            } else {
                if (!wasSecureBefore) {
                    startActivity(getRedactionInterstitialIntent(getActivity()));
                    Intent intent = getRedactionInterstitialIntent(getActivity());
                    if (intent != null) {
                        startActivity(intent);
                    }
                }
                getActivity().setResult(RESULT_FINISHED);
                doFinish();
@@ -670,7 +673,10 @@ public class ChooseLockPattern extends SettingsActivity {
                            mPendingLockCheck = null;

                            if (!wasSecureBefore) {
                                startActivity(getRedactionInterstitialIntent(getActivity()));
                                Intent intent = getRedactionInterstitialIntent(getActivity());
                                if (intent != null) {
                                    startActivity(intent);
                                }
                            }

                            Intent intent = new Intent();
+4 −0
Original line number Diff line number Diff line
@@ -126,6 +126,10 @@ public class DropDownPreference extends Preference {
        mValues.add(value);
    }

    public int getItemCount() {
        return mAdapter.getCount();
    }

    public void clearItems(){
        mAdapter.clear();
        mValues.clear();
Loading