When we're launching apps, we need to always use startActivitySafely.
It's possible that the app doesn't implement the component as promised, and the launcher shouldn't
crash.
Bug: 3005141
Change-Id: Ieac51433a467fd12160247bfd281828a69f5f7d2
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 28a6712..bc529a4 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1223,9 +1223,9 @@
Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent);
- startActivityForResult(pickIntent, REQUEST_PICK_APPLICATION);
+ startActivityForResultSafely(pickIntent, REQUEST_PICK_APPLICATION);
} else {
- startActivityForResult(intent, REQUEST_CREATE_SHORTCUT);
+ startActivityForResultSafely(intent, REQUEST_CREATE_SHORTCUT);
}
}
@@ -1237,7 +1237,7 @@
if (folderName != null && folderName.equals(shortcutName)) {
addFolder();
} else {
- startActivityForResult(intent, REQUEST_CREATE_LIVE_FOLDER);
+ startActivityForResultSafely(intent, REQUEST_CREATE_LIVE_FOLDER);
}
}