Only hide cross profile disclosure when showing resolver.

Hiding the cross profile discoloure for all system apps
also meant it wasn't shown for CALL_PRIVILEGED intents.

Bug: 18702461
Change-Id: I8129bc4b07573b547aefe2dbcc6938a60305c216
This commit is contained in:
Kenny Guy
2015-01-19 16:26:07 +00:00
parent fd846dfbf1
commit 2b43c73e66

View File

@@ -96,9 +96,12 @@ public class IntentForwarderActivity extends Activity {
final android.content.pm.ResolveInfo ri = getPackageManager().resolveActivityAsUser(
newIntent, MATCH_DEFAULT_ONLY, targetUserId);
// Only show a disclosure if this is a normal (non-OS) app
final boolean shouldShowDisclosure =
!UserHandle.isSameApp(ri.activityInfo.applicationInfo.uid, Process.SYSTEM_UID);
// Don't show the disclosure if next activity is ResolverActivity or ChooserActivity
// as those will already have shown work / personal as neccesary etc.
final boolean shouldShowDisclosure = ri == null || ri.activityInfo == null ||
!"android".equals(ri.activityInfo.packageName) ||
!(ResolverActivity.class.getName().equals(ri.activityInfo.name)
|| ChooserActivity.class.getName().equals(ri.activityInfo.name));
try {
startActivityAsCaller(newIntent, null, targetUserId);