Merge "Update appearance of proxied notifications in guts" into qt-dev

am: 154862c985

Change-Id: I10cc048b6dad01b4b2af7feef213acd3cc2ee03a
This commit is contained in:
Julia Reynolds
2019-04-24 20:22:35 -07:00
committed by android-build-merger
4 changed files with 3 additions and 18 deletions

View 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

View File

@@ -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>

View 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 {

View 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());
}