ApplicationInfo app = mAdapter.appForPosition(position);
Intent intent = new Intent();
if (app != null) intent.setAction(app.packageName);
setResult(RESULT_OK, intent);
/* This is a temporary fix for 824637 while it is blocked by 805226. When 805226 is resolved, please remove this. */
try {
boolean waitForDebugger = Settings.System.getInt(
getContentResolver(), Settings.System.WAIT_FOR_DEBUGGER, 0) != 0;
ActivityManagerNative.getDefault().setDebugApp(
app != null ? app.packageName : null, waitForDebugger, true);
} catch (RemoteException ex) {
}
finish();