OSDN Git Service

Update appearance of proxied notifications in guts
authorJulia Reynolds <juliacr@google.com>
Wed, 24 Apr 2019 15:58:38 +0000 (11:58 -0400)
committerJulia Reynolds <juliacr@google.com>
Wed, 24 Apr 2019 18:33:44 +0000 (14:33 -0400)
Test: manual
Fixes: 131174114
Change-Id: I8725d34e7f2e43c17a1d16fba8ecbe20a0a3d3c9

packages/SystemUI/res/layout/notification_info.xml
packages/SystemUI/res/values/strings.xml
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationInfo.java
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java

index a94ae0f..58af4a2 100644 (file)
@@ -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
index a2039d0..acc03c4 100644 (file)
     <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>
index e6875e4..1f8ca37 100644 (file)
@@ -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 {
index 02731c0..25995eb 100644 (file)
@@ -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());
     }