android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:ellipsize="end"
+ android:text="@string/notification_delegate_header"
android:layout_toEndOf="@id/pkg_divider"
android:maxLines="1" />
<!-- Optional link to app. Only appears if the channel is not disabled and the app
<string name="notification_multichannel_desc">This group of notifications cannot be configured here</string>
<!-- Notification: Control panel: Label for the app that posted this notification, if it's not the package that the notification was posted for -->
- <string name="notification_delegate_header">via <xliff:g id="app_name" example="YouTube">%1$s</xliff:g></string>
+ <string name="notification_delegate_header">Proxied notification</string>
<!-- Notification Inline controls: describes what the app is doing in the background [CHAR_LIMIT=NONE] -->
<string name="appops_camera">This app is using the camera.</string>
CharSequence delegatePkg = null;
if (!TextUtils.equals(mPackageName, mDelegatePkg)) {
// this notification was posted by a delegate!
- ApplicationInfo info;
- try {
- info = mPm.getApplicationInfo(
- mDelegatePkg,
- PackageManager.MATCH_UNINSTALLED_PACKAGES
- | PackageManager.MATCH_DISABLED_COMPONENTS
- | PackageManager.MATCH_DIRECT_BOOT_UNAWARE
- | PackageManager.MATCH_DIRECT_BOOT_AWARE);
- if (info != null) {
- delegatePkg = String.valueOf(mPm.getApplicationLabel(info));
- }
- } catch (PackageManager.NameNotFoundException e) { }
- }
- if (delegatePkg != null) {
- delegateView.setText(mContext.getResources().getString(
- R.string.notification_delegate_header, delegatePkg));
delegateView.setVisibility(View.VISIBLE);
dividerView.setVisibility(View.VISIBLE);
} else {
IMPORTANCE_DEFAULT, true);
final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
assertEquals(VISIBLE, nameView.getVisibility());
- assertTrue(nameView.getText().toString().contains("Other"));
+ assertTrue(nameView.getText().toString().contains("Proxied"));
final TextView dividerView = mNotificationInfo.findViewById(R.id.pkg_divider);
assertEquals(VISIBLE, dividerView.getVisibility());
}