Merge "Fix crash in clicking Default Home gear icon."

This commit is contained in:
TreeHugger Robot
2018-08-24 20:13:36 +00:00
committed by Android (Google) Code Review
2 changed files with 26 additions and 25 deletions

View File

@@ -105,7 +105,7 @@ public class DefaultHomePreferenceController extends DefaultAppPreferenceControl
Intent intent = new Intent(Intent.ACTION_APPLICATION_PREFERENCES)
.setPackage(packageName)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
return mPackageManager.queryIntentActivities(intent, 0).size() == 1 ? intent : null;
return intent.resolveActivity(mPackageManager) != null ? intent : null;
}
public static boolean hasHomePreference(String pkg, Context context) {