Avoid checking the restricted items in the list.

Since we are not auto-closing the dialog any more, need to
make sure the restricted item in not checked when selected by user.

Change-Id: I7c02844d3071ae62222cdbdbda96780bd5d922de
This commit is contained in:
Sudheer Shanka
2016-03-04 13:53:24 -08:00
parent 9566ceb122
commit 54dc9d52d0
2 changed files with 35 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ListAdapter;
import android.widget.ListView;
public class NotificationLockscreenPreference extends RestrictedListPreference {
@@ -101,8 +102,11 @@ public class NotificationLockscreenPreference extends RestrictedListPreference {
@Override
public void onClick(DialogInterface dialog, int which) {
mInner.onClick(dialog, which);
ListView listView = ((AlertDialog) dialog).getListView();
int selectedPosition = listView.getCheckedItemPosition();
if (mView != null) {
mView.setVisibility(checkboxVisibilityForSelectedIndex(which, mShowRemoteInput));
mView.setVisibility(
checkboxVisibilityForSelectedIndex(selectedPosition, mShowRemoteInput));
}
}