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

Commit 86092491 authored by herriojr's avatar herriojr Committed by Gerrit Code Review
Browse files

Fix Custom Resolver Theming

Theming wasn't working with a custom resolver and the culprit was the
fact that the PackageManagerService was overriding the theme with no
theme. This fix looks through the package and finds the correct theme
for the activity.

Change-Id: I6b253a236ae2a868acb0374384ba1ae58efa5b5e
parent 09ab4477
Loading
Loading
Loading
Loading
+25 −19
Original line number Diff line number Diff line
@@ -7217,6 +7217,9 @@ public class PackageManagerService extends IPackageManager.Stub {
    private void setUpCustomResolverActivity(PackageParser.Package pkg) {
        synchronized (mPackages) {
            for (Activity a : pkg.activities) {
                if (a.getComponentName().getClassName()
                        .equals(mCustomResolverComponentName.getClassName())) {
                    mResolverReplaced = true;
                    // Set up information for custom user intent resolution activity.
                    mResolveActivity.applicationInfo = pkg.applicationInfo;
@@ -7226,7 +7229,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                    mResolveActivity.launchMode = ActivityInfo.LAUNCH_MULTIPLE;
                    mResolveActivity.flags = ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS |
                            ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS;
            mResolveActivity.theme = 0;
                    mResolveActivity.theme = a.info.theme;
                    mResolveActivity.exported = true;
                    mResolveActivity.enabled = true;
                    mResolveInfo.activityInfo = mResolveActivity;
@@ -7236,6 +7239,9 @@ public class PackageManagerService extends IPackageManager.Stub {
                    mResolveComponentName = mCustomResolverComponentName;
                    Slog.i(TAG, "Replacing default ResolverActivity with custom activity: " +
                            mResolveComponentName);
                    break;
                }
            }
        }
    }