Merge "Do not call setAlwaysButtonEnabled if the activity doesn't support defaults." into oc-mr1-dev

This commit is contained in:
TreeHugger Robot
2017-08-31 19:47:42 +00:00
committed by Android (Google) Code Review

View File

@@ -1941,7 +1941,8 @@ public class ResolverActivity extends Activity {
final int checkedPos = mAdapterView.getCheckedItemPosition();
final boolean hasValidSelection = checkedPos != ListView.INVALID_POSITION;
if (!useLayoutWithDefault()
&& (!hasValidSelection || mLastSelected != checkedPos)) {
&& (!hasValidSelection || mLastSelected != checkedPos)
&& mAlwaysButton != null) {
setAlwaysButtonEnabled(hasValidSelection, checkedPos, true);
mOnceButton.setEnabled(hasValidSelection);
if (hasValidSelection) {