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

Commit 78eb5eb0 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 am: ba142711

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



Change-Id: I4513f7337104f100dea95c5bb479952ed0d9fbc7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a8b5b0fb ba142711
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -6282,13 +6282,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);