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

Commit 9dcd1396 authored by Sunny Goyal's avatar Sunny Goyal Committed by Automerger Merge Worker
Browse files

Merge "RemoteViews - Always load new ApplicationInfo from PackageManager."...

Merge "RemoteViews - Always load new ApplicationInfo from PackageManager." into tm-dev am: 49155638 am: 5b381318 am: ab30681a am: 04b069b0

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



Change-Id: I37787330341606e344331a3d8c540ff240893577
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3b6f0a6d 04b069b0
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.Activity;
import android.app.ActivityOptions;
import android.app.LoadedApk;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.Context;
@@ -733,9 +732,6 @@ public class AppWidgetHostView extends FrameLayout implements AppWidgetHost.AppW
     */
    protected Context getRemoteContextEnsuringCorrectCachedApkPath() {
        try {
            ApplicationInfo expectedAppInfo = mInfo.providerInfo.applicationInfo;
            LoadedApk.checkAndUpdateApkPaths(expectedAppInfo);
            // Return if cloned successfully, otherwise default
            Context newContext = mContext.createApplicationContext(
                    mInfo.providerInfo.applicationInfo,
                    Context.CONTEXT_RESTRICTED);
+11 −3
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import android.app.ActivityOptions;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.app.Application;
import android.app.LoadedApk;
import android.app.PendingIntent;
import android.app.RemoteInput;
import android.appwidget.AppWidgetHostView;
@@ -6284,9 +6283,18 @@ public class RemoteViews implements Parcelable, Filter {
                return context;
            }
            try {
                LoadedApk.checkAndUpdateApkPaths(mApplication);
                return context.createApplicationContext(mApplication,
                // 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));
                Context applicationContext = context.createApplicationContext(
                        sanitizedApplication,
                        Context.CONTEXT_RESTRICTED);
                // Get the correct apk paths while maintaining the current context's configuration.
                return applicationContext.createConfigurationContext(
                        context.getResources().getConfiguration());
            } catch (NameNotFoundException e) {
                Log.e(LOG_TAG, "Package name " + mApplication.packageName + " not found");
            }