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

Commit 85b1919f authored by Ryan Mitchell's avatar Ryan Mitchell Committed by Android Build Coastguard Worker
Browse files

Guard against null info when applying widget RROs

Add null checks to  applyResourceOverlaysToWidgetsLocked to protect
against a widget provider component info being null.

Fixes: 196231621
Fixes: 196331791
Test: none
Change-Id: Ia762694523404ac508eb49600306048037f13658
(cherry picked from commit 8c86f395)
parent 436f041e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3306,11 +3306,12 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
                Slog.w(TAG, "Failed to retrieve app info for " + packageName
                        + " userId=" + userId, e);
            }
            if (newAppInfo == null) {
            if (newAppInfo == null || provider.info == null
                    || provider.info.providerInfo == null) {
                continue;
            }
            ApplicationInfo oldAppInfo = provider.info.providerInfo.applicationInfo;
            if (!newAppInfo.sourceDir.equals(oldAppInfo.sourceDir)) {
            if (oldAppInfo == null || !newAppInfo.sourceDir.equals(oldAppInfo.sourceDir)) {
                // Overlay paths are generated against a particular version of an application.
                // The overlays paths of a newly upgraded application are incompatible with the
                // old version of the application.