From 2b43c73e66d99a5ccc8a23fd1c4e2028f9dd05f2 Mon Sep 17 00:00:00 2001 From: Kenny Guy Date: Mon, 19 Jan 2015 16:26:07 +0000 Subject: 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 --- core/java/com/android/internal/app/IntentForwarderActivity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'core/java/com') diff --git a/core/java/com/android/internal/app/IntentForwarderActivity.java b/core/java/com/android/internal/app/IntentForwarderActivity.java index 9656a21..7c1308f 100644 --- a/core/java/com/android/internal/app/IntentForwarderActivity.java +++ b/core/java/com/android/internal/app/IntentForwarderActivity.java @@ -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); -- cgit v1.1