summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2013-04-04 14:30:04 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-05 19:57:03 +0000
commit79b9bfe56ee4036fbe8d9bcac01260356309ae2f (patch)
treea40f853e0ac2450d45525407fbc9da7a6ebbba12 /res
parente44f5e2bd6624f5df91e2676b1ef5e3ddf279066 (diff)
downloadpackages_apps_Settings-79b9bfe56ee4036fbe8d9bcac01260356309ae2f.zip
packages_apps_Settings-79b9bfe56ee4036fbe8d9bcac01260356309ae2f.tar.gz
packages_apps_Settings-79b9bfe56ee4036fbe8d9bcac01260356309ae2f.tar.bz2
Notification listeners can be enabled in Settings>Security.
Also known as android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS. Bug: 8454150 Change-Id: I0c2433bf58ba4c78cd461326bd014535c7f67578
Diffstat (limited to 'res')
-rw-r--r--res/layout/notification_access_settings.xml37
-rw-r--r--res/layout/notification_listener_item.xml77
-rw-r--r--res/values/strings.xml31
-rw-r--r--res/xml/security_settings_misc.xml7
4 files changed, 152 insertions, 0 deletions
diff --git a/res/layout/notification_access_settings.xml b/res/layout/notification_access_settings.xml
new file mode 100644
index 0000000..db1f708
--- /dev/null
+++ b/res/layout/notification_access_settings.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="0px"
+ android:layout_weight="1">
+ <ListView android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:drawSelectorOnTop="false"
+ android:fastScrollEnabled="true" />
+ <TextView android:id="@android:id/empty"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:text="@string/no_notification_listeners"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+ </FrameLayout>
+</LinearLayout>
diff --git a/res/layout/notification_listener_item.xml b/res/layout/notification_listener_item.xml
new file mode 100644
index 0000000..67aaa61
--- /dev/null
+++ b/res/layout/notification_listener_item.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2013, 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.
+*/
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:orientation="horizontal"
+ android:paddingEnd="6dip"
+ android:gravity="center_vertical"
+ >
+
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="@android:dimen/app_icon_size"
+ android:layout_height="@android:dimen/app_icon_size"
+ android:layout_gravity="center_vertical"
+ android:scaleType="centerInside"
+ android:contentDescription="@null"
+ />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="8dip"
+ android:layout_marginBottom="8dip"
+ android:orientation="vertical"
+ android:gravity="left|center_vertical"
+ android:layout_weight="1">
+
+ <TextView android:id="@+id/name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal" />
+
+ <TextView android:id="@+id/description"
+ android:visibility="gone"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dip"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorSecondary"
+ android:maxLines="4" />
+
+ </LinearLayout>
+
+ <CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_marginEnd="16dip"
+ android:layout_marginStart="16dip"
+ android:focusable="false"
+ android:clickable="false" />
+
+</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fbf051e..4cb20c4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -983,6 +983,37 @@
<!-- Summary of preference to manage device policies -->
<string name="manage_device_admin_summary">View or deactivate device administrators</string>
+ <!-- Notification access settings (part of Security) -->
+
+ <!-- Title of preference to manage notification listeners -->
+ <string name="manage_notification_access">Notification access</string>
+
+ <!-- Summary of preference to manage notification listeners, when none are enabled -->
+ <string name="manage_notification_access_summary_zero">Apps cannot read notifications</string>
+
+ <!-- Summary of preference to manage notification listeners, when one or more are enabled
+ and are therefore able to read the user's notifications -->
+ <plurals name="manage_notification_access_summary_nonzero">
+ <item quantity="one">%d app can read notifications</item>
+ <item quantity="other">%d apps can read notifications</item>
+ </plurals>
+
+ <!-- String to show in the list of notification listeners, when none is installed -->
+ <string name="no_notification_listeners">No notification listeners are installed.</string>
+
+ <!-- Title for a warning message about security implications of enabling a notification
+ listener, displayed as a dialog message. [CHAR LIMIT=NONE] -->
+ <string name="notification_listener_security_warning_title">Enable
+ <xliff:g id="service" example="NotificationReader">%1$s</xliff:g>?</string>
+ <!-- Summary for a warning message about security implications of enabling a notification
+ listener, displayed as a dialog message. [CHAR LIMIT=NONE] -->
+ <string name="notification_listener_security_warning_summary">
+ <xliff:g id="notification_listener_name">%1$s</xliff:g> will be able to
+ read all notifications posted by the system or any installed app, which may include personal
+ information such as contact names and the text of messages sent to you. It will also be able
+ to dismiss these notifications or touch action buttons within them.
+ </string>
+
<!-- Bluetooth settings -->
<!-- Bluetooth settings check box title on Main Settings screen -->
<string name="bluetooth_quick_toggle_title">Bluetooth</string>
diff --git a/res/xml/security_settings_misc.xml b/res/xml/security_settings_misc.xml
index 10fc98f..1ead7a9 100644
--- a/res/xml/security_settings_misc.xml
+++ b/res/xml/security_settings_misc.xml
@@ -58,6 +58,13 @@
android:summaryOff="@string/verify_applications_summary"
android:summaryOn="@string/verify_applications_summary"
android:persistent="false" />
+
+ <Preference
+ android:key="manage_notification_access"
+ android:title="@string/manage_notification_access"
+ android:persistent="false"
+ android:fragment="com.android.settings.NotificationAccessSettings"/>
+
</PreferenceCategory>
<PreferenceCategory android:key="credentials_management"