Work around commonly reported crash when determining default launcher
@@ -703,7 +703,11 @@ public class U {
homeIntent.addCategory(Intent.CATEGORY_HOME);
ResolveInfo defaultLauncher = context.getPackageManager().resolveActivity(homeIntent, PackageManager.MATCH_DEFAULT_ONLY);
+ try {
return defaultLauncher.activityInfo.packageName.equals(context.getPackageName());
+ } catch (NullPointerException e) {
+ return false;
+ }
}
private static int getMaxNumOfColumns(Context context) {
