diff options
4 files changed, 3 insertions, 18 deletions
diff --git a/packages/SystemUI/res/layout/notification_info.xml b/packages/SystemUI/res/layout/notification_info.xml index a94ae0f7223b..58af4a2c24b6 100644 --- a/packages/SystemUI/res/layout/notification_info.xml +++ b/packages/SystemUI/res/layout/notification_info.xml @@ -70,6 +70,7 @@ 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 diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index a2039d07ad59..acc03c43d34c 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1679,7 +1679,7 @@ <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> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java index e6875e4d8dc3..1f8ca37315bf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java @@ -448,22 +448,6 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G 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 { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java index 02731c0e8e18..25995eb59d80 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java @@ -238,7 +238,7 @@ public class NotificationInfoTest extends SysuiTestCase { 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()); } |