public static final String META_HOME_ALTERNATE = "android.app.home.alternate";
/**
+ * Result for IActivityManager.startActivity: trying to start a protected app.
+ * @hide
+ */
+ public static final int START_PROTECTED_APP = -11;
+
+ /**
* Result for IActivityManager.startVoiceActivity: active session is currently hidden.
* @hide
*/
/** @hide */
public static void checkStartActivityResult(int res, Object intent) {
- if (res >= ActivityManager.START_SUCCESS) {
+ // Allow START_PROTECTED_APP for protected apps
+ if (res >= ActivityManager.START_SUCCESS ||
+ res == ActivityManager.START_PROTECTED_APP) {
return;
}
intent.putExtra("com.android.settings.PROTECTED_APPS_USER_ID", userId);
msg.obj = intent;
mService.mHandler.sendMessage(msg);
- err = ActivityManager.START_NOT_CURRENT_USER_ACTIVITY;
+ err = ActivityManager.START_PROTECTED_APP;
}
} catch (RemoteException e) {
Slog.w(TAG, "Failure checking protected apps status", e);
- err = ActivityManager.START_NOT_CURRENT_USER_ACTIVITY;
+ err = ActivityManager.START_PROTECTED_APP;
}
}
intent.putExtra("com.android.settings.PROTECTED_APPS_USER_ID", userId);
msg.obj = intent;
mService.mHandler.sendMessage(msg);
- return ActivityManager.START_NOT_CURRENT_USER_ACTIVITY;
+ return ActivityManager.START_PROTECTED_APP;
}
} catch (RemoteException e) {
e.printStackTrace();