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

Commit 29d59dd2 authored by Ricky Wai's avatar Ricky Wai Committed by Android (Google) Code Review
Browse files

Merge "Force to unlock work challenge before reply inline notification" into nyc-dev

parents 1932aa95 9b753da2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -241,6 +241,8 @@ public class ConfigureNotificationSettings extends SettingsPreferenceFragment {

        mLockscreenProfile.setEntries(entries.toArray(new CharSequence[entries.size()]));
        mLockscreenProfile.setEntryValues(values.toArray(new CharSequence[values.size()]));
        // Work profile does not support this settings as we do not have a policy to enforce it yet
        mLockscreenProfile.setRemoteInputCheckBoxEnabled(false);
        updateLockscreenNotificationsForProfile();
        if (mLockscreenProfile.getEntries().length > 1) {
            mLockscreenProfile.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
+9 −2
Original line number Diff line number Diff line
@@ -37,11 +37,16 @@ public class NotificationLockscreenPreference extends RestrictedListPreference {
    private int mInitialIndex;
    private Listener mListener;
    private boolean mShowRemoteInput;
    private boolean mRemoteInputCheckBoxEnabled = true;

    public NotificationLockscreenPreference(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public void setRemoteInputCheckBoxEnabled(boolean enabled) {
        mRemoteInputCheckBoxEnabled = enabled;
    }

    @Override
    protected void onPrepareDialogBuilder(AlertDialog.Builder builder,
            DialogInterface.OnClickListener innerListener) {
@@ -85,8 +90,10 @@ public class NotificationLockscreenPreference extends RestrictedListPreference {
        return false;
    }

    private static int checkboxVisibilityForSelectedIndex(int selected, boolean showRemoteAtAll) {
        return selected == 1 && showRemoteAtAll ? View.VISIBLE : View.GONE;
    private int checkboxVisibilityForSelectedIndex(int selected,
            boolean showRemoteAtAll) {
        return selected == 1 && showRemoteAtAll && mRemoteInputCheckBoxEnabled ? View.VISIBLE
                : View.GONE;
    }

    private class Listener implements DialogInterface.OnClickListener,
+4 −1
Original line number Diff line number Diff line
@@ -186,7 +186,10 @@ public class RedactionInterstitial extends SettingsActivity {

        private void updateRemoteInputCheckboxVisibility() {
            boolean visible = mRadioGroup.getCheckedRadioButtonId() == R.id.show_all;
            mRemoteInputCheckbox.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
            boolean isManagedProfile = Utils.isManagedProfile(UserManager.get(getPrefContext()),
                    mUserId);
            mRemoteInputCheckbox
                    .setVisibility((visible && !isManagedProfile) ? View.VISIBLE : View.INVISIBLE);
        }
    }
}