Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b43c73e authored by Kenny Guy's avatar Kenny Guy
Browse files

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
parent fd846dfb
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -96,9 +96,12 @@ public class IntentForwarderActivity extends Activity {
            final android.content.pm.ResolveInfo ri = getPackageManager().resolveActivityAsUser(
            final android.content.pm.ResolveInfo ri = getPackageManager().resolveActivityAsUser(
                        newIntent, MATCH_DEFAULT_ONLY, targetUserId);
                        newIntent, MATCH_DEFAULT_ONLY, targetUserId);


            // Only show a disclosure if this is a normal (non-OS) app
            // Don't show the disclosure if next activity is ResolverActivity or ChooserActivity
            final boolean shouldShowDisclosure =
            // as those will already have shown work / personal as neccesary etc.
                    !UserHandle.isSameApp(ri.activityInfo.applicationInfo.uid, Process.SYSTEM_UID);
            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 {
            try {
                startActivityAsCaller(newIntent, null, targetUserId);
                startActivityAsCaller(newIntent, null, targetUserId);