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

Commit b460b11d authored by Adnan Begovic's avatar Adnan Begovic
Browse files

am: Don't protect apps that atttempt to grant uri perms.

  If an application is delegating uri permissions through
  the disambiguation dialog, we need to ignore the global
  protected apps concept to make sure the functionality still
  works.

  TODO: Refactor the protected apps implementation to function
  with startActivityAsCaller within the system process and the
  android package.

  TICKET: FEIJ-420

Change-Id: I8ba974a7b25dffe654d32e859064ae86cd9dc7f8
(cherry picked from commit d77a60f9)
parent 4e18a400
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -974,8 +974,12 @@ public final class ActivityStackSupervisor implements DisplayListener {

            try {
                //TODO: This needs to be a flushed out API in the future.
                if (intent.getComponent() != null && AppGlobals.getPackageManager()
                        .isComponentProtected(callingPackage, intent.getComponent(), userId)) {
                boolean isProtected = intent.getComponent() != null
                        && AppGlobals.getPackageManager()
                        .isComponentProtected(callingPackage, intent.getComponent(), userId) &&
                        (intent.getFlags()&Intent.FLAG_GRANT_READ_URI_PERMISSION) == 0;

                if (isProtected) {
                    Message msg = mService.mHandler.obtainMessage(
                            ActivityManagerService.POST_COMPONENT_PROTECTED_MSG);
                    //Store start flags, userid