Fix the 'Google play system update' button is not actionable.

If the ResolveInfo of the update intent is not null, set preference
to selectable.

Fixes: 147616097
Test: manual & robotest
Change-Id: If6086b113fc1c782b47966f7a30eddfdac195ce0
This commit is contained in:
Stanley Wang
2020-02-06 17:26:07 +08:00
parent cf4e12bbd9
commit 10ec77121c
3 changed files with 17 additions and 1 deletions

View File

@@ -86,8 +86,11 @@ public class MainlineModuleVersionPreferenceController extends BasePreferenceCon
mPackageManager.resolveActivity(MODULE_UPDATE_INTENT, 0 /* flags */);
if (resolved != null) {
preference.setIntent(MODULE_UPDATE_INTENT);
preference.setSelectable(true);
} else {
Log.d(TAG, "The ResolveInfo of the update intent is null.");
preference.setIntent(null);
preference.setSelectable(false);
}
}