Merge "ShortcutManager: Remove developer option from NYC" into nyc-dev
diff --git a/res/layout/lockscreen_remote_input.xml b/res/layout/lockscreen_remote_input.xml
index af4bee0..1c565a3 100644
--- a/res/layout/lockscreen_remote_input.xml
+++ b/res/layout/lockscreen_remote_input.xml
@@ -15,14 +15,15 @@
   ~ limitations under the License
   -->
 
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
 
     <CheckBox
             android:id="@+id/lockscreen_remote_input"
-            android:layout_width="match_parent"
+            android:layout_width="0dp"
             android:layout_height="wrap_content"
+            android:layout_weight="1"
             android:layout_marginStart="20dp"
             android:paddingStart="20dp"
             android:paddingEnd="?android:attr/dialogPreferredPadding"
@@ -32,4 +33,13 @@
             android:gravity="center_vertical"
             android:text="@string/lockscreen_remote_input"
         />
-</FrameLayout>
\ No newline at end of file
+
+    <ImageView
+            android:id="@+id/restricted_lock_icon_remote_input"
+            android:layout_width="@dimen/restricted_icon_size"
+            android:layout_height="@dimen/restricted_icon_size"
+            android:src="@drawable/ic_info"
+            android:layout_marginEnd="?android:attr/dialogPreferredPadding"
+            android:layout_gravity="center_vertical"
+            android:scaleType="centerInside" />
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/redaction_interstitial.xml b/res/layout/redaction_interstitial.xml
index f48b917..0c4273f 100644
--- a/res/layout/redaction_interstitial.xml
+++ b/res/layout/redaction_interstitial.xml
@@ -65,7 +65,7 @@
 
     </RadioGroup>
 
-    <CheckBox
+    <com.android.settings.RestrictedCheckBox
         android:id="@+id/lockscreen_remote_input"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
diff --git a/res/layout/setup_redaction_interstitial.xml b/res/layout/setup_redaction_interstitial.xml
index e0f2d94..40b4215 100644
--- a/res/layout/setup_redaction_interstitial.xml
+++ b/res/layout/setup_redaction_interstitial.xml
@@ -74,7 +74,7 @@
 
             <!-- Place the checkbox inside RadioGroup and use SuwRadioButton style instead of
                  SuwCheckBox style so that the checkbox and text is aligned with radio buttons. -->
-            <CheckBox
+            <com.android.settings.RestrictedRadioButton
                 android:id="@+id/lockscreen_remote_input"
                 style="@style/SuwRadioButton"
                 android:layout_width="wrap_content"
diff --git a/res/layout/wifi_dialog.xml b/res/layout/wifi_dialog.xml
index 44523f4..ceb7201 100644
--- a/res/layout/wifi_dialog.xml
+++ b/res/layout/wifi_dialog.xml
@@ -15,9 +15,10 @@
 -->
 
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-         android:layout_width="wrap_content"
-         android:layout_height="wrap_content"
-         android:fadeScrollbars="false">
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:fadeScrollbars="false"
+        android:scrollIndicators="top|bottom">
 
     <LinearLayout
             android:layout_width="match_parent"
@@ -71,7 +72,7 @@
                 <Spinner android:id="@+id/security"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        style="@style/wifi_item_content"
+                        style="@style/wifi_item_spinner"
                         android:prompt="@string/wifi_security"
                         android:entries="@array/wifi_security" />
             </LinearLayout>
@@ -103,7 +104,7 @@
                     <Spinner android:id="@+id/method"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            style="@style/wifi_item_content"
+                            style="@style/wifi_item_spinner"
                             android:prompt="@string/wifi_eap_method"
                             android:entries="@array/wifi_eap_method" />
                 </LinearLayout>
@@ -122,7 +123,7 @@
                     <Spinner android:id="@+id/phase2"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            style="@style/wifi_item_content"
+                            style="@style/wifi_item_spinner"
                             android:prompt="@string/please_select_phase2"
                             android:entries="@array/wifi_phase2_entries" />
                 </LinearLayout>
@@ -141,7 +142,7 @@
                     <Spinner android:id="@+id/ca_cert"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            style="@style/wifi_item_content"
+                            style="@style/wifi_item_spinner"
                             android:prompt="@string/wifi_eap_ca_cert" />
                 </LinearLayout>
 
@@ -201,7 +202,7 @@
                     <Spinner android:id="@+id/user_cert"
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
-                            style="@style/wifi_item_content"
+                            style="@style/wifi_item_spinner"
                             android:prompt="@string/wifi_eap_user_cert" />
                 </LinearLayout>
 
@@ -285,6 +286,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 style="@style/wifi_item"
+                android:paddingBottom="4dp"
                 android:visibility="gone">
             <CheckBox android:id="@+id/wifi_advanced_togglebox"
                     android:layout_width="match_parent"
@@ -314,7 +316,7 @@
                 <Spinner android:id="@+id/proxy_settings"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        style="@style/wifi_item_content"
+                        style="@style/wifi_item_spinner"
                         android:prompt="@string/proxy_settings_title"
                         android:entries="@array/wifi_proxy_settings" />
 
@@ -439,7 +441,7 @@
                 <Spinner android:id="@+id/ip_settings"
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
-                        style="@style/wifi_item_content"
+                        style="@style/wifi_item_spinner"
                         android:prompt="@string/wifi_ip_settings"
                         android:entries="@array/wifi_ip_settings" />
 
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 1cd5fbb..bfe2d1c 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -228,6 +228,10 @@
         <item name="android:textColor">?android:attr/textColorPrimary</item>
     </style>
 
+    <style name="wifi_item_spinner" parent="wifi_item_content">
+        <item name="android:minHeight">48dp</item>
+    </style>
+
     <style name="wifi_advanced_toggle" parent="wifi_item_content">
         <item name="android:background">@null</item>
         <item name="android:button">@null</item>
diff --git a/src/com/android/settings/EncryptionInterstitial.java b/src/com/android/settings/EncryptionInterstitial.java
index 89eba7c..e9e2a7c 100644
--- a/src/com/android/settings/EncryptionInterstitial.java
+++ b/src/com/android/settings/EncryptionInterstitial.java
@@ -24,16 +24,13 @@
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.Bundle;
-import android.os.UserHandle;
 import android.support.v7.preference.Preference;
 import android.util.Log;
 import android.view.LayoutInflater;
-import android.view.View;
 import android.view.accessibility.AccessibilityManager;
 import android.widget.TextView;
 
 import com.android.internal.logging.MetricsProto.MetricsEvent;
-import com.android.internal.widget.LockPatternUtils;
 
 import java.util.List;
 
@@ -78,6 +75,7 @@
         private Preference mDontRequirePasswordToDecrypt;
         private boolean mPasswordRequired;
         private Intent mUnlockMethodIntent;
+        private int mRequestedPasswordQuality;
 
         @Override
         protected int getMetricsCategory() {
@@ -99,12 +97,12 @@
             boolean forFingerprint = getActivity().getIntent().getBooleanExtra(
                     ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, false);
             Intent intent = getActivity().getIntent();
-            final int quality = intent.getIntExtra(EXTRA_PASSWORD_QUALITY, 0);
-            mUnlockMethodIntent = (Intent) intent.getParcelableExtra(EXTRA_UNLOCK_METHOD_INTENT);
+            mRequestedPasswordQuality = intent.getIntExtra(EXTRA_PASSWORD_QUALITY, 0);
+            mUnlockMethodIntent = intent.getParcelableExtra(EXTRA_UNLOCK_METHOD_INTENT);
             final int msgId;
             final int enableId;
             final int disableId;
-            switch (quality) {
+            switch (mRequestedPasswordQuality) {
                 case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
                     msgId = forFingerprint ?
                             R.string.encryption_interstitial_message_pattern_for_fingerprint :
@@ -188,11 +186,9 @@
         public Dialog onCreateDialog(int dialogId) {
             switch(dialogId) {
                 case ACCESSIBILITY_WARNING_DIALOG: {
-                    final int quality = new LockPatternUtils(getActivity())
-                            .getKeyguardStoredPasswordQuality(UserHandle.myUserId());
                     final int titleId;
                     final int messageId;
-                    switch (quality) {
+                    switch (mRequestedPasswordQuality) {
                         case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
                             titleId = R.string.encrypt_talkback_dialog_require_pattern;
                             messageId = R.string.encrypt_talkback_dialog_message_pattern;
diff --git a/src/com/android/settings/MonitoringCertInfoActivity.java b/src/com/android/settings/MonitoringCertInfoActivity.java
index 8ad9d83..2392397 100644
--- a/src/com/android/settings/MonitoringCertInfoActivity.java
+++ b/src/com/android/settings/MonitoringCertInfoActivity.java
@@ -60,7 +60,7 @@
 
         if (dpm.getProfileOwnerAsUser(mUserId) != null) {
             builder.setMessage(getResources().getQuantityString(R.plurals.ssl_ca_cert_info_message,
-                    numberOfCertificates, dpm.getProfileOwnerName()));
+                    numberOfCertificates, dpm.getProfileOwnerNameAsUser(mUserId)));
         } else if (dpm.getDeviceOwnerComponentOnCallingUser() != null) {
             builder.setMessage(getResources().getQuantityString(
                     R.plurals.ssl_ca_cert_info_message_device_owner, numberOfCertificates,
diff --git a/src/com/android/settings/RestrictedCheckBox.java b/src/com/android/settings/RestrictedCheckBox.java
new file mode 100644
index 0000000..476df29
--- /dev/null
+++ b/src/com/android/settings/RestrictedCheckBox.java
@@ -0,0 +1,75 @@
+/*
+ * 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
+ */
+
+package com.android.settings;
+
+import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+
+import android.content.Context;
+import android.graphics.PorterDuff;
+import android.util.AttributeSet;
+import android.widget.CheckBox;
+import android.widget.RadioButton;
+import android.widget.TextView;
+
+import com.android.settingslib.RestrictedLockUtils;
+
+/**
+ * A checkbox that can be restricted by device policy, in which case it shows a dialog explaining
+ * what component restricted it.
+ */
+public class RestrictedCheckBox extends CheckBox {
+    private Context mContext;
+    private boolean mDisabledByAdmin;
+    private EnforcedAdmin mEnforcedAdmin;
+
+    public RestrictedCheckBox(Context context) {
+        this(context, null);
+    }
+
+    public RestrictedCheckBox(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        mContext = context;
+    }
+
+    @Override
+    public boolean performClick() {
+        if (mDisabledByAdmin) {
+            RestrictedLockUtils.sendShowAdminSupportDetailsIntent(mContext, mEnforcedAdmin);
+            return true;
+        }
+        return super.performClick();
+    }
+
+    public void setDisabledByAdmin(EnforcedAdmin admin) {
+        final boolean disabled = (admin != null);
+        mEnforcedAdmin = admin;
+        if (mDisabledByAdmin != disabled) {
+            mDisabledByAdmin = disabled;
+            RestrictedLockUtils.setTextViewAsDisabledByAdmin(mContext, this, mDisabledByAdmin);
+            if (mDisabledByAdmin) {
+                getButtonDrawable().setColorFilter(mContext.getColor(R.color.disabled_text_color),
+                        PorterDuff.Mode.MULTIPLY);
+            } else {
+                getButtonDrawable().clearColorFilter();
+            }
+        }
+    }
+
+    public boolean isDisabledByAdmin() {
+        return mDisabledByAdmin;
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 72dacd5..d96f459 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -1213,6 +1213,7 @@
                 } catch (NumberFormatException e) {
                     Log.e("SecuritySettings", "could not persist lockAfter timeout setting", e);
                 }
+                setupLockAfterPreference();
                 updateLockAfterPreferenceSummary();
             } else if (KEY_VISIBLE_PATTERN.equals(key)) {
                 mLockPatternUtils.setVisiblePatternEnabled((Boolean) value, MY_USER_ID);
diff --git a/src/com/android/settings/dashboard/DashboardAdapter.java b/src/com/android/settings/dashboard/DashboardAdapter.java
index 3fb413a..c54311a 100644
--- a/src/com/android/settings/dashboard/DashboardAdapter.java
+++ b/src/com/android/settings/dashboard/DashboardAdapter.java
@@ -283,6 +283,9 @@
     }
 
     public void disableSuggestion(Tile suggestion) {
+        if (mSuggestionParser == null) {
+            return;
+        }
         if (mSuggestionParser.dismissSuggestion(suggestion)) {
             mContext.getPackageManager().setComponentEnabledSetting(
                     suggestion.intent.getComponent(),
diff --git a/src/com/android/settings/datausage/DataSaverBackend.java b/src/com/android/settings/datausage/DataSaverBackend.java
index 0c8c2e2..eb62ad7 100644
--- a/src/com/android/settings/datausage/DataSaverBackend.java
+++ b/src/com/android/settings/datausage/DataSaverBackend.java
@@ -207,10 +207,6 @@
         }
 
         @Override
-        public void onRestrictPowerChanged(boolean restrictPower) {
-        }
-
-        @Override
         public void onRestrictBackgroundChanged(final boolean isDataSaving) throws RemoteException {
             mHandler.post(new Runnable() {
                 @Override
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
index 66026eb..c9a1fb7 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
@@ -117,7 +117,7 @@
 
     private Preference mExplore;
 
-    private boolean mDetached;
+    private boolean mNeedsUpdate;
 
     private boolean isVolumeValid() {
         return (mVolume != null) && (mVolume.getType() == VolumeInfo.TYPE_PRIVATE)
@@ -164,18 +164,22 @@
 
         mExplore = buildAction(R.string.storage_menu_explore);
 
-        mDetached = false;
+        mNeedsUpdate = true;
 
         setHasOptionsMenu(true);
     }
 
+    private void setTitle() {
+        getActivity().setTitle(mStorageManager.getBestVolumeDescription(mVolume));
+    }
+
     private void update() {
         if (!isVolumeValid()) {
             getActivity().finish();
             return;
         }
 
-        getActivity().setTitle(mStorageManager.getBestVolumeDescription(mVolume));
+        setTitle();
 
         // Valid options may have changed
         getFragmentManager().invalidateOptionsMenu();
@@ -238,6 +242,7 @@
         mSummary.setPercent((int) ((usedBytes * 100) / totalBytes));
 
         mMeasure.forceMeasure();
+        mNeedsUpdate = false;
     }
 
     private void addPreference(PreferenceGroup group, Preference pref) {
@@ -314,8 +319,10 @@
 
         mStorageManager.registerListener(mStorageListener);
 
-        if (!mDetached) {
+        if (mNeedsUpdate) {
             update();
+        } else {
+            setTitle();
         }
     }
 
@@ -326,24 +333,11 @@
     }
 
     @Override
-    public void onAttach(Context context) {
-        super.onAttach(context);
-        mDetached = false;
-    }
-
-    @Override
-    public void onDetach() {
-        super.onDetach();
-        mDetached = true;
-    }
-
-    @Override
     public void onDestroy() {
         super.onDestroy();
         if (mMeasure != null) {
             mMeasure.onDestroy();
         }
-        mDetached = false;
     }
 
     @Override
diff --git a/src/com/android/settings/display/DensityPreference.java b/src/com/android/settings/display/DensityPreference.java
index 44013e3..0c5c187 100644
--- a/src/com/android/settings/display/DensityPreference.java
+++ b/src/com/android/settings/display/DensityPreference.java
@@ -19,6 +19,7 @@
 import android.text.InputType;
 import android.util.AttributeSet;
 import android.util.DisplayMetrics;
+import android.util.Slog;
 import android.view.Display;
 import android.view.View;
 import android.widget.EditText;
@@ -27,6 +28,7 @@
 import com.android.settingslib.display.DisplayDensityUtils;
 
 public class DensityPreference extends CustomEditTextPreference {
+    private static final String TAG = "DensityPreference";
 
     public DensityPreference(Context context, AttributeSet attrs) {
         super(context, attrs);
@@ -62,13 +64,18 @@
     @Override
     protected void onDialogClosed(boolean positiveResult) {
         if (positiveResult) {
-            final Resources res = getContext().getResources();
-            final DisplayMetrics metrics = res.getDisplayMetrics();
-            final int newSwDp = Math.max(Integer.parseInt(getText()), 320);
-            final int minDimensionPx = Math.min(metrics.widthPixels, metrics.heightPixels);
-            final int newDensity = DisplayMetrics.DENSITY_MEDIUM * minDimensionPx / newSwDp;
-            final int densityDpi = Math.max(newDensity, 120);
-            DisplayDensityUtils.setForcedDisplayDensity(Display.DEFAULT_DISPLAY, densityDpi);
+            try {
+                final Resources res = getContext().getResources();
+                final DisplayMetrics metrics = res.getDisplayMetrics();
+                final int newSwDp = Math.max(Integer.parseInt(getText()), 320);
+                final int minDimensionPx = Math.min(metrics.widthPixels, metrics.heightPixels);
+                final int newDensity = DisplayMetrics.DENSITY_MEDIUM * minDimensionPx / newSwDp;
+                final int densityDpi = Math.max(newDensity, 120);
+                DisplayDensityUtils.setForcedDisplayDensity(Display.DEFAULT_DISPLAY, densityDpi);
+            } catch (Exception e) {
+                // TODO: display a message instead of silently failing.
+                Slog.e(TAG, "Couldn't save density", e);
+            }
         }
     }
 }
diff --git a/src/com/android/settings/notification/ConfigureNotificationSettings.java b/src/com/android/settings/notification/ConfigureNotificationSettings.java
index 9acac06..89aebf9 100644
--- a/src/com/android/settings/notification/ConfigureNotificationSettings.java
+++ b/src/com/android/settings/notification/ConfigureNotificationSettings.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.notification;
 
+import android.app.admin.DevicePolicyManager;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.database.ContentObserver;
@@ -177,6 +178,9 @@
                     KEYGUARD_DISABLE_SECURE_NOTIFICATIONS);
         }
 
+        mLockscreen.setRemoteInputRestricted(RestrictedLockUtils.checkIfKeyguardFeaturesDisabled(
+                mContext, DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT, UserHandle.myUserId()));
+
         mLockscreen.setEntries(entries.toArray(new CharSequence[entries.size()]));
         mLockscreen.setEntryValues(values.toArray(new CharSequence[values.size()]));
         updateLockscreenNotifications();
@@ -239,6 +243,10 @@
                     KEYGUARD_DISABLE_SECURE_NOTIFICATIONS);
         }
 
+        mLockscreen.setRemoteInputRestricted(RestrictedLockUtils.checkIfKeyguardFeaturesDisabled(
+                mContext, DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT,
+                mProfileChallengeUserId));
+
         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
diff --git a/src/com/android/settings/notification/NotificationLockscreenPreference.java b/src/com/android/settings/notification/NotificationLockscreenPreference.java
index fc61be3..01eecf5 100644
--- a/src/com/android/settings/notification/NotificationLockscreenPreference.java
+++ b/src/com/android/settings/notification/NotificationLockscreenPreference.java
@@ -19,6 +19,7 @@
 import com.android.settings.R;
 import com.android.settings.RestrictedListPreference;
 import com.android.settings.Utils;
+import com.android.settingslib.RestrictedLockUtils;
 
 import android.app.AlertDialog;
 import android.app.Dialog;
@@ -32,6 +33,7 @@
 import android.view.View;
 import android.widget.CheckBox;
 import android.widget.CompoundButton;
+import android.widget.ImageView;
 import android.widget.ListAdapter;
 import android.widget.ListView;
 
@@ -42,6 +44,7 @@
     private boolean mShowRemoteInput;
     private boolean mRemoteInputCheckBoxEnabled = true;
     private int mUserId = UserHandle.myUserId();
+    private RestrictedLockUtils.EnforcedAdmin mAdminRestrictingRemoteInput;
 
     public NotificationLockscreenPreference(Context context, AttributeSet attrs) {
         super(context, attrs);
@@ -51,6 +54,10 @@
         mRemoteInputCheckBoxEnabled = enabled;
     }
 
+    public void setRemoteInputRestricted(RestrictedLockUtils.EnforcedAdmin admin) {
+        mAdminRestrictingRemoteInput = admin;
+    }
+
     @Override
     protected void onClick() {
         final Context context = getContext();
@@ -81,9 +88,19 @@
     protected void onDialogCreated(Dialog dialog) {
         super.onDialogCreated(dialog);
         dialog.create();
-        CheckBox view = (CheckBox) dialog.findViewById(R.id.lockscreen_remote_input);
-        view.setChecked(!mAllowRemoteInput);
-        view.setOnCheckedChangeListener(mListener);
+        CheckBox checkbox = (CheckBox) dialog.findViewById(R.id.lockscreen_remote_input);
+        checkbox.setChecked(!mAllowRemoteInput);
+        checkbox.setOnCheckedChangeListener(mListener);
+        checkbox.setEnabled(mAdminRestrictingRemoteInput == null);
+
+        View restricted = dialog.findViewById(R.id.restricted_lock_icon_remote_input);
+        restricted.setVisibility(mAdminRestrictingRemoteInput == null ? View.GONE : View.VISIBLE);
+
+        if (mAdminRestrictingRemoteInput != null) {
+            checkbox.setClickable(false);
+            dialog.findViewById(com.android.internal.R.id.customPanel)
+                    .setOnClickListener(mListener);
+        }
     }
 
     @Override
@@ -122,7 +139,7 @@
     }
 
     private class Listener implements DialogInterface.OnClickListener,
-            CompoundButton.OnCheckedChangeListener {
+            CompoundButton.OnCheckedChangeListener, View.OnClickListener {
 
         private final DialogInterface.OnClickListener mInner;
         private View mView;
@@ -150,5 +167,13 @@
         public void setView(View view) {
             mView = view;
         }
+
+        @Override
+        public void onClick(View v) {
+            if (v.getId() == com.android.internal.R.id.customPanel) {
+                RestrictedLockUtils.sendShowAdminSupportDetailsIntent(getContext(),
+                        mAdminRestrictingRemoteInput);
+            }
+        }
     }
 }
diff --git a/src/com/android/settings/notification/RedactionInterstitial.java b/src/com/android/settings/notification/RedactionInterstitial.java
index 35e4036..84ae35d 100644
--- a/src/com/android/settings/notification/RedactionInterstitial.java
+++ b/src/com/android/settings/notification/RedactionInterstitial.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.notification;
 
+import android.app.admin.DevicePolicyManager;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
@@ -32,6 +33,7 @@
 
 import com.android.internal.logging.MetricsProto.MetricsEvent;
 import com.android.settings.R;
+import com.android.settings.RestrictedCheckBox;
 import com.android.settings.RestrictedRadioButton;
 import com.android.settings.SettingsActivity;
 import com.android.settings.SettingsPreferenceFragment;
@@ -81,7 +83,7 @@
         private RadioGroup mRadioGroup;
         private RestrictedRadioButton mShowAllButton;
         private RestrictedRadioButton mRedactSensitiveButton;
-        private CheckBox mRemoteInputCheckbox;
+        private RestrictedCheckBox mRemoteInputCheckbox;
         private int mUserId;
 
         @Override
@@ -102,7 +104,8 @@
             mShowAllButton = (RestrictedRadioButton) view.findViewById(R.id.show_all);
             mRedactSensitiveButton =
                     (RestrictedRadioButton) view.findViewById(R.id.redact_sensitive);
-            mRemoteInputCheckbox = (CheckBox) view.findViewById(R.id.lockscreen_remote_input);
+            mRemoteInputCheckbox =
+                    (RestrictedCheckBox) view.findViewById(R.id.lockscreen_remote_input);
             mRemoteInputCheckbox.setOnCheckedChangeListener(this);
 
             mRadioGroup.setOnCheckedChangeListener(this);
@@ -129,6 +132,9 @@
                     KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS);
             checkNotificationFeaturesAndSetDisabled(mRedactSensitiveButton,
                     KEYGUARD_DISABLE_SECURE_NOTIFICATIONS);
+            mRemoteInputCheckbox.setDisabledByAdmin(
+                    RestrictedLockUtils.checkIfKeyguardFeaturesDisabled(getActivity(),
+                            DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT, mUserId));
             loadFromSettings();
         }