Merge "Notification guts redesign" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
388f6726ea
25
packages/SystemUI/res/drawable/button_border_selected.xml
Normal file
25
packages/SystemUI/res/drawable/button_border_selected.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2019 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.
|
||||||
|
-->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid
|
||||||
|
android:color="@color/notification_guts_selection_bg" />
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="?android:attr/colorAccent"/>
|
||||||
|
<corners android:radius="@dimen/rect_button_radius" />
|
||||||
|
</shape>
|
||||||
25
packages/SystemUI/res/drawable/button_border_unselected.xml
Normal file
25
packages/SystemUI/res/drawable/button_border_unselected.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2019 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.
|
||||||
|
-->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle"
|
||||||
|
android:color="@color/notification_guts_selection_bg">
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="@color/GM2_grey_300"/>
|
||||||
|
|
||||||
|
<corners android:radius="@dimen/rect_button_radius" />
|
||||||
|
</shape>
|
||||||
26
packages/SystemUI/res/drawable/button_ripple_radius.xml
Normal file
26
packages/SystemUI/res/drawable/button_ripple_radius.xml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2019 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.
|
||||||
|
-->
|
||||||
|
<ripple
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="?android:attr/colorControlHighlight">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/notification_guts_selection_bg" />
|
||||||
|
<corners android:radius="@dimen/rect_button_radius" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
@@ -18,18 +18,18 @@ Copyright (C) 2019 The Android Open Source Project
|
|||||||
android:id="@+id/back">
|
android:id="@+id/back">
|
||||||
<shape android:shape="oval">
|
<shape android:shape="oval">
|
||||||
<solid
|
<solid
|
||||||
android:color="@color/GM2_green_500" />
|
android:color="@color/notification_silence_color" />
|
||||||
<size
|
<size
|
||||||
android:height="36dp"
|
android:height="24dp"
|
||||||
android:width="36dp"/>
|
android:width="24dp"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/fore"
|
android:id="@+id/fore"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
<vector
|
<vector
|
||||||
android:width="32dp"
|
android:width="13dp"
|
||||||
android:height="32dp"
|
android:height="13dp"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
|
|||||||
@@ -19,18 +19,18 @@ Copyright (C) 2019 The Android Open Source Project
|
|||||||
android:id="@+id/back">
|
android:id="@+id/back">
|
||||||
<shape android:shape="oval">
|
<shape android:shape="oval">
|
||||||
<solid
|
<solid
|
||||||
android:color="@color/GM2_yellow_500" />
|
android:color="@color/notification_alert_color" />
|
||||||
<size
|
<size
|
||||||
android:height="36dp"
|
android:height="24dp"
|
||||||
android:width="36dp"/>
|
android:width="24dp"/>
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/fore"
|
android:id="@+id/fore"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
<vector
|
<vector
|
||||||
android:width="32dp"
|
android:width="13dp"
|
||||||
android:height="32dp"
|
android:height="13dp"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24">
|
||||||
<path
|
<path
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:clipChildren="false"
|
android:clipChildren="false"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="true"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingStart="@*android:dimen/notification_content_margin_start"
|
android:paddingStart="@*android:dimen/notification_content_margin_start"
|
||||||
android:background="@color/notification_guts_bg_color">
|
android:background="@color/notification_guts_bg_color">
|
||||||
@@ -39,69 +39,62 @@
|
|||||||
android:layout_width="@dimen/notification_guts_header_height"
|
android:layout_width="@dimen/notification_guts_header_height"
|
||||||
android:layout_height="@dimen/notification_guts_header_height"
|
android:layout_height="@dimen/notification_guts_header_height"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
android:layout_marginEnd="3dp" />
|
android:layout_marginEnd="3dp" />
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/pkgname"
|
android:id="@+id/pkgname"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/TextAppearance.NotificationInfo.Primary"
|
android:layout_centerVertical="true"
|
||||||
|
style="@style/TextAppearance.NotificationImportanceHeader"
|
||||||
android:layout_marginStart="3dp"
|
android:layout_marginStart="3dp"
|
||||||
android:layout_marginEnd="2dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:singleLine="true"
|
android:layout_toEndOf="@id/pkgicon"
|
||||||
android:layout_centerVertical="true"
|
android:singleLine="true" />
|
||||||
android:layout_toEndOf="@id/pkgicon" />
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/pkg_divider"
|
android:id="@+id/pkg_divider"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/TextAppearance.NotificationInfo.Primary"
|
android:layout_centerVertical="true"
|
||||||
|
style="@style/TextAppearance.NotificationImportanceHeader"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:layout_marginEnd="2dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:text="@*android:string/notification_header_divider_symbol"
|
android:layout_toEndOf="@id/pkgname"
|
||||||
android:layout_centerVertical="true"
|
android:text="@*android:string/notification_header_divider_symbol" />
|
||||||
android:layout_toEndOf="@id/pkgname" />
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/delegate_name"
|
android:id="@+id/delegate_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/TextAppearance.NotificationInfo.Primary"
|
android:layout_centerVertical="true"
|
||||||
|
style="@style/TextAppearance.NotificationImportanceHeader"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_marginStart="2dp"
|
||||||
android:layout_marginEnd="2dp"
|
android:layout_marginEnd="2dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxLines="1"
|
android:layout_toEndOf="@id/pkg_divider"
|
||||||
android:layout_centerVertical="true"
|
android:maxLines="1" />
|
||||||
android:layout_toEndOf="@id/pkg_divider" />
|
<!-- Optional link to app. Only appears if the channel is not disabled and the app
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/info_and_settings"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<!-- Optional link to app. Only appears if the channel is not disabled and the app
|
|
||||||
asked for it -->
|
asked for it -->
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/app_settings"
|
android:id="@+id/app_settings"
|
||||||
android:layout_width="48dp"
|
android:layout_width="@dimen/notification_importance_toggle_size"
|
||||||
android:layout_height="48dp"
|
android:layout_height="@dimen/notification_importance_toggle_size"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:background="@drawable/ripple_drawable"
|
android:background="@drawable/ripple_drawable"
|
||||||
android:contentDescription="@string/notification_app_settings"
|
android:contentDescription="@string/notification_app_settings"
|
||||||
android:src="@drawable/ic_info"
|
android:src="@drawable/ic_info"
|
||||||
android:tint="@color/notification_guts_link_icon_tint" />
|
android:layout_toStartOf="@id/info"
|
||||||
<!-- 24 dp icon with 16 dp padding all around to mirror notification content margins -->
|
android:tint="@color/notification_guts_link_icon_tint"/>
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/info"
|
android:id="@+id/info"
|
||||||
android:layout_width="48dp"
|
android:layout_width="@dimen/notification_importance_toggle_size"
|
||||||
android:layout_height="48dp"
|
android:layout_height="@dimen/notification_importance_toggle_size"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:background="@drawable/ripple_drawable"
|
android:background="@drawable/ripple_drawable"
|
||||||
android:contentDescription="@string/notification_more_settings"
|
android:contentDescription="@string/notification_more_settings"
|
||||||
android:src="@drawable/ic_settings"
|
android:src="@drawable/ic_settings"
|
||||||
android:tint="@color/notification_guts_link_icon_tint" />
|
android:layout_alignParentEnd="true"
|
||||||
</LinearLayout>
|
android:tint="@color/notification_guts_link_icon_tint"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<!-- Channel Info Block -->
|
<!-- Channel Info Block -->
|
||||||
@@ -111,40 +104,22 @@ asked for it -->
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
||||||
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
||||||
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<RelativeLayout
|
<!-- Channel Name -->
|
||||||
android:id="@+id/names"
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/channel_name"
|
||||||
android:layout_height="wrap_content">
|
android:layout_width="wrap_content"
|
||||||
<TextView
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/group_name"
|
android:layout_weight="1"
|
||||||
android:layout_width="wrap_content"
|
style="@style/TextAppearance.NotificationImportanceChannel"/>
|
||||||
android:layout_height="wrap_content"
|
<TextView
|
||||||
style="@style/TextAppearance.NotificationInfo.Primary"
|
android:id="@+id/group_name"
|
||||||
android:layout_marginStart="2dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_marginEnd="2dp"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
style="@style/TextAppearance.NotificationImportanceChannelGroup"
|
||||||
android:maxLines="1"
|
android:ellipsize="end"
|
||||||
android:layout_centerVertical="true" />
|
android:maxLines="1"/>
|
||||||
<TextView
|
|
||||||
android:id="@+id/pkg_group_divider"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
style="@style/TextAppearance.NotificationInfo.Primary"
|
|
||||||
android:layout_marginStart="2dp"
|
|
||||||
android:layout_marginEnd="2dp"
|
|
||||||
android:text="@*android:string/notification_header_divider_symbol"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_toEndOf="@id/group_name" />
|
|
||||||
<!-- Channel Name -->
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/channel_name"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
style="@style/TextAppearance.NotificationInfo.Primary"
|
|
||||||
android:layout_toEndOf="@id/pkg_group_divider"/>
|
|
||||||
</RelativeLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -212,8 +187,8 @@ asked for it -->
|
|||||||
android:id="@+id/inline_controls"
|
android:id="@+id/inline_controls"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
|
||||||
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
||||||
|
android:layout_marginTop="@dimen/notification_guts_option_vertical_padding"
|
||||||
android:clipChildren="false"
|
android:clipChildren="false"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
@@ -225,7 +200,6 @@ asked for it -->
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/notification_guts_option_vertical_padding"
|
|
||||||
style="@*android:style/TextAppearance.DeviceDefault.Notification" />
|
style="@*android:style/TextAppearance.DeviceDefault.Notification" />
|
||||||
|
|
||||||
<!-- Non configurable multichannel text. appears instead of @+id/interruptiveness_settings-->
|
<!-- Non configurable multichannel text. appears instead of @+id/interruptiveness_settings-->
|
||||||
@@ -235,7 +209,6 @@ asked for it -->
|
|||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/notification_guts_option_vertical_padding"
|
|
||||||
style="@*android:style/TextAppearance.DeviceDefault.Notification" />
|
style="@*android:style/TextAppearance.DeviceDefault.Notification" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -243,105 +216,68 @@ asked for it -->
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<!-- Interruptive row -->
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/alert_row"
|
android:id="@+id/buttons"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/notification_guts_option_vertical_padding"
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="@dimen/notification_guts_option_vertical_padding"
|
android:gravity="center">
|
||||||
android:paddingStart="@dimen/notification_guts_option_horizontal_padding"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<ImageView
|
<Button
|
||||||
android:id="@+id/int_alert"
|
android:id="@+id/alert"
|
||||||
android:src="@drawable/ic_notification_interruptive"
|
android:minWidth="@dimen/notification_importance_button_width"
|
||||||
android:background="@android:color/transparent"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@string/inline_silent_button_alert"/>
|
android:minHeight="@dimen/notification_importance_toggle_size"
|
||||||
|
android:paddingStart="@dimen/notification_importance_button_horiz_padding"
|
||||||
|
android:paddingEnd="@dimen/notification_importance_button_horiz_padding"
|
||||||
|
android:drawablePadding="@dimen/notification_importance_drawable_padding"
|
||||||
|
android:foreground="@drawable/button_ripple_radius"
|
||||||
|
android:drawableLeft="@drawable/ic_notification_interruptive"
|
||||||
|
android:text="@string/notification_alert_title" />
|
||||||
|
|
||||||
<LinearLayout
|
<Button
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/silence"
|
||||||
|
android:minWidth="@dimen/notification_importance_button_width"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="@dimen/notification_guts_option_horizontal_padding"
|
android:minHeight="@dimen/notification_importance_toggle_size"
|
||||||
android:paddingEnd="@dimen/notification_guts_option_horizontal_padding"
|
android:paddingStart="@dimen/notification_importance_button_horiz_padding"
|
||||||
android:orientation="vertical">
|
android:paddingEnd="@dimen/notification_importance_button_horiz_padding"
|
||||||
<TextView
|
android:drawablePadding="@dimen/notification_importance_drawable_padding"
|
||||||
android:id="@+id/int_alert_label"
|
android:foreground="@drawable/button_ripple_radius"
|
||||||
android:text="@string/inline_silent_button_alert"
|
android:layout_marginStart="@dimen/notification_importance_button_separation"
|
||||||
android:layout_width="match_parent"
|
android:drawableLeft="@drawable/ic_notification_gentle"
|
||||||
android:layout_height="wrap_content"
|
android:text="@string/notification_silence_title" />
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
style="@style/TextAppearance.NotificationInfo.Primary"/>
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/int_alert_summary"
|
|
||||||
android:text="@string/hint_text_alert"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
style="@style/TextAppearance.NotificationInfo.Secondary"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Gentle row -->
|
<TextView
|
||||||
<LinearLayout
|
android:id="@+id/description"
|
||||||
android:id="@+id/silent_row"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/notification_guts_option_vertical_padding"
|
android:text="@string/notification_alert_title"
|
||||||
android:paddingBottom="@dimen/notification_guts_option_vertical_padding"
|
android:gravity="center"
|
||||||
android:paddingStart="@dimen/notification_guts_option_horizontal_padding"
|
android:layout_marginTop="@dimen/notification_importance_text_marginTop"
|
||||||
android:layout_marginTop="@dimen/notification_guts_option_vertical_margin"
|
android:paddingStart="@dimen/notification_importance_description_padding"
|
||||||
android:orientation="horizontal">
|
android:paddingEnd="@dimen/notification_importance_description_padding"
|
||||||
<ImageView
|
android:textAppearance="@style/TextAppearance.NotificationImportanceDetail" />
|
||||||
android:id="@+id/int_silent"
|
|
||||||
android:src="@drawable/ic_notification_gentle"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="36dp"
|
|
||||||
android:layout_height="36dp"
|
|
||||||
android:background="@android:color/transparent"
|
|
||||||
android:contentDescription="@string/inline_silent_button_silent"/>
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingStart="@dimen/notification_guts_option_horizontal_padding"
|
|
||||||
android:paddingEnd="@dimen/notification_guts_option_horizontal_padding">
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/int_silent_label"
|
|
||||||
android:text="@string/inline_silent_button_silent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:maxLines="1"
|
|
||||||
style="@style/TextAppearance.NotificationInfo.Primary"/>
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/int_silent_summary"
|
|
||||||
android:text="@string/hint_text_silent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:ellipsize="end"
|
|
||||||
style="@style/TextAppearance.NotificationInfo.Secondary"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/bottom_buttons"
|
android:id="@+id/bottom_buttons"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/notification_guts_button_spacing"
|
android:paddingTop="@dimen/notification_guts_button_spacing" >
|
||||||
android:paddingBottom="@dimen/notification_guts_button_spacing">
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/turn_off_notifications"
|
android:id="@+id/turn_off_notifications"
|
||||||
android:text="@string/inline_turn_off_notifications"
|
android:text="@string/inline_turn_off_notifications"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:minWidth="@dimen/notification_importance_toggle_size"
|
||||||
|
android:minHeight="@dimen/notification_importance_toggle_size"
|
||||||
android:maxWidth="200dp"
|
android:maxWidth="200dp"
|
||||||
style="@style/TextAppearance.NotificationInfo.Button"/>
|
style="@style/TextAppearance.NotificationInfo.Button"/>
|
||||||
<TextView
|
<TextView
|
||||||
@@ -351,6 +287,8 @@ asked for it -->
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:maxWidth="125dp"
|
android:maxWidth="125dp"
|
||||||
|
android:minWidth="@dimen/notification_importance_toggle_size"
|
||||||
|
android:minHeight="@dimen/notification_importance_toggle_size"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
style="@style/TextAppearance.NotificationInfo.Button"/>
|
style="@style/TextAppearance.NotificationInfo.Button"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -376,6 +314,8 @@ asked for it -->
|
|||||||
android:id="@+id/undo"
|
android:id="@+id/undo"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="@dimen/notification_importance_toggle_size"
|
||||||
|
android:minHeight="@dimen/notification_importance_toggle_size"
|
||||||
android:layout_marginTop="@dimen/notification_guts_button_spacing"
|
android:layout_marginTop="@dimen/notification_guts_button_spacing"
|
||||||
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
android:layout_marginBottom="@dimen/notification_guts_button_spacing"
|
||||||
android:layout_marginStart="@dimen/notification_guts_button_side_margin"
|
android:layout_marginStart="@dimen/notification_guts_button_side_margin"
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
<color name="notification_guts_selection_bg">#202124</color>
|
<color name="notification_guts_selection_bg">#202124</color>
|
||||||
<color name="notification_guts_selection_border">#669DF6</color>
|
<color name="notification_guts_selection_border">#669DF6</color>
|
||||||
<color name="notification_guts_link_icon_tint">@color/GM2_grey_200</color>
|
<color name="notification_guts_link_icon_tint">@color/GM2_grey_200</color>
|
||||||
|
<color name="notification_guts_sub_text_color">@color/GM2_grey_200</color>
|
||||||
|
<color name="notification_guts_header_text_color">@color/GM2_grey_100</color>
|
||||||
|
|
||||||
<!-- The color of the background in the top part of QSCustomizer -->
|
<!-- The color of the background in the top part of QSCustomizer -->
|
||||||
<color name="qs_customize_background">@color/GM2_grey_900</color>
|
<color name="qs_customize_background">@color/GM2_grey_900</color>
|
||||||
|
|||||||
@@ -90,7 +90,11 @@
|
|||||||
|
|
||||||
<color name="notification_guts_selection_bg">#FFFFFF</color>
|
<color name="notification_guts_selection_bg">#FFFFFF</color>
|
||||||
<color name="notification_guts_selection_border">#4285F4</color>
|
<color name="notification_guts_selection_border">#4285F4</color>
|
||||||
<color name="notification_guts_link_icon_tint">@color/GM2_grey_900</color>
|
<color name="notification_guts_link_icon_tint">@color/GM2_grey_700</color>
|
||||||
|
<color name="notification_guts_sub_text_color">@color/GM2_grey_700</color>
|
||||||
|
<color name="notification_guts_header_text_color">@color/GM2_grey_900</color>
|
||||||
|
<color name="notification_silence_color">#FF32c1de</color>
|
||||||
|
<color name="notification_alert_color">#FFF87B2B</color>
|
||||||
|
|
||||||
<color name="assist_orb_color">#ffffff</color>
|
<color name="assist_orb_color">#ffffff</color>
|
||||||
|
|
||||||
|
|||||||
@@ -206,11 +206,26 @@
|
|||||||
<dimen name="notification_guts_option_horizontal_padding">15dp</dimen>
|
<dimen name="notification_guts_option_horizontal_padding">15dp</dimen>
|
||||||
|
|
||||||
<!-- The vertical space between items in the alert selections in the inline settings -->
|
<!-- The vertical space between items in the alert selections in the inline settings -->
|
||||||
<dimen name="notification_guts_option_vertical_padding">15dp</dimen>
|
<dimen name="notification_guts_option_vertical_padding">24dp</dimen>
|
||||||
|
|
||||||
<!-- The vertical space between the alert selections in the inline settings -->
|
<!-- The vertical space between the alert selections in the inline settings -->
|
||||||
<dimen name="notification_guts_option_vertical_margin">6dp</dimen>
|
<dimen name="notification_guts_option_vertical_margin">6dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="notification_importance_toggle_size">48dp</dimen>
|
||||||
|
<dimen name="notification_importance_toggle_marginTop">28dp</dimen>
|
||||||
|
<dimen name="notification_importance_toggle_marginBottom">28dp</dimen>
|
||||||
|
<dimen name="notification_importance_text_marginTop">20dp</dimen>
|
||||||
|
<dimen name="notification_importance_button_separation">16dp</dimen>
|
||||||
|
<dimen name="notification_importance_button_width">178dp</dimen>
|
||||||
|
<dimen name="notification_importance_button_horiz_padding">28dp</dimen>
|
||||||
|
<dimen name="notification_importance_drawable_padding">8dp</dimen>
|
||||||
|
<dimen name="notification_importance_description_padding">20dp</dimen>
|
||||||
|
<dimen name="notification_importance_description_text">12sp</dimen>
|
||||||
|
<dimen name="notification_importance_channel_text">16sp</dimen>
|
||||||
|
<dimen name="notification_importance_channel_group_text">14sp</dimen>
|
||||||
|
<dimen name="notification_importance_button_text">16sp</dimen>
|
||||||
|
<dimen name="rect_button_radius">8dp</dimen>
|
||||||
|
|
||||||
<!-- The minimum height for the snackbar shown after the snooze option has been chosen. -->
|
<!-- The minimum height for the snackbar shown after the snooze option has been chosen. -->
|
||||||
<dimen name="snooze_snackbar_min_height">56dp</dimen>
|
<dimen name="snooze_snackbar_min_height">56dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -1651,17 +1651,29 @@
|
|||||||
<!-- Notification Inline controls: continue receiving notifications prompt, app level -->
|
<!-- Notification Inline controls: continue receiving notifications prompt, app level -->
|
||||||
<string name="inline_keep_showing_app">Keep showing notifications from this app?</string>
|
<string name="inline_keep_showing_app">Keep showing notifications from this app?</string>
|
||||||
|
|
||||||
<!-- Hint text for block button in the interruptiveness settings [CHAR_LIMIT=NONE]-->
|
<!-- [CHAR LIMIT=100] Notification Importance title -->
|
||||||
<string name="hint_text_block">Blocked notifications do not appear anywhere or play a sound. You can unblock notifications in settings.</string>
|
<string name="notification_silence_title">Gentle</string>
|
||||||
|
|
||||||
<!-- Hint text for silent button in the interruptiveness settings [CHAR_LIMIT=NONE]-->
|
<!-- [CHAR LIMIT=100] Notification Importance title -->
|
||||||
<string name="hint_text_silent">Silent notifications appear in the shade, but do not appear on the lock screen, present a banner, or play a sound.</string>
|
<string name="notification_alert_title">Prioritized</string>
|
||||||
|
|
||||||
<!-- Hint text for alert button in the interruptiveness settings [CHAR_LIMIT=NONE]-->
|
<!-- [CHAR LIMIT=150] Notification Importance title: low importance level summary -->
|
||||||
<string name="hint_text_alert">These notifications will make a sound and show in the notification drawer, status bar, and lock screen</string>
|
<string name="notification_channel_summary_low">Always silent. Displays in pull-down shade.</string>
|
||||||
|
|
||||||
|
<!-- [CHAR LIMIT=150] Notification Importance title: low importance level summary -->
|
||||||
|
<string name="notification_channel_summary_low_status">Always silent. Displays in pull-down shade & status bar.</string>
|
||||||
|
|
||||||
|
<!-- [CHAR LIMIT=150] Notification Importance title: low importance level summary -->
|
||||||
|
<string name="notification_channel_summary_low_lock">Always silent. Displays in pull-down shade & on lock screen.</string>
|
||||||
|
|
||||||
|
<!-- [CHAR LIMIT=150] Notification Importance title: low importance level summary -->
|
||||||
|
<string name="notification_channel_summary_low_status_lock">Always silent. Displays in pull-down shade, status bar & on lock screen.</string>
|
||||||
|
|
||||||
|
<!-- [CHAR LIMIT=150] Notification Importance title: normal importance level summary -->
|
||||||
|
<string name="notification_channel_summary_default">Makes sound and displays in pull-down shade, status bar & on lock screen.</string>
|
||||||
|
|
||||||
<!-- Notification: Control panel: Label that displays when the app's notifications cannot be blocked. -->
|
<!-- Notification: Control panel: Label that displays when the app's notifications cannot be blocked. -->
|
||||||
<string name="notification_unblockable_desc">These notifications can\'t be turned off</string>
|
<string name="notification_unblockable_desc">These notifications can\'t be modified.</string>
|
||||||
|
|
||||||
<!-- Notification: Control panel: label that displays when viewing settings for a group of notifications posted to multiple channels. -->
|
<!-- Notification: Control panel: label that displays when viewing settings for a group of notifications posted to multiple channels. -->
|
||||||
<string name="notification_multichannel_desc">This group of notifications cannot be configured here</string>
|
<string name="notification_multichannel_desc">This group of notifications cannot be configured here</string>
|
||||||
|
|||||||
@@ -426,57 +426,71 @@
|
|||||||
<style name="TunerPreferenceTheme" parent="@style/PreferenceThemeOverlay.SettingsBase">
|
<style name="TunerPreferenceTheme" parent="@style/PreferenceThemeOverlay.SettingsBase">
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo">
|
|
||||||
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
|
|
||||||
<item name="android:textColor">@color/notification_primary_text_color</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo.Primary">
|
|
||||||
<item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
|
|
||||||
<item name="android:textSize">16sp</item>
|
|
||||||
<item name="android:alpha">0.87</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo.Confirmation">
|
<style name="TextAppearance.NotificationInfo.Confirmation">
|
||||||
<item name="android:textSize">14sp</item>
|
<item name="android:textSize">14sp</item>
|
||||||
<item name="android:alpha">0.87</item>
|
<item name="android:alpha">0.87</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.NotificationInfo">
|
||||||
|
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
|
||||||
|
<item name="android:textColor">@color/notification_primary_text_color</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo.Secondary">
|
<style name="TextAppearance.NotificationInfo.Secondary">
|
||||||
<item name="android:textSize">14sp</item>
|
<item name="android:textSize">14sp</item>
|
||||||
<item name="android:alpha">0.54</item>
|
<item name="android:alpha">0.54</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo.ButtonLabel">
|
|
||||||
<item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
|
|
||||||
<item name="android:textSize">14sp</item>
|
|
||||||
<item name="android:alpha">0.54</item>
|
|
||||||
<item name="android:paddingTop">4dp</item>
|
|
||||||
<item name="android:paddingBottom">16dp</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo.HintText">
|
|
||||||
<item name="android:textSize">12sp</item>
|
|
||||||
<item name="android:alpha">0.54</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo.Secondary.Warning">
|
|
||||||
<item name="android:textColor">?android:attr/colorError</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo.Secondary.Link">
|
|
||||||
<item name="android:textColor">?android:attr/colorAccent</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="TextAppearance.NotificationInfo.Button">
|
<style name="TextAppearance.NotificationInfo.Button">
|
||||||
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
|
<item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
|
||||||
<item name="android:textSize">16sp</item>
|
<item name="android:textSize">16sp</item>
|
||||||
<item name="android:textColor">?android:attr/colorAccent</item>
|
<item name="android:textColor">?android:attr/colorAccent</item>
|
||||||
<item name="android:background">@drawable/btn_borderless_rect</item>
|
<item name="android:background">@drawable/btn_borderless_rect</item>
|
||||||
<item name="android:gravity">center</item>
|
<item name="android:gravity">center_vertical</item>
|
||||||
<item name="android:focusable">true</item>
|
<item name="android:focusable">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.NotificationImportanceChannel">
|
||||||
|
<item name="android:textSize">@dimen/notification_importance_channel_text</item>
|
||||||
|
<item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
|
||||||
|
<item name="android:textColor">@color/notification_guts_header_text_color</item>
|
||||||
|
<item name="android:textSize">@dimen/notification_importance_channel_text</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.NotificationImportanceChannelGroup">
|
||||||
|
<item name="android:textSize">@dimen/notification_importance_channel_group_text</item>
|
||||||
|
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
|
||||||
|
<item name="android:textColor">@color/notification_guts_sub_text_color</item>
|
||||||
|
<item name="android:textSize">@dimen/notification_importance_channel_group_text</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.NotificationImportanceHeader">
|
||||||
|
<item name="android:textSize">@dimen/notification_importance_description_text</item>
|
||||||
|
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
|
||||||
|
<item name="android:textColor">@color/notification_guts_header_text_color</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.NotificationImportanceDetail">
|
||||||
|
<item name="android:textSize">@dimen/notification_importance_description_text</item>
|
||||||
|
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
|
||||||
|
<item name="android:textColor">@color/notification_guts_sub_text_color</item>
|
||||||
|
<item name="android:gravity">center</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.NotificationImportanceButton">
|
||||||
|
<item name="android:textSize">@dimen/notification_importance_button_text</item>
|
||||||
|
<item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
|
||||||
|
<item name="android:gravity">center</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.NotificationImportanceButton.Selected" parent="TextAppearance.NotificationImportanceButton">
|
||||||
|
<item name="android:textColor">?android:attr/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="TextAppearance.NotificationImportanceButton.Unselected" parent="TextAppearance.NotificationImportanceButton">
|
||||||
|
<item name="android:textColor">?android:attr/textColorPrimary</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.HeadsUpStatusBarText"
|
<style name="TextAppearance.HeadsUpStatusBarText"
|
||||||
parent="@*android:style/TextAppearance.DeviceDefault.Notification.Info">
|
parent="@*android:style/TextAppearance.DeviceDefault.Notification.Info">
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ package com.android.systemui.statusbar.notification.row;
|
|||||||
|
|
||||||
import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
|
import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
|
||||||
import static android.app.NotificationManager.IMPORTANCE_LOW;
|
import static android.app.NotificationManager.IMPORTANCE_LOW;
|
||||||
import static android.app.NotificationManager.IMPORTANCE_MIN;
|
import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED;
|
||||||
import static android.app.NotificationManager.IMPORTANCE_NONE;
|
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
@@ -37,9 +36,7 @@ import android.content.pm.ActivityInfo;
|
|||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.graphics.drawable.GradientDrawable;
|
|
||||||
import android.metrics.LogMaker;
|
import android.metrics.LogMaker;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
@@ -60,7 +57,6 @@ import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
|||||||
import com.android.systemui.Dependency;
|
import com.android.systemui.Dependency;
|
||||||
import com.android.systemui.Interpolators;
|
import com.android.systemui.Interpolators;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.statusbar.notification.NotificationUtils;
|
|
||||||
import com.android.systemui.statusbar.notification.logging.NotificationCounters;
|
import com.android.systemui.statusbar.notification.logging.NotificationCounters;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -104,6 +100,8 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
private NotificationChannel mSingleNotificationChannel;
|
private NotificationChannel mSingleNotificationChannel;
|
||||||
private int mStartingChannelImportance;
|
private int mStartingChannelImportance;
|
||||||
private boolean mWasShownHighPriority;
|
private boolean mWasShownHighPriority;
|
||||||
|
private boolean mShowOnLockscreen;
|
||||||
|
private boolean mShowInStatusBar;
|
||||||
/**
|
/**
|
||||||
* The last importance level chosen by the user. Null if the user has not chosen an importance
|
* The last importance level chosen by the user. Null if the user has not chosen an importance
|
||||||
* level; non-null once the user takes an action which indicates an explicit preference.
|
* level; non-null once the user takes an action which indicates an explicit preference.
|
||||||
@@ -119,7 +117,8 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
private OnSettingsClickListener mOnSettingsClickListener;
|
private OnSettingsClickListener mOnSettingsClickListener;
|
||||||
private OnAppSettingsClickListener mAppSettingsClickListener;
|
private OnAppSettingsClickListener mAppSettingsClickListener;
|
||||||
private NotificationGuts mGutsContainer;
|
private NotificationGuts mGutsContainer;
|
||||||
private GradientDrawable mSelectedBackground;
|
private Drawable mSelectedBackground;
|
||||||
|
private Drawable mUnselectedBackground;
|
||||||
|
|
||||||
/** Whether this view is being shown as part of the blocking helper. */
|
/** Whether this view is being shown as part of the blocking helper. */
|
||||||
private boolean mIsForBlockingHelper;
|
private boolean mIsForBlockingHelper;
|
||||||
@@ -133,6 +132,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
private OnClickListener mOnAlert = v -> {
|
private OnClickListener mOnAlert = v -> {
|
||||||
mExitReason = NotificationCounters.BLOCKING_HELPER_KEEP_SHOWING;
|
mExitReason = NotificationCounters.BLOCKING_HELPER_KEEP_SHOWING;
|
||||||
mChosenImportance = IMPORTANCE_DEFAULT;
|
mChosenImportance = IMPORTANCE_DEFAULT;
|
||||||
|
setImportanceSummary(ACTION_ALERT);
|
||||||
updateButtons(ACTION_ALERT);
|
updateButtons(ACTION_ALERT);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -140,6 +140,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
private OnClickListener mOnSilent = v -> {
|
private OnClickListener mOnSilent = v -> {
|
||||||
mExitReason = NotificationCounters.BLOCKING_HELPER_DELIVER_SILENTLY;
|
mExitReason = NotificationCounters.BLOCKING_HELPER_DELIVER_SILENTLY;
|
||||||
mChosenImportance = IMPORTANCE_LOW;
|
mChosenImportance = IMPORTANCE_LOW;
|
||||||
|
setImportanceSummary(ACTION_TOGGLE_SILENT);
|
||||||
updateButtons(ACTION_TOGGLE_SILENT);
|
updateButtons(ACTION_TOGGLE_SILENT);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -276,14 +277,8 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
mDelegatePkg = mSbn.getOpPkg();
|
mDelegatePkg = mSbn.getOpPkg();
|
||||||
mIsDeviceProvisioned = isDeviceProvisioned;
|
mIsDeviceProvisioned = isDeviceProvisioned;
|
||||||
|
|
||||||
mSelectedBackground = new GradientDrawable();
|
mSelectedBackground = mContext.getDrawable(R.drawable.button_border_selected);
|
||||||
mSelectedBackground.setShape(GradientDrawable.RECTANGLE);
|
mUnselectedBackground = mContext.getDrawable(R.drawable.button_border_unselected);
|
||||||
mSelectedBackground.setColor(mContext.getColor(R.color.notification_guts_selection_bg));
|
|
||||||
final float cornerRadii = getResources().getDisplayMetrics().density * 8;
|
|
||||||
mSelectedBackground.setCornerRadii(new float[]{cornerRadii, cornerRadii, cornerRadii,
|
|
||||||
cornerRadii, cornerRadii, cornerRadii, cornerRadii, cornerRadii});
|
|
||||||
mSelectedBackground.setStroke((int) (getResources().getDisplayMetrics().density * 2),
|
|
||||||
mContext.getColor(R.color.notification_guts_selection_border));
|
|
||||||
|
|
||||||
int numTotalChannels = mINotificationManager.getNumNotificationChannelsForPackage(
|
int numTotalChannels = mINotificationManager.getNumNotificationChannelsForPackage(
|
||||||
pkg, mAppUid, false /* includeDeleted */);
|
pkg, mAppUid, false /* includeDeleted */);
|
||||||
@@ -297,6 +292,10 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
&& numTotalChannels == 1;
|
&& numTotalChannels == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mShowInStatusBar = !mINotificationManager.shouldHideSilentStatusIcons(
|
||||||
|
mContext.getPackageName());
|
||||||
|
// TODO: b/128445911 use show on lockscreen setting
|
||||||
|
|
||||||
bindHeader();
|
bindHeader();
|
||||||
bindChannelDetails();
|
bindChannelDetails();
|
||||||
|
|
||||||
@@ -334,6 +333,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
findViewById(R.id.non_configurable_text).setVisibility(VISIBLE);
|
findViewById(R.id.non_configurable_text).setVisibility(VISIBLE);
|
||||||
findViewById(R.id.non_configurable_multichannel_text).setVisibility(GONE);
|
findViewById(R.id.non_configurable_multichannel_text).setVisibility(GONE);
|
||||||
findViewById(R.id.interruptiveness_settings).setVisibility(GONE);
|
findViewById(R.id.interruptiveness_settings).setVisibility(GONE);
|
||||||
|
((TextView) findViewById(R.id.done)).setText(R.string.inline_done_button);
|
||||||
} else if (mNumUniqueChannelsInRow > 1) {
|
} else if (mNumUniqueChannelsInRow > 1) {
|
||||||
findViewById(R.id.non_configurable_text).setVisibility(GONE);
|
findViewById(R.id.non_configurable_text).setVisibility(GONE);
|
||||||
findViewById(R.id.interruptiveness_settings).setVisibility(GONE);
|
findViewById(R.id.interruptiveness_settings).setVisibility(GONE);
|
||||||
@@ -353,15 +353,17 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
done.setOnClickListener(mOnDismissSettings);
|
done.setOnClickListener(mOnDismissSettings);
|
||||||
|
|
||||||
|
|
||||||
View silent = findViewById(R.id.silent_row);
|
View silent = findViewById(R.id.silence);
|
||||||
View alert = findViewById(R.id.alert_row);
|
View alert = findViewById(R.id.alert);
|
||||||
silent.setOnClickListener(mOnSilent);
|
silent.setOnClickListener(mOnSilent);
|
||||||
alert.setOnClickListener(mOnAlert);
|
alert.setOnClickListener(mOnAlert);
|
||||||
|
|
||||||
if (mWasShownHighPriority) {
|
if (mWasShownHighPriority) {
|
||||||
updateButtons(ACTION_ALERT);
|
updateButtons(ACTION_ALERT);
|
||||||
|
setImportanceSummary(ACTION_ALERT);
|
||||||
} else {
|
} else {
|
||||||
updateButtons(ACTION_TOGGLE_SILENT);
|
updateButtons(ACTION_TOGGLE_SILENT);
|
||||||
|
setImportanceSummary(ACTION_TOGGLE_SILENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,14 +484,11 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextView groupNameView = findViewById(R.id.group_name);
|
TextView groupNameView = findViewById(R.id.group_name);
|
||||||
TextView groupDividerView = findViewById(R.id.pkg_group_divider);
|
|
||||||
if (groupName != null) {
|
if (groupName != null) {
|
||||||
groupNameView.setText(groupName);
|
groupNameView.setText(groupName);
|
||||||
groupNameView.setVisibility(View.VISIBLE);
|
groupNameView.setVisibility(View.VISIBLE);
|
||||||
groupDividerView.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
} else {
|
||||||
groupNameView.setVisibility(View.GONE);
|
groupNameView.setVisibility(View.GONE);
|
||||||
groupDividerView.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,9 +503,9 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
private boolean hasImportanceChanged() {
|
private boolean hasImportanceChanged() {
|
||||||
return mSingleNotificationChannel != null
|
return mSingleNotificationChannel != null
|
||||||
&& mChosenImportance != null
|
&& mChosenImportance != null
|
||||||
&& (mStartingChannelImportance != mChosenImportance
|
&& (mStartingChannelImportance == IMPORTANCE_UNSPECIFIED
|
||||||
|| (mWasShownHighPriority && mChosenImportance < IMPORTANCE_DEFAULT)
|
|| (mWasShownHighPriority && mChosenImportance < IMPORTANCE_DEFAULT)
|
||||||
|| (!mWasShownHighPriority && mChosenImportance >= IMPORTANCE_DEFAULT));
|
|| (!mWasShownHighPriority && mChosenImportance >= IMPORTANCE_DEFAULT));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveImportance() {
|
private void saveImportance() {
|
||||||
@@ -526,29 +525,76 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
if (mChosenImportance != null) {
|
if (mChosenImportance != null) {
|
||||||
mMetricsLogger.write(importanceChangeLogMaker());
|
mMetricsLogger.write(importanceChangeLogMaker());
|
||||||
|
|
||||||
|
int newImportance = mChosenImportance;
|
||||||
|
if (mStartingChannelImportance != IMPORTANCE_UNSPECIFIED) {
|
||||||
|
if ((mWasShownHighPriority && mChosenImportance >= IMPORTANCE_DEFAULT)
|
||||||
|
|| (!mWasShownHighPriority && mChosenImportance < IMPORTANCE_DEFAULT)) {
|
||||||
|
newImportance = mStartingChannelImportance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Handler bgHandler = new Handler(Dependency.get(Dependency.BG_LOOPER));
|
Handler bgHandler = new Handler(Dependency.get(Dependency.BG_LOOPER));
|
||||||
bgHandler.post(
|
bgHandler.post(
|
||||||
new UpdateImportanceRunnable(mINotificationManager, mPackageName, mAppUid,
|
new UpdateImportanceRunnable(mINotificationManager, mPackageName, mAppUid,
|
||||||
mNumUniqueChannelsInRow == 1 ? mSingleNotificationChannel : null,
|
mNumUniqueChannelsInRow == 1 ? mSingleNotificationChannel : null,
|
||||||
mStartingChannelImportance, mChosenImportance));
|
mStartingChannelImportance, newImportance));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateButtons(int blockState) {
|
private void updateButtons(int blockState) {
|
||||||
View silent = findViewById(R.id.silent_row);
|
TextView silence = findViewById(R.id.silence);
|
||||||
View alert = findViewById(R.id.alert_row);
|
TextView alert = findViewById(R.id.alert);
|
||||||
|
TextView done = findViewById(R.id.done);
|
||||||
switch (blockState) {
|
switch (blockState) {
|
||||||
case ACTION_TOGGLE_SILENT:
|
case ACTION_TOGGLE_SILENT:
|
||||||
silent.setBackground(mSelectedBackground);
|
updateButtons(silence, alert);
|
||||||
alert.setBackground(null);
|
if (mWasShownHighPriority) {
|
||||||
|
done.setText(R.string.inline_ok_button);
|
||||||
|
} else {
|
||||||
|
done.setText(R.string.inline_done_button);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_ALERT:
|
case ACTION_ALERT:
|
||||||
alert.setBackground(mSelectedBackground);
|
updateButtons(alert, silence);
|
||||||
silent.setBackground(null);
|
if (mWasShownHighPriority) {
|
||||||
|
done.setText(R.string.inline_done_button);
|
||||||
|
} else {
|
||||||
|
done.setText(R.string.inline_ok_button);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateButtons(TextView selected, TextView unselected) {
|
||||||
|
selected.setBackground(mSelectedBackground);
|
||||||
|
selected.setSelected(true);
|
||||||
|
selected.setTextAppearance(
|
||||||
|
R.style.TextAppearance_NotificationImportanceButton_Selected);
|
||||||
|
unselected.setBackground(mUnselectedBackground);
|
||||||
|
unselected.setSelected(false);
|
||||||
|
unselected.setTextAppearance(
|
||||||
|
R.style.TextAppearance_NotificationImportanceButton_Unselected);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setImportanceSummary(int blockState) {
|
||||||
|
TextView view = findViewById(R.id.description);
|
||||||
|
if (blockState == ACTION_ALERT) {
|
||||||
|
view.setText(R.string.notification_channel_summary_default);
|
||||||
|
} else {
|
||||||
|
if (mShowInStatusBar) {
|
||||||
|
if (mShowOnLockscreen) {
|
||||||
|
view.setText(R.string.notification_channel_summary_low_status_lock);
|
||||||
|
} else {
|
||||||
|
view.setText(R.string.notification_channel_summary_low_status);
|
||||||
|
}
|
||||||
|
} else if (mShowOnLockscreen) {
|
||||||
|
view.setText(R.string.notification_channel_summary_low_lock);
|
||||||
|
} else {
|
||||||
|
view.setText(R.string.notification_channel_summary_low);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void saveImportanceAndExitReason(@NotificationInfoAction int action) {
|
private void saveImportanceAndExitReason(@NotificationInfoAction int action) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ACTION_UNDO:
|
case ACTION_UNDO:
|
||||||
@@ -556,15 +602,8 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
|
|||||||
break;
|
break;
|
||||||
case ACTION_DELIVER_SILENTLY:
|
case ACTION_DELIVER_SILENTLY:
|
||||||
mExitReason = NotificationCounters.BLOCKING_HELPER_DELIVER_SILENTLY;
|
mExitReason = NotificationCounters.BLOCKING_HELPER_DELIVER_SILENTLY;
|
||||||
mChosenImportance = IMPORTANCE_LOW;
|
mChosenImportance = mWasShownHighPriority
|
||||||
break;
|
? IMPORTANCE_LOW : mStartingChannelImportance;
|
||||||
case ACTION_TOGGLE_SILENT:
|
|
||||||
mExitReason = NotificationCounters.BLOCKING_HELPER_TOGGLE_SILENT;
|
|
||||||
if (mWasShownHighPriority) {
|
|
||||||
mChosenImportance = IMPORTANCE_LOW;
|
|
||||||
} else {
|
|
||||||
mChosenImportance = IMPORTANCE_DEFAULT;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
|
|||||||
@@ -250,8 +250,6 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
IMPORTANCE_DEFAULT, true);
|
IMPORTANCE_DEFAULT, true);
|
||||||
final TextView groupNameView = mNotificationInfo.findViewById(R.id.group_name);
|
final TextView groupNameView = mNotificationInfo.findViewById(R.id.group_name);
|
||||||
assertEquals(GONE, groupNameView.getVisibility());
|
assertEquals(GONE, groupNameView.getVisibility());
|
||||||
final TextView groupDividerView = mNotificationInfo.findViewById(R.id.pkg_group_divider);
|
|
||||||
assertEquals(GONE, groupDividerView.getVisibility());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -268,8 +266,6 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
final TextView groupNameView = mNotificationInfo.findViewById(R.id.group_name);
|
final TextView groupNameView = mNotificationInfo.findViewById(R.id.group_name);
|
||||||
assertEquals(View.VISIBLE, groupNameView.getVisibility());
|
assertEquals(View.VISIBLE, groupNameView.getVisibility());
|
||||||
assertEquals("Test Group Name", groupNameView.getText());
|
assertEquals("Test Group Name", groupNameView.getText());
|
||||||
final TextView groupDividerView = mNotificationInfo.findViewById(R.id.pkg_group_divider);
|
|
||||||
assertEquals(View.VISIBLE, groupDividerView.getVisibility());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -486,7 +482,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
IMPORTANCE_LOW, false);
|
IMPORTANCE_LOW, false);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.alert_row).performClick();
|
mNotificationInfo.findViewById(R.id.alert).performClick();
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
|
verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
|
||||||
anyString(), eq(TEST_UID), any());
|
anyString(), eq(TEST_UID), any());
|
||||||
@@ -500,7 +496,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
IMPORTANCE_DEFAULT, true);
|
IMPORTANCE_DEFAULT, true);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.silent_row).performClick();
|
mNotificationInfo.findViewById(R.id.silence).performClick();
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
|
verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
|
||||||
anyString(), eq(TEST_UID), any());
|
anyString(), eq(TEST_UID), any());
|
||||||
@@ -527,7 +523,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
mNotificationChannel.setImportance(IMPORTANCE_UNSPECIFIED);
|
mNotificationChannel.setImportance(IMPORTANCE_UNSPECIFIED);
|
||||||
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
IMPORTANCE_DEFAULT, true);
|
IMPORTANCE_UNSPECIFIED, true);
|
||||||
|
|
||||||
mNotificationInfo.handleCloseControls(true, false);
|
mNotificationInfo.handleCloseControls(true, false);
|
||||||
|
|
||||||
@@ -542,6 +538,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
throws Exception {
|
throws Exception {
|
||||||
NotificationInfo.CheckSaveListener listener =
|
NotificationInfo.CheckSaveListener listener =
|
||||||
mock(NotificationInfo.CheckSaveListener.class);
|
mock(NotificationInfo.CheckSaveListener.class);
|
||||||
|
mNotificationChannel.setImportance(IMPORTANCE_DEFAULT);
|
||||||
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
TEST_PACKAGE_NAME, mNotificationChannel /* notificationChannel */,
|
TEST_PACKAGE_NAME, mNotificationChannel /* notificationChannel */,
|
||||||
10 /* numUniqueChannelsInRow */, mSbn, listener /* checkSaveListener */,
|
10 /* numUniqueChannelsInRow */, mSbn, listener /* checkSaveListener */,
|
||||||
@@ -570,6 +567,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
throws Exception {
|
throws Exception {
|
||||||
NotificationInfo.CheckSaveListener listener =
|
NotificationInfo.CheckSaveListener listener =
|
||||||
mock(NotificationInfo.CheckSaveListener.class);
|
mock(NotificationInfo.CheckSaveListener.class);
|
||||||
|
mNotificationChannel.setImportance(IMPORTANCE_DEFAULT);
|
||||||
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
TEST_PACKAGE_NAME, mNotificationChannel /* notificationChannel */,
|
TEST_PACKAGE_NAME, mNotificationChannel /* notificationChannel */,
|
||||||
10 /* numUniqueChannelsInRow */, mSbn, listener /* checkSaveListener */,
|
10 /* numUniqueChannelsInRow */, mSbn, listener /* checkSaveListener */,
|
||||||
@@ -588,6 +586,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
throws Exception {
|
throws Exception {
|
||||||
NotificationInfo.CheckSaveListener listener =
|
NotificationInfo.CheckSaveListener listener =
|
||||||
mock(NotificationInfo.CheckSaveListener.class);
|
mock(NotificationInfo.CheckSaveListener.class);
|
||||||
|
mNotificationChannel.setImportance(IMPORTANCE_DEFAULT);
|
||||||
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
TEST_PACKAGE_NAME, mNotificationChannel /* notificationChannel */,
|
TEST_PACKAGE_NAME, mNotificationChannel /* notificationChannel */,
|
||||||
10 /* numUniqueChannelsInRow */, mSbn, listener /* checkSaveListener */,
|
10 /* numUniqueChannelsInRow */, mSbn, listener /* checkSaveListener */,
|
||||||
@@ -603,6 +602,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCloseControls_blockingHelperDismissedIfShown() throws Exception {
|
public void testCloseControls_blockingHelperDismissedIfShown() throws Exception {
|
||||||
|
mNotificationChannel.setImportance(IMPORTANCE_DEFAULT);
|
||||||
mNotificationInfo.bindNotification(
|
mNotificationInfo.bindNotification(
|
||||||
mMockPackageManager,
|
mMockPackageManager,
|
||||||
mMockINotificationManager,
|
mMockINotificationManager,
|
||||||
@@ -629,7 +629,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testSilentlyChangedCallsUpdateNotificationChannel_blockingHelper()
|
public void testSilentlyChangedCallsUpdateNotificationChannel_blockingHelper()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
mNotificationChannel.setImportance(IMPORTANCE_LOW);
|
mNotificationChannel.setImportance(IMPORTANCE_DEFAULT);
|
||||||
mNotificationInfo.bindNotification(
|
mNotificationInfo.bindNotification(
|
||||||
mMockPackageManager,
|
mMockPackageManager,
|
||||||
mMockINotificationManager,
|
mMockINotificationManager,
|
||||||
@@ -644,7 +644,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
false /* isNonblockable */,
|
false /* isNonblockable */,
|
||||||
true /* isForBlockingHelper */,
|
true /* isForBlockingHelper */,
|
||||||
IMPORTANCE_DEFAULT,
|
IMPORTANCE_DEFAULT,
|
||||||
false);
|
true);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.deliver_silently).performClick();
|
mNotificationInfo.findViewById(R.id.deliver_silently).performClick();
|
||||||
waitForUndoButton();
|
waitForUndoButton();
|
||||||
@@ -684,7 +684,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
mNotificationChannel.setImportance(IMPORTANCE_DEFAULT);
|
mNotificationChannel.setImportance(IMPORTANCE_DEFAULT);
|
||||||
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, true,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, true,
|
||||||
IMPORTANCE_DEFAULT, false);
|
IMPORTANCE_DEFAULT, true);
|
||||||
|
|
||||||
mNotificationInfo.handleCloseControls(true, false);
|
mNotificationInfo.handleCloseControls(true, false);
|
||||||
|
|
||||||
@@ -704,7 +704,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
IMPORTANCE_DEFAULT, true);
|
IMPORTANCE_DEFAULT, true);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.silent_row).performClick();
|
mNotificationInfo.findViewById(R.id.silence).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
mNotificationInfo.handleCloseControls(true, false);
|
mNotificationInfo.handleCloseControls(true, false);
|
||||||
|
|
||||||
@@ -723,9 +723,9 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
mNotificationChannel.setImportance(IMPORTANCE_LOW);
|
mNotificationChannel.setImportance(IMPORTANCE_LOW);
|
||||||
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
IMPORTANCE_DEFAULT, false);
|
IMPORTANCE_LOW, false);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.alert_row).performClick();
|
mNotificationInfo.findViewById(R.id.alert).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
mNotificationInfo.handleCloseControls(true, false);
|
mNotificationInfo.handleCloseControls(true, false);
|
||||||
|
|
||||||
@@ -745,9 +745,9 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
mNotificationChannel.setImportance(IMPORTANCE_UNSPECIFIED);
|
mNotificationChannel.setImportance(IMPORTANCE_UNSPECIFIED);
|
||||||
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
IMPORTANCE_DEFAULT, true);
|
IMPORTANCE_UNSPECIFIED, true);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.silent_row).performClick();
|
mNotificationInfo.findViewById(R.id.silence).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
mNotificationInfo.handleCloseControls(true, false);
|
mNotificationInfo.handleCloseControls(true, false);
|
||||||
|
|
||||||
@@ -762,14 +762,82 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnSilenceCallsUpdateNotificationChannel_channelImportanceUnspecified()
|
public void testSilenceCallsUpdateNotificationChannel_channelImportanceMin()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
mNotificationChannel.setImportance(IMPORTANCE_UNSPECIFIED);
|
mNotificationChannel.setImportance(IMPORTANCE_MIN);
|
||||||
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
|
IMPORTANCE_MIN, false);
|
||||||
|
|
||||||
|
assertEquals(mContext.getString(R.string.inline_done_button),
|
||||||
|
((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
|
||||||
|
mNotificationInfo.findViewById(R.id.silence).performClick();
|
||||||
|
assertEquals(mContext.getString(R.string.inline_done_button),
|
||||||
|
((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
|
||||||
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
|
mNotificationInfo.handleCloseControls(true, false);
|
||||||
|
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
ArgumentCaptor<NotificationChannel> updated =
|
||||||
|
ArgumentCaptor.forClass(NotificationChannel.class);
|
||||||
|
verify(mMockINotificationManager, times(1)).updateNotificationChannelForPackage(
|
||||||
|
anyString(), eq(TEST_UID), updated.capture());
|
||||||
|
assertTrue((updated.getValue().getUserLockedFields()& USER_LOCKED_IMPORTANCE) != 0);
|
||||||
|
assertEquals(IMPORTANCE_MIN, updated.getValue().getImportance());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAlertCallsUpdateNotificationChannel_channelImportanceMin()
|
||||||
|
throws Exception {
|
||||||
|
mNotificationChannel.setImportance(IMPORTANCE_MIN);
|
||||||
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
|
IMPORTANCE_MIN, false);
|
||||||
|
|
||||||
|
assertEquals(mContext.getString(R.string.inline_done_button),
|
||||||
|
((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
|
||||||
|
mNotificationInfo.findViewById(R.id.alert).performClick();
|
||||||
|
assertEquals(mContext.getString(R.string.inline_ok_button),
|
||||||
|
((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
|
||||||
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
|
mNotificationInfo.handleCloseControls(true, false);
|
||||||
|
|
||||||
|
mTestableLooper.processAllMessages();
|
||||||
|
ArgumentCaptor<NotificationChannel> updated =
|
||||||
|
ArgumentCaptor.forClass(NotificationChannel.class);
|
||||||
|
verify(mMockINotificationManager, times(1)).updateNotificationChannelForPackage(
|
||||||
|
anyString(), eq(TEST_UID), updated.capture());
|
||||||
|
assertTrue((updated.getValue().getUserLockedFields()& USER_LOCKED_IMPORTANCE) != 0);
|
||||||
|
assertEquals(IMPORTANCE_DEFAULT, updated.getValue().getImportance());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDoneText()
|
||||||
|
throws Exception {
|
||||||
|
mNotificationChannel.setImportance(IMPORTANCE_LOW);
|
||||||
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
IMPORTANCE_LOW, false);
|
IMPORTANCE_LOW, false);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.alert_row).performClick();
|
assertEquals(mContext.getString(R.string.inline_done_button),
|
||||||
|
((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
|
||||||
|
mNotificationInfo.findViewById(R.id.alert).performClick();
|
||||||
|
assertEquals(mContext.getString(R.string.inline_ok_button),
|
||||||
|
((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
|
||||||
|
mNotificationInfo.findViewById(R.id.silence).performClick();
|
||||||
|
assertEquals(mContext.getString(R.string.inline_done_button),
|
||||||
|
((TextView) mNotificationInfo.findViewById(R.id.done)).getText());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUnSilenceCallsUpdateNotificationChannel_channelImportanceUnspecified()
|
||||||
|
throws Exception {
|
||||||
|
mNotificationChannel.setImportance(IMPORTANCE_LOW);
|
||||||
|
mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager,
|
||||||
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
|
IMPORTANCE_LOW, false);
|
||||||
|
|
||||||
|
mNotificationInfo.findViewById(R.id.alert).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
mNotificationInfo.handleCloseControls(true, false);
|
mNotificationInfo.handleCloseControls(true, false);
|
||||||
|
|
||||||
@@ -790,7 +858,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
TEST_PACKAGE_NAME, mNotificationChannel, 1, mSbn, null, null, null, true, false,
|
||||||
IMPORTANCE_LOW, false);
|
IMPORTANCE_LOW, false);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.alert_row).performClick();
|
mNotificationInfo.findViewById(R.id.alert).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
mNotificationInfo.handleCloseControls(false, false);
|
mNotificationInfo.handleCloseControls(false, false);
|
||||||
|
|
||||||
@@ -809,7 +877,7 @@ public class NotificationInfoTest extends SysuiTestCase {
|
|||||||
}, null, null, true, false, IMPORTANCE_LOW, false
|
}, null, null, true, false, IMPORTANCE_LOW, false
|
||||||
);
|
);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.alert_row).performClick();
|
mNotificationInfo.findViewById(R.id.alert).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
|
verify(mMockINotificationManager, never()).updateNotificationChannelForPackage(
|
||||||
|
|||||||
Reference in New Issue
Block a user