Do not show a summary in Tail button preferences if no app found

Bug: 289054758
Test: StylusDevicesControllerTest
Change-Id: I985194b2e64d36844a9b88f19394db2728ea70e4
This commit is contained in:
Vania Januar
2023-07-03 14:44:59 +01:00
parent 55774422b1
commit ebc0b9c323
2 changed files with 15 additions and 1 deletions

View File

@@ -124,7 +124,7 @@ public class StylusDevicesController extends AbstractPreferenceController implem
try {
ApplicationInfo ai = pm.getApplicationInfo(packageName,
PackageManager.ApplicationInfoFlags.of(0));
appName = ai == null ? packageName : pm.getApplicationLabel(ai).toString();
appName = ai == null ? "" : pm.getApplicationLabel(ai).toString();
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Notes role package not found.");
}