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

Commit ba142711 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Handle exceptions from querying appinfo in RemoteViews#addAppWidget."...

Merge "Handle exceptions from querying appinfo in RemoteViews#addAppWidget." into tm-dev am: 2f7bc0f0 am: cf071f7b am: f4d7f5f6 am: e85072aa

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/32920948



Change-Id: I3ff340aa9afb5514b538ce8d0c837d20c41affa1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ef765ab5 e85072aa
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -6055,13 +6055,17 @@ public class RemoteViews implements Parcelable, Filter {
                    && context.getPackageName().equals(mApplication.packageName)) {
                return context;
            }
            try {
                ApplicationInfo sanitizedApplication = mApplication;
                try {
                    // Use PackageManager as the source of truth for application information, rather
                    // than the parceled ApplicationInfo provided by the app.
                ApplicationInfo sanitizedApplication =
                        context.getPackageManager().getApplicationInfoAsUser(
                                mApplication.packageName, 0,
                                UserHandle.getUserId(mApplication.uid));
                    sanitizedApplication = context.getPackageManager().getApplicationInfoAsUser(
                        mApplication.packageName, 0, UserHandle.getUserId(mApplication.uid));
                } catch(SecurityException se) {
                    Log.d(LOG_TAG, "Unable to fetch appInfo for " + mApplication.packageName);
                }

                Context applicationContext = context.createApplicationContext(
                        sanitizedApplication,
                        Context.CONTEXT_RESTRICTED);