diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-06-10 17:24:20 +0200 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2014-06-10 19:24:42 +0200 |
commit | 36b15237a633ca906029e6ccdc4c55fa6309afe8 (patch) | |
tree | ef4b3611a1e74cf09b0b1f8294aeb4fee89f1a89 /packages | |
parent | ac383e52a9c76dcc1a14a82848abb49b81c49f99 (diff) | |
download | frameworks_base-36b15237a633ca906029e6ccdc4c55fa6309afe8.zip frameworks_base-36b15237a633ca906029e6ccdc4c55fa6309afe8.tar.gz frameworks_base-36b15237a633ca906029e6ccdc4c55fa6309afe8.tar.bz2 |
Fix black background for auto-redacted legacy notifications
Also removes the wrongly implemented Froyo compatibility mode, as now
all the notifications are light and the background is provided by us,
it's again like in Froyo-world! :-)
Bug: 15295371
Bug: 14105711
Change-Id: Icbae15e690494465b0e63935d81d59edfa05e76e
Diffstat (limited to 'packages')
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 ce3372e..0000000 --- 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 3a50aa9..0000000 --- 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 7320fa0..0000000 --- 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 bcd37bd..bb6f1a9 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 a7af998..508c34e 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 d829ac0..631e19c 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 4749b9c..5223217 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1205,9 +1205,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); } } |