diff options
| author | 2014-06-11 11:25:07 +0000 | |
|---|---|---|
| committer | 2014-06-11 11:25:07 +0000 | |
| commit | a5c1506313dc41643cefa443d7b51bb63c18e0f2 (patch) | |
| tree | b9064cbcc2c5df6e89fa47169e7b94e324d061c6 | |
| parent | 1ab15ca80bb70d4ffc48bce0bc36c3a1d58090d1 (diff) | |
| parent | 6d7a25f317be60ae8a4d8806e517052be2398753 (diff) | |
am dc61882e: Merge "Fix black background for auto-redacted legacy notifications" into lmp-preview-dev
* commit 'dc61882ef03a25f7861aff838577ef124a8f40e7':
Fix black background for auto-redacted legacy notifications
7 files changed, 20 insertions, 82 deletions
diff --git a/packages/SystemUI/res/drawable/notification_row_legacy_bg.xml b/packages/SystemUI/res/drawable/notification_row_legacy_bg.xml deleted file mode 100644 index ce3372ee0f9b..000000000000 --- a/packages/SystemUI/res/drawable/notification_row_legacy_bg.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2011 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android" - android:exitFadeDuration="@android:integer/config_mediumAnimTime"> - - <item android:state_pressed="true" android:drawable="@drawable/notification_item_background_color_pressed" /> - <item android:state_pressed="false" android:drawable="@drawable/notification_item_background_legacy_color" /> -</selector> diff --git a/packages/SystemUI/res/drawable/status_bar_item_background.xml b/packages/SystemUI/res/drawable/status_bar_item_background.xml deleted file mode 100644 index 3a50aa957b03..000000000000 --- a/packages/SystemUI/res/drawable/status_bar_item_background.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2006 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<layer-list - xmlns:android="http://schemas.android.com/apk/res/android" - android:opacity="translucent" - > - <item - android:drawable="@drawable/notification_item_background_color" - /> -</layer-list> - diff --git a/packages/SystemUI/res/drawable/ticker_background.xml b/packages/SystemUI/res/drawable/ticker_background.xml deleted file mode 100644 index 7320fa0de803..000000000000 --- a/packages/SystemUI/res/drawable/ticker_background.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2006 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<layer-list - xmlns:android="http://schemas.android.com/apk/res/android" - android:opacity="translucent" - > - <!-- the large icon extends 12dp beyond the edge of the status bar --> - <item - android:drawable="@drawable/notification_item_background_color" - android:top="12dp" - /> -</layer-list> - diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index bcd37bdbf9fb..bb6f1a9fc25f 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -29,7 +29,6 @@ <drawable name="status_bar_notification_row_background_color">#ff090909</drawable> <color name="notification_list_shadow_top">#80000000</color> <drawable name="recents_callout_line">#99ffffff</drawable> - <drawable name="notification_item_background_legacy_color">#ffaaaaaa</drawable> <drawable name="heads_up_notification_bg_pressed">#ff33B5E5</drawable> <color name="batterymeter_frame_color">#66FFFFFF</color><!-- 40% white --> <color name="batterymeter_charge_color">#FFFFFFFF</color> @@ -42,8 +41,6 @@ <color name="qs_tile_divider">#29ffffff</color><!-- 16% white --> <color name="qs_tile_text">#FFFFFFFF</color> <color name="status_bar_clock_color">#FFFFFFFF</color> - <drawable name="notification_item_background_color">#ff111111</drawable> - <drawable name="notification_item_background_color_pressed">#ff454545</drawable> <!-- Tint color for the content on the notification overflow card. --> <color name="keyguard_overflow_content_color">#ff686868</color> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index a7af99819289..508c34eac620 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -545,12 +545,11 @@ public abstract class BaseStatusBar extends SystemUI implements if (entry.expanded.getId() != com.android.internal.R.id.status_bar_latest_event_content) { // Using custom RemoteViews - if (version > 0 && version < Build.VERSION_CODES.GINGERBREAD) { - entry.row.setBackgroundResource(R.drawable.notification_row_legacy_bg); - } else if (version < Build.VERSION_CODES.L) { + if (version >= Build.VERSION_CODES.GINGERBREAD && version < Build.VERSION_CODES.L) { entry.row.setBackgroundResourceIds( com.android.internal.R.drawable.notification_bg, com.android.internal.R.drawable.notification_bg_dim); + entry.legacy = true; } } else { // Using platform templates @@ -1026,6 +1025,7 @@ public abstract class BaseStatusBar extends SystemUI implements com.android.internal.R.id.text); text.setText("Unlock your device to see this notification."); + entry.autoRedacted = true; // TODO: fill out "time" as well } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java index d829ac0af5d7..631e19caec4e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java @@ -40,6 +40,9 @@ public class NotificationData { public View expandedPublic; // for insecure lockscreens public View expandedBig; private boolean interruption; + public boolean autoRedacted; // whether the redacted notification was generated by us + public boolean legacy; // whether the notification has a legacy, dark background + public Entry() {} public Entry(StatusBarNotification n, StatusBarIconView ic) { this.key = n.getKey(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index f86572de2d0f..a8f61f31f225 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1192,9 +1192,21 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, final int vis = ent.notification.getNotification().visibility; if (vis != Notification.VISIBILITY_SECRET) { // when isLockscreenPublicMode() we show the public form of VISIBILITY_PRIVATE notifications - ent.row.setShowingPublic(isLockscreenPublicMode() + boolean showingPublic = isLockscreenPublicMode() && vis == Notification.VISIBILITY_PRIVATE - && !userAllowsPrivateNotificationsInPublic(ent.notification.getUserId())); + && !userAllowsPrivateNotificationsInPublic(ent.notification.getUserId()); + ent.row.setShowingPublic(showingPublic); + if (ent.autoRedacted && ent.legacy) { + if (showingPublic) { + ent.row.setBackgroundResourceIds( + com.android.internal.R.drawable.notification_material_bg, + com.android.internal.R.drawable.notification_material_bg_dim); + } else { + ent.row.setBackgroundResourceIds( + com.android.internal.R.drawable.notification_bg, + com.android.internal.R.drawable.notification_bg_dim); + } + } toShow.add(ent.row); } } |