OSDN Git Service

Fix NPE in ActivityThread
authorClara Bayarri <clarabayarri@google.com>
Tue, 3 Oct 2017 14:37:01 +0000 (15:37 +0100)
committerClara Bayarri <clarabayarri@google.com>
Tue, 3 Oct 2017 16:03:22 +0000 (16:03 +0000)
Calling LoadedApk.getResources() instead of accessing its
mResources directly accounts for the case where this might
not have been initialized.

Bug: 67327250
Test: none
Change-Id: Iaa392a90eefb60ad479cedf8c882976dbe390387

core/java/android/app/ActivityThread.java

index f01feea..45f7eba 100644 (file)
@@ -5766,7 +5766,7 @@ public final class ActivityThread {
                 final int preloadedFontsResource = info.metaData.getInt(
                         ApplicationInfo.METADATA_PRELOADED_FONTS, 0);
                 if (preloadedFontsResource != 0) {
-                    data.info.mResources.preloadFonts(preloadedFontsResource);
+                    data.info.getResources().preloadFonts(preloadedFontsResource);
                 }
             }
         } catch (RemoteException e) {