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

Commit c8936d36 authored by Winson's avatar Winson
Browse files

Null check overlayPaths/resourceDirs when applying widget changes

It's possible a previous snapshot change altered the nullability
of these values, but the String[] for both resourcesDirs and
overlayPaths are expected to be nullable anyways, so just null
check them before cloning.

Bug: 216722631

Test: atest com.android.cts.webkit.WebViewHostSideMultipleProfileTest#testSecondProfile

Change-Id: I56aaf6d5aec1ec14bc7986fe58e1cc77cf6b8376
parent 0891d4b3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3346,8 +3346,10 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
            // Isolate the changes relating to RROs. The app info must be copied to prevent
            // affecting other parts of system server that may have cached this app info.
            oldAppInfo = new ApplicationInfo(oldAppInfo);
            oldAppInfo.overlayPaths = newAppInfo.overlayPaths.clone();
            oldAppInfo.resourceDirs = newAppInfo.resourceDirs.clone();
            oldAppInfo.overlayPaths = newAppInfo.overlayPaths == null
                    ? null : newAppInfo.overlayPaths.clone();
            oldAppInfo.resourceDirs = newAppInfo.resourceDirs == null
                    ? null : newAppInfo.resourceDirs.clone();
            provider.info.providerInfo.applicationInfo = oldAppInfo;

            for (int j = 0, M = provider.widgets.size(); j < M; j++) {