fix 2542590 add more logging when launching app fails
Change-Id: I5a1fa261c6e67eb7afb661de39e35ce43e2caa59
This commit is contained in:
1 parent
509cd6a656
commit
f984e853f2
7 files changed
+14
-11
No files matched your search
@@ -165,7 +165,7 @@ public class AllApps2D
|
||||
|
||||
public void onItemClick(AdapterView parent, View v, int position, long id) {
|
||||
ApplicationInfo app = (ApplicationInfo) parent.getItemAtPosition(position);
|
||||
mLauncher.startActivitySafely(app.intent);
|
||||
mLauncher.startActivitySafely(app.intent, app);
|
||||
}
|
||||
|
||||
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
@@ -392,7 +392,7 @@ public class AllApps3D extends RSSurfaceView
|
||||
int whichApp = sRollo.mState.selectedIconIndex;
|
||||
if (whichApp >= 0) {
|
||||
ApplicationInfo app = mAllAppsList.get(whichApp);
|
||||
mLauncher.startActivitySafely(app.intent);
|
||||
mLauncher.startActivitySafely(app.intent, app);
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
@@ -720,7 +720,7 @@ public class AllApps3D extends RSSurfaceView
|
||||
&& mCurrentIconIndex >= 0 && mCurrentIconIndex < mAllAppsList.size()) {
|
||||
reallyPlaySoundEffect(SoundEffectConstants.CLICK);
|
||||
ApplicationInfo app = mAllAppsList.get(mCurrentIconIndex);
|
||||
mLauncher.startActivitySafely(app.intent);
|
||||
mLauncher.startActivitySafely(app.intent, app);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class ApplicationInfo extends ItemInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title.toString();
|
||||
return "ApplicationInfo(title=" + title.toString() + ")";
|
||||
}
|
||||
|
||||
public static void dumpApplicationInfoList(String tag, String label,
|
||||
|
||||
@@ -81,7 +81,7 @@ public class Folder extends LinearLayout implements DragSource, OnItemLongClickL
|
||||
v.getLocationOnScreen(pos);
|
||||
app.intent.setSourceBounds(new Rect(pos[0], pos[1],
|
||||
pos[0] + v.getWidth(), pos[1] + v.getHeight()));
|
||||
mLauncher.startActivitySafely(app.intent);
|
||||
mLauncher.startActivitySafely(app.intent, app);
|
||||
}
|
||||
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -1262,7 +1262,7 @@ public final class Launcher extends Activity
|
||||
v.getLocationOnScreen(pos);
|
||||
intent.setSourceBounds(new Rect(pos[0], pos[1],
|
||||
pos[0] + v.getWidth(), pos[1] + v.getHeight()));
|
||||
startActivitySafely(intent);
|
||||
startActivitySafely(intent, tag);
|
||||
} else if (tag instanceof FolderInfo) {
|
||||
handleFolderClick((FolderInfo) tag);
|
||||
} else if (v == mHandleView) {
|
||||
@@ -1274,17 +1274,19 @@ public final class Launcher extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
void startActivitySafely(Intent intent) {
|
||||
void startActivitySafely(Intent intent, Object tag) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
try {
|
||||
startActivity(intent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
|
||||
Log.e(TAG, "Unable to launch. tag=" + tag + " intent=" + intent);
|
||||
} catch (SecurityException e) {
|
||||
Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
|
||||
Log.e(TAG, "Launcher does not have the permission to launch " + intent +
|
||||
". Make sure to create a MAIN intent-filter for the corresponding activity " +
|
||||
"or use the exported attribute for this activity.", e);
|
||||
"or use the exported attribute for this activity. "
|
||||
+ "tag="+ tag + " intent=" + intent, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,10 +60,11 @@ public class LiveFolder extends Folder {
|
||||
Uri uri = baseIntent.getData();
|
||||
uri = uri.buildUpon().appendPath(Long.toString(holder.id)).build();
|
||||
intent.setData(uri);
|
||||
mLauncher.startActivitySafely(intent);
|
||||
mLauncher.startActivitySafely(intent, "(position=" + position + ", id=" + id + ")");
|
||||
}
|
||||
} else if (holder.intent != null) {
|
||||
mLauncher.startActivitySafely(holder.intent);
|
||||
mLauncher.startActivitySafely(holder.intent,
|
||||
"(position=" + position + ", id=" + id + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ class ShortcutInfo extends ItemInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title.toString();
|
||||
return "ShortcutInfo(title=" + title.toString() + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user