Show localized channel names
Test: manual Change-Id: I85d60e564aeff8074cdb8138fe7ac1c078be986a
This commit is contained in:
@@ -248,4 +248,17 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
|
||||
return getContext().getString(R.string.notification_importance_high);
|
||||
}
|
||||
}
|
||||
|
||||
protected CharSequence getNotificationChannelLabel(NotificationChannel channel) {
|
||||
if (channel.getName() != null) {
|
||||
return channel.getName();
|
||||
}
|
||||
try {
|
||||
ApplicationInfo info = mPm.getApplicationInfoAsUser(mAppRow.pkg, 0, mAppRow.userId);
|
||||
return mPm.getText(mAppRow.pkg, channel.getNameResId(), info);
|
||||
} catch (NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user