From d93f3b10e21b225ce4ffc16c87597d594a8bc942 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 3 Mar 2016 08:43:37 -0800 Subject: [PATCH] Fix crash for showing linker errors for apps with no label Use ApplicationInfo#loadLabel to provide the standard fallback chain of strings to identify an app instead of getString on the raw label resource id, which will throw a NotFoundException if 0. Bug 27469189 Change-Id: I344273c600f029361f3accfe5d91b0d332635b3d --- core/java/android/app/Activity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index be89b20c91c5b..b87e9fa2d879f 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -6599,7 +6599,8 @@ public class Activity extends ContextThemeWrapper if (isAppDebuggable || isDlwarningEnabled) { String dlwarning = getDlWarning(); if (dlwarning != null) { - String appName = getString(mApplication.getApplicationInfo().labelRes); + String appName = getApplicationInfo().loadLabel(getPackageManager()) + .toString(); String warning = "Detected problems with app native libraries\n" + "(please consult log for detail):\n" + dlwarning; if (isAppDebuggable) {