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

Commit 2f7bc0f0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Handle exceptions from querying appinfo in RemoteViews#addAppWidget." into tm-dev

parents 945049d9 74decaab
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -6072,13 +6072,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);