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

This commit is contained in:
Ricky Wai
2016-04-14 17:59:27 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 3 deletions

View File

@@ -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() {

View File

@@ -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,

View File

@@ -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);
}
}
}