summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/provider/Settings.java13
-rw-r--r--core/res/res/values-cs/cm_strings.xml5
-rw-r--r--core/res/res/values-da/cm_strings.xml16
-rw-r--r--core/res/res/values-de/cm_strings.xml4
-rw-r--r--core/res/res/values-el/cm_strings.xml14
-rw-r--r--core/res/res/values-es/cm_strings.xml4
-rw-r--r--core/res/res/values-et-rEE/donottranslate-maps.xml28
-rw-r--r--core/res/res/values-fr/cm_strings.xml4
-rw-r--r--core/res/res/values-hu/cm_strings.xml4
-rw-r--r--core/res/res/values-it/cm_strings.xml4
-rw-r--r--core/res/res/values-nl/cm_strings.xml4
-rw-r--r--core/res/res/values-zh-rCN/cm_strings.xml16
-rw-r--r--packages/SystemUI/res/values-da/cm_strings.xml3
-rw-r--r--packages/SystemUI/res/values-el/cm_strings.xml2
-rw-r--r--packages/SystemUI/res/values-zh-rCN/cm_strings.xml2
-rw-r--r--packages/SystemUI/res/values/ids.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/SwipeHelper.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java78
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java109
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java5
-rw-r--r--services/java/com/android/server/am/BatteryStatsService.java7
-rw-r--r--services/java/com/android/server/power/ShutdownThread.java2
28 files changed, 285 insertions, 96 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index e1c4361..7925d31 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2777,6 +2777,19 @@ public final class Settings {
*/
public static final String STATUS_BAR_IME_SWITCHER = "status_bar_ime_switcher";
+ /**
+ * Whether to collapse the notification area after dismissing the last notification
+ * @hide
+ */
+ public static final String STATUS_BAR_COLLAPSE_ON_DISMISS = "status_bar_collapse_on_dismiss";
+
+ /** @hide */
+ public static final int STATUS_BAR_COLLAPSE_NEVER = 0;
+ /** @hide */
+ public static final int STATUS_BAR_COLLAPSE_IF_EMPTIED = 1;
+ /** @hide */
+ public static final int STATUS_BAR_COLLAPSE_IF_NO_CLEARABLE = 2;
+
/**
* Expanded desktop on/off state
* @hide
diff --git a/core/res/res/values-cs/cm_strings.xml b/core/res/res/values-cs/cm_strings.xml
index b6b6d1e..9080511 100644
--- a/core/res/res/values-cs/cm_strings.xml
+++ b/core/res/res/values-cs/cm_strings.xml
@@ -62,4 +62,9 @@
<string name="permlab_interceptSmsSent">zachytit odchozí SMS</string>
<string name="permdesc_interceptSmsSent">Umožní odchytit odchozí SMS. Škodlivé aplikace mohou pomocí odchycení SMS zabránit její odeslání příjemci.</string>
+
+ <string name="policylab_enforceSelinux">Vynucení SELinux</string>
+ <string name="policydesc_enforceSelinux">Přepnutí politiky SELinux na vynucující (enforcing ) nebo tolerantní (permissive).</string>
+ <string name="policylab_enforceMmac">Vynucení MMAC</string>
+ <string name="policydesc_enforceMmac">Přepnutí politiky MMAC na vynucující (enforcing ) nebo tolerantní (permissive).</string>
</resources>
diff --git a/core/res/res/values-da/cm_strings.xml b/core/res/res/values-da/cm_strings.xml
index 54d0842..cd54dd6 100644
--- a/core/res/res/values-da/cm_strings.xml
+++ b/core/res/res/values-da/cm_strings.xml
@@ -107,4 +107,20 @@
<string name="symbol_picker_equal">\u2260\u2248\u221e</string>
<string name="symbol_picker_lt">\u2264\u00ab\u2039</string>
<string name="symbol_picker_gt">\u2265\u00bb\u203a</string>
+ <string name="permlab_changePrivacyGuardState">aktivér eller deaktivér privatlivsvagt</string>
+ <string name="permdesc_changePrivacyGuardState">Tillader app\'en at ændre, om en anden app kører med Privatlivsvagt. Når en app kører med Privatlivsvagt, vil den ikke have adgang til personlige data såsom kontakter, opkaldslister eller beskeder.</string>
+ <string name="privacy_guard_notification">Privatlivsvagt aktiv</string>
+ <string name="privacy_guard_notification_detail"><xliff:g id="app">%1$s</xliff:g> vil ikke kunne tilgå personlige data</string>
+ <string name="profile_picker_title">Profiler</string>
+ <string name="profile_none">Ingen</string>
+ <string name="permlab_cancelNotifications">annuller app-underretninger</string>
+ <string name="permdesc_cancelNotifications">Tillader app\'en at annullere underretninger, oprettet af andre apps.</string>
+ <string name="permlab_interceptSmsSent">blokér udgående SMS</string>
+ <string name="permdesc_interceptSmsSent">Tillader app\'en at
+ blokere en udgående SMS.
+ Ondsindede apps kan muligvis bruge dette til at forhindre udgående SMS-beskeder.</string>
+ <string name="policylab_enforceSelinux">Håndhæv SELinux</string>
+ <string name="policydesc_enforceSelinux">Slå håndhævning af SELinux-politikker eller tolerant tilstand til og fra.</string>
+ <string name="policylab_enforceMmac">Håndhæv MMAC</string>
+ <string name="policydesc_enforceMmac">Slå håndhævning af MMAC-politikker eller tolerant tilstand til og fra.</string>
</resources>
diff --git a/core/res/res/values-de/cm_strings.xml b/core/res/res/values-de/cm_strings.xml
index aa802dc..26ba8e3 100644
--- a/core/res/res/values-de/cm_strings.xml
+++ b/core/res/res/values-de/cm_strings.xml
@@ -64,4 +64,8 @@
<string name="permdesc_interceptSmsSent">Ermöglicht der App, verschickte SMS abzufangen. Schädliche Apps können so das Versenden von SMS verhindern.</string>
<string name="permlab_cancelNotifications">Anwendungs-Benachrichtigungen entfernen</string>
<string name="permdesc_cancelNotifications">Ermöglicht der App, von anderen Apps erstellte Benachrichtigungen zu entfernen.</string>
+ <string name="policylab_enforceSelinux">SELinux-Richtlinie wechseln</string>
+ <string name="policydesc_enforceSelinux">Ermöglicht der App, die Anwendung der SELinux-Richtlinie zwischen strikt und moderat zu wechseln.</string>
+ <string name="policylab_enforceMmac">MMAC-Richtlinie wechseln</string>
+ <string name="policydesc_enforceMmac">Ermöglicht der App, die Anwendung der MMAC-Richtlinie zwischen strikt und moderat zu wechseln.</string>
</resources>
diff --git a/core/res/res/values-el/cm_strings.xml b/core/res/res/values-el/cm_strings.xml
index d14c7ea..fbb3708 100644
--- a/core/res/res/values-el/cm_strings.xml
+++ b/core/res/res/values-el/cm_strings.xml
@@ -107,4 +107,18 @@
<string name="symbol_picker_equal">\u2260\u2248\u221e</string>
<string name="symbol_picker_lt">\u2264\u00ab\u2039</string>
<string name="symbol_picker_gt">\u2265\u00bb\u203a</string>
+ <string name="permlab_changePrivacyGuardState">ενεργοποίηση ή απενεργοποίηση του privacy guard</string>
+ <string name="permdesc_changePrivacyGuardState">Επιτρέπει σε μια εφαρμογή τον χειρισμό άλλων εφαρμογών με το Privacy Guard. Όταν μια εφαρμογή τρέχει με το Privacy Guard, δεν θα έχει πρόσβαση στα προσωπικά σας δεδομένα όπως επαφές, μηνύματα ή το αρχείο κλήσεων.</string>
+ <string name="privacy_guard_notification">Privacy Guard ενεργό</string>
+ <string name="privacy_guard_notification_detail"><xliff:g id="app">%1$s</xliff:g> δεν θα μπορεί να έχει πρόσβαση στα προσωπικά σας δεδομένα</string>
+ <string name="profile_picker_title">Προφίλ</string>
+ <string name="profile_none">Κανένα</string>
+ <string name="permlab_cancelNotifications">ακύρωση ειδοποιήσεων εφαρμογών</string>
+ <string name="permdesc_cancelNotifications">Επιτρέπει σε μια εφαρμογή την ακύρωση ειδοποιήσεων που προέρχονται από άλλες εφαρμογές.</string>
+ <string name="permlab_interceptSmsSent">παρεμπόδιση εξερχόμενων SMS</string>
+ <string name="permdesc_interceptSmsSent">Επιτρέπει σε μια εφαρμογή να παρεμποδίσει τα εξερχόμενα SMS. Κακόβουλες εφαρμογές μπορεί να το χρησιμοποιήσουν για να εμποδίσουν τη αποστολή SMS.</string>
+ <string name="policylab_enforceSelinux">Εξαναγκασμός SELinux</string>
+ <string name="policydesc_enforceSelinux">Εναλλαγή πολιτικής SELinux σε εξαναγκασμένη ή επιτρεπόμενη.</string>
+ <string name="policylab_enforceMmac">Εξαναγκασμός MMAC</string>
+ <string name="policydesc_enforceMmac">Εναλλαγή πολιτικής MMAC σε εξαναγκασμένη ή επιτρεπόμενη.</string>
</resources>
diff --git a/core/res/res/values-es/cm_strings.xml b/core/res/res/values-es/cm_strings.xml
index ae74d8c..351925a 100644
--- a/core/res/res/values-es/cm_strings.xml
+++ b/core/res/res/values-es/cm_strings.xml
@@ -64,4 +64,8 @@
<string name="permdesc_cancelNotifications">Permite que la aplicación cancele las notificaciones creadas por otras.</string>
<string name="permlab_interceptSmsSent">interceptar mensajes SMS salientes</string>
<string name="permdesc_interceptSmsSent">Permite que la aplicación intercepte mensajes SMS salientes. Las aplicaciones maliciosas pueden impedir los mensajes SMS salientes.</string>
+ <string name="policylab_enforceSelinux">Forzar SELinux</string>
+ <string name="policydesc_enforceSelinux">Alternar entre el modo permisivo o restrictivo de SELinux.</string>
+ <string name="policylab_enforceMmac">Forzar MMAC</string>
+ <string name="policydesc_enforceMmac">Alternar entre el modo permisivo o restrictivo de MMAC.</string>
</resources>
diff --git a/core/res/res/values-et-rEE/donottranslate-maps.xml b/core/res/res/values-et-rEE/donottranslate-maps.xml
new file mode 100644
index 0000000..f1fea17
--- /dev/null
+++ b/core/res/res/values-et-rEE/donottranslate-maps.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The CyanogenMod 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.
+-->
+<resources>
+
+ <!-- Do not translate. -->
+ <integer-array name="maps_starting_lat_lng">
+ <item>5884131</item>
+ <item>2570560</item>
+ </integer-array>
+ <!-- Do not translate. -->
+ <integer-array name="maps_starting_zoom">
+ <item>4</item>
+ </integer-array>
+
+</resources>
diff --git a/core/res/res/values-fr/cm_strings.xml b/core/res/res/values-fr/cm_strings.xml
index 1f93895..0cdf31c 100644
--- a/core/res/res/values-fr/cm_strings.xml
+++ b/core/res/res/values-fr/cm_strings.xml
@@ -64,4 +64,8 @@
<string name="permdesc_cancelNotifications">Permet à l\'application de révoquer les notifications créées par d\'autres applications.</string>
<string name="permlab_interceptSmsSent">intercepte les SMS sortants</string>
<string name="permdesc_interceptSmsSent">Permet à l\'application d\'intercepter un SMS sortant. Des applications malveillantes peuvent utiliser cette option pour empêcher les SMS d\'être envoyés.</string>
+ <string name="policylab_enforceSelinux">Appliquer SELinux</string>
+ <string name="policydesc_enforceSelinux">Bascule entre l\'imposition des régles SELinux et le mode permissif.</string>
+ <string name="policylab_enforceMmac">Appliquer MMAC</string>
+ <string name="policydesc_enforceMmac">Bascule entre l\'imposition des régles MMAC et le mode permissif.</string>
</resources>
diff --git a/core/res/res/values-hu/cm_strings.xml b/core/res/res/values-hu/cm_strings.xml
index b39efd8..abfcd4b 100644
--- a/core/res/res/values-hu/cm_strings.xml
+++ b/core/res/res/values-hu/cm_strings.xml
@@ -64,4 +64,8 @@
<string name="permdesc_cancelNotifications">Lehetővé teszi, hogy más alkalmazások számára törölje az értesítéseket</string>
<string name="permlab_interceptSmsSent">kimenő SMS üzenetek elfogása</string>
<string name="permdesc_interceptSmsSent">Lehetővé teszi az alkalmazás számára, hogy elfogja a kimenő SMS üzeneteket. A rosszindulatú alkalmazások ezt felhasználhatják az SMS-küldés blokkolására.</string>
+ <string name="policylab_enforceSelinux">SELinux</string>
+ <string name="policydesc_enforceSelinux">Váltás a biztonságos és az engedélyező SELinux mód közt.</string>
+ <string name="policylab_enforceMmac">MMAC</string>
+ <string name="policydesc_enforceMmac">Váltás a biztonságos és az engedélyező MMAC mód közt.</string>
</resources>
diff --git a/core/res/res/values-it/cm_strings.xml b/core/res/res/values-it/cm_strings.xml
index a771c0f..5e35fe0 100644
--- a/core/res/res/values-it/cm_strings.xml
+++ b/core/res/res/values-it/cm_strings.xml
@@ -64,4 +64,8 @@
<string name="permdesc_cancelNotifications">Consente all\'applicazione di cancellare le notifiche create da altre applicazioni.</string>
<string name="permlab_interceptSmsSent">intercetta SMS in uscita</string>
<string name="permdesc_interceptSmsSent">Consente all\'applicazione di intercettare un SMS in uscita. Le applicazioni maligne potrebbero usarlo per impedire la spedizione di SMS.</string>
+ <string name="policylab_enforceSelinux">Forza SELinux</string>
+ <string name="policydesc_enforceSelinux">Alterna tra regole restrittive o permissive di SELinux.</string>
+ <string name="policylab_enforceMmac">Forza MMAC</string>
+ <string name="policydesc_enforceMmac">Alterna tra regole restrittive o permissive di MMAC.</string>
</resources>
diff --git a/core/res/res/values-nl/cm_strings.xml b/core/res/res/values-nl/cm_strings.xml
index 90994ca..97d74e5 100644
--- a/core/res/res/values-nl/cm_strings.xml
+++ b/core/res/res/values-nl/cm_strings.xml
@@ -64,4 +64,8 @@
<string name="permdesc_cancelNotifications">Hiermee kan de app meldingen gecreeërd door andere apps sluiten.</string>
<string name="permlab_interceptSmsSent">uitgaand sms-bericht onderscheppen</string>
<string name="permdesc_interceptSmsSent">Hiermee kan de app een uitgaand sms-bericht onderscheppen. Schadelijke apps kunnen dit gebruiken om uitgaande sms-berichten te blokkeren.</string>
+ <string name="policylab_enforceSelinux">SELinux afdwingen</string>
+ <string name="policydesc_enforceSelinux">Wisselen tussen SELinux-beleid afdwingen of tolerante stand.</string>
+ <string name="policylab_enforceMmac">MMAC afdwingen</string>
+ <string name="policydesc_enforceMmac">Wisselen tussen MMAC-beleid afdwingen of tolerante stand.</string>
</resources>
diff --git a/core/res/res/values-zh-rCN/cm_strings.xml b/core/res/res/values-zh-rCN/cm_strings.xml
index e93a25e..0181665 100644
--- a/core/res/res/values-zh-rCN/cm_strings.xml
+++ b/core/res/res/values-zh-rCN/cm_strings.xml
@@ -48,10 +48,24 @@
<string name="permdesc_fm_radio_transmitter">允许应用控制 FM 发射器。</string>
<string name="lockscreen_discharging">正在放电, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string>
<string name="storage_sd_dock_card">底座 SD 卡</string>
- <string name="app_killed_message">应用程序已被终止</string>
+ <string name="app_killed_message">应用已被终止</string>
<string name="global_action_reboot">重启</string>
<string name="global_action_choose_profile">情景模式</string>
<string name="toast_rotation_unlocked">屏幕方向已解锁</string>
<string name="toast_rotation_locked">屏幕方向已锁定</string>
<string name="stylus_app_not_installed">%s 尚未被安装</string>
+ <string name="permlab_changePrivacyGuardState">启用或禁用隐私卫士</string>
+ <string name="permdesc_changePrivacyGuardState">允许应用更改是否另一个应用可与隐私卫士运行。当一个应用与隐私卫士运行时,它将不能访问任何个人隐私数据,例如:联系人、通话记录或短信。</string>
+ <string name="privacy_guard_notification">隐私卫士已启用</string>
+ <string name="privacy_guard_notification_detail">“<xliff:g id="app">%1$s</xliff:g>”将不能访问个人隐私数据</string>
+ <string name="profile_picker_title">情景模式</string>
+ <string name="profile_none">无</string>
+ <string name="permlab_cancelNotifications">取消应用通知</string>
+ <string name="permdesc_cancelNotifications">允许应用取消别的应用创建的通知。</string>
+ <string name="permlab_interceptSmsSent">拦截传出的短信</string>
+ <string name="permdesc_interceptSmsSent">允许应用拦截传出的短信。恶意应用可使用此权限来阻挡传出短信。</string>
+ <string name="policylab_enforceSelinux">执行 SELinux</string>
+ <string name="policydesc_enforceSelinux">切换 SELinux 政策执行或许可模式。</string>
+ <string name="policylab_enforceMmac">执行 MMAC</string>
+ <string name="policydesc_enforceMmac">切换 MMAC 政策执行或许可模式。</string>
</resources>
diff --git a/packages/SystemUI/res/values-da/cm_strings.xml b/packages/SystemUI/res/values-da/cm_strings.xml
index 0023038..743ae68 100644
--- a/packages/SystemUI/res/values-da/cm_strings.xml
+++ b/packages/SystemUI/res/values-da/cm_strings.xml
@@ -15,6 +15,7 @@
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="accessibility_data_connection_HP">HSPA+</string>
+ <string name="accessibility_data_connection_DC">DCHSPAP</string>
<string name="accessibility_quick_settings_ringer">Lyd <xliff:g id="state" example="Off">%s</xliff:g>.</string>
<string name="accessibility_quick_settings_vibration">Vibration <xliff:g id="state" example="Off">%s</xliff:g>.</string>
<string name="bean_dream_settings_cid_title">Brug Cid\'s hoved</string>
@@ -51,8 +52,10 @@
<string name="quick_settings_lte">LTE</string>
<string name="quick_settings_lte_off">LTE fra</string>
<string name="quick_settings_volume">Lydstyrke</string>
+ <string name="quick_settings_camera_label">Kamera</string>
<string name="quick_settings_expanded_desktop">Udvidet</string>
<string name="quick_settings_expanded_desktop_off">Normal</string>
+ <string name="quick_settings_camera_error_connect">Kan ikke forbinde til kamera</string>
<string name="navbar_dialog_title">Vælg handling at tildele</string>
<string name="navbar_home_button">Startknap</string>
<string name="navbar_recent_button">Seneste-knap</string>
diff --git a/packages/SystemUI/res/values-el/cm_strings.xml b/packages/SystemUI/res/values-el/cm_strings.xml
index 33b4393..8498343 100644
--- a/packages/SystemUI/res/values-el/cm_strings.xml
+++ b/packages/SystemUI/res/values-el/cm_strings.xml
@@ -52,8 +52,10 @@
<string name="quick_settings_lte">LTE</string>
<string name="quick_settings_lte_off">LTE ανενεργό</string>
<string name="quick_settings_volume">Ένταση</string>
+ <string name="quick_settings_camera_label">Φωτογρ. μηχανή</string>
<string name="quick_settings_expanded_desktop">Επεκταμένη</string>
<string name="quick_settings_expanded_desktop_off">Κανονική</string>
+ <string name="quick_settings_camera_error_connect">Δεν είναι δυνατή η σύνδεση με την φωτογραφ. μηχανή</string>
<string name="navbar_dialog_title">Επιλέξτε λειτουργία για εκχώρηση</string>
<string name="navbar_home_button">Πλήκτρο Home</string>
<string name="navbar_recent_button">Πλήκτρο Recent</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/cm_strings.xml b/packages/SystemUI/res/values-zh-rCN/cm_strings.xml
index 1b938d0..4487eaf 100644
--- a/packages/SystemUI/res/values-zh-rCN/cm_strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/cm_strings.xml
@@ -51,8 +51,10 @@
<string name="quick_settings_lte">LTE</string>
<string name="quick_settings_lte_off">LTE 已关闭</string>
<string name="quick_settings_volume">音量</string>
+ <string name="quick_settings_camera_label">相机</string>
<string name="quick_settings_expanded_desktop">已扩展</string>
<string name="quick_settings_expanded_desktop_off">正常</string>
+ <string name="quick_settings_camera_error_connect">无法连接到相机</string>
<string name="navbar_dialog_title">选择指定的行为</string>
<string name="navbar_home_button">Home 键</string>
<string name="navbar_recent_button">最近应用键</string>
diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml
index f7bc614..bd24f0f 100644
--- a/packages/SystemUI/res/values/ids.xml
+++ b/packages/SystemUI/res/values/ids.xml
@@ -19,6 +19,6 @@
<item type="id" name="expandable_tag" />
<item type="id" name="user_expanded_tag" />
<item type="id" name="user_lock_tag" />
- <item type="id" name="user_cleared_tag" />
+ <item type="id" name="user_dismissed_tag" />
<item type="id" name="status_bar_cling_stub" />
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
index 7be5949..ceb8654 100644
--- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java
@@ -257,10 +257,6 @@ public class SwipeHelper implements Gefingerpoken {
* @param velocity The desired pixels/second speed at which the view should move
*/
public void dismissChild(final View view, float velocity) {
- dismissChild(view, velocity, false);
- }
-
- private void dismissChild(final View view, float velocity, final boolean fromUser) {
final View animView = mCallback.getChildContentView(view);
final boolean canAnimViewBeDismissed = mCallback.canChildBeDismissed(view);
float newPos;
@@ -288,7 +284,7 @@ public class SwipeHelper implements Gefingerpoken {
anim.setDuration(duration);
anim.addListener(new AnimatorListenerAdapter() {
public void onAnimationEnd(Animator animation) {
- mCallback.onChildDismissed(view, fromUser);
+ mCallback.onChildDismissed(view);
animView.setLayerType(View.LAYER_TYPE_NONE, null);
}
});
@@ -378,7 +374,7 @@ public class SwipeHelper implements Gefingerpoken {
if (dismissChild) {
// flingadingy
- dismissChild(mCurrView, childSwipedFastEnough ? velocity : 0f, true);
+ dismissChild(mCurrView, childSwipedFastEnough ? velocity : 0f);
} else {
// snappity
mCallback.onDragCancelled(mCurrView);
@@ -399,7 +395,7 @@ public class SwipeHelper implements Gefingerpoken {
void onBeginDrag(View v);
- void onChildDismissed(View v, boolean fromUser);
+ void onChildDismissed(View v);
void onDragCancelled(View v);
}
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
index b59acad..989ada0 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
@@ -212,7 +212,7 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView
mSwipeHelper.dismissChild(v, 0);
}
- public void onChildDismissed(View v, boolean fromUser) {
+ public void onChildDismissed(View v) {
addToRecycledViews(v);
mLinearLayout.removeView(v);
mCallback.handleSwipe(v);
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
index d6f417d..0f48751 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
@@ -220,7 +220,7 @@ public class RecentsVerticalScrollView extends ScrollView
mSwipeHelper.dismissChild(v, 0);
}
- public void onChildDismissed(View v, boolean fromUser) {
+ public void onChildDismissed(View v) {
addToRecycledViews(v);
mLinearLayout.removeView(v);
mCallback.handleSwipe(v);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 9f57e72..b56aa12 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -108,6 +108,10 @@ public abstract class BaseStatusBar extends SystemUI implements
public static final int EXPANDED_LEAVE_ALONE = -10000;
public static final int EXPANDED_FULL_OPEN = -10001;
+ private static final boolean CLOSE_PANEL_WHEN_EMPTIED = true;
+ private static final int COLLAPSE_AFTER_DISMISS_DELAY = 200;
+ private static final int COLLAPSE_AFTER_REMOVE_DELAY = 400;
+
protected CommandQueue mCommandQueue;
protected IStatusBarService mBarService;
protected H mHandler = createHandler();
@@ -130,6 +134,13 @@ public abstract class BaseStatusBar extends SystemUI implements
protected FrameLayout mStatusBarContainer;
+ private Runnable mPanelCollapseRunnable = new Runnable() {
+ @Override
+ public void run() {
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
+ }
+ };
+
/**
* An interface for navigation key bars to allow status bars to signal which keys are
* currently of interest to the user.<br>
@@ -172,6 +183,7 @@ public abstract class BaseStatusBar extends SystemUI implements
protected Display mDisplay;
private boolean mDeviceProvisioned = false;
+ private int mAutoCollapseBehaviour;
public IStatusBarService getStatusBarService() {
return mBarService;
@@ -181,7 +193,7 @@ public abstract class BaseStatusBar extends SystemUI implements
return mDeviceProvisioned;
}
- private ContentObserver mProvisioningObserver = new ContentObserver(new Handler()) {
+ private ContentObserver mProvisioningObserver = new ContentObserver(mHandler) {
@Override
public void onChange(boolean selfChange) {
final boolean provisioned = 0 != Settings.Global.getInt(
@@ -193,6 +205,33 @@ public abstract class BaseStatusBar extends SystemUI implements
}
};
+ private class SettingsObserver extends ContentObserver {
+ public SettingsObserver(Handler handler) {
+ super(handler);
+ }
+
+ public void observe() {
+ ContentResolver resolver = mContext.getContentResolver();
+ resolver.registerContentObserver(Settings.System.getUriFor(
+ Settings.System.STATUS_BAR_COLLAPSE_ON_DISMISS), false, this);
+ update();
+ }
+
+ @Override
+ public void onChange(boolean selfChange) {
+ update();
+ }
+
+ private void update() {
+ ContentResolver resolver = mContext.getContentResolver();
+ mAutoCollapseBehaviour = Settings.System.getIntForUser(resolver,
+ Settings.System.STATUS_BAR_COLLAPSE_ON_DISMISS,
+ Settings.System.STATUS_BAR_COLLAPSE_IF_NO_CLEARABLE, UserHandle.USER_CURRENT);
+ }
+ };
+
+ private SettingsObserver mSettingsObserver = new SettingsObserver(mHandler);
+
private RemoteViews.OnClickHandler mOnClickHandler = new RemoteViews.OnClickHandler() {
@Override
public boolean onClickHandler(View view, PendingIntent pendingIntent, Intent fillInIntent) {
@@ -235,6 +274,8 @@ public abstract class BaseStatusBar extends SystemUI implements
Settings.Global.getUriFor(Settings.Global.DEVICE_PROVISIONED), true,
mProvisioningObserver);
+ mSettingsObserver.observe();
+
mBarService = IStatusBarService.Stub.asInterface(
ServiceManager.getService(Context.STATUS_BAR_SERVICE));
@@ -939,18 +980,33 @@ public abstract class BaseStatusBar extends SystemUI implements
if (rowParent != null) rowParent.removeView(entry.row);
updateExpansionStates();
updateNotificationIcons();
+ maybeCollapseAfterNotificationRemoval(entry.userDismissed());
- if (entry.userCleared() && !mNotificationData.hasClearableItems()) {
- // wait a bit to make the user aware of what's happening
- mHandler.postDelayed(new Runnable() {
- @Override
- public void run() {
- animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
- }
- }, 225);
+ return entry.notification;
+ }
+
+ protected void maybeCollapseAfterNotificationRemoval(boolean userDismissed) {
+ if (mAutoCollapseBehaviour == Settings.System.STATUS_BAR_COLLAPSE_NEVER) {
+ return;
+ }
+ if (!isNotificationPanelFullyVisible()) {
+ return;
}
- return entry.notification;
+ boolean collapseDueToEmpty =
+ mAutoCollapseBehaviour == Settings.System.STATUS_BAR_COLLAPSE_IF_EMPTIED
+ && mNotificationData.size() == 0;
+ boolean collapseDueToNoClearable =
+ mAutoCollapseBehaviour == Settings.System.STATUS_BAR_COLLAPSE_IF_NO_CLEARABLE
+ && !mNotificationData.hasClearableItems();
+
+ if (userDismissed && (collapseDueToEmpty || collapseDueToNoClearable)) {
+ mHandler.removeCallbacks(mPanelCollapseRunnable);
+ mHandler.postDelayed(mPanelCollapseRunnable, COLLAPSE_AFTER_DISMISS_DELAY);
+ } else if (mNotificationData.size() == 0) {
+ mHandler.removeCallbacks(mPanelCollapseRunnable);
+ mHandler.postDelayed(mPanelCollapseRunnable, COLLAPSE_AFTER_REMOVE_DELAY);
+ }
}
protected StatusBarIconView addNotificationViews(IBinder key,
@@ -989,6 +1045,7 @@ public abstract class BaseStatusBar extends SystemUI implements
}
updateExpansionStates();
updateNotificationIcons();
+ mHandler.removeCallbacks(mPanelCollapseRunnable);
return iconView;
}
@@ -1036,6 +1093,7 @@ public abstract class BaseStatusBar extends SystemUI implements
protected abstract void tick(IBinder key, StatusBarNotification n, boolean firstTime);
protected abstract void updateExpandedViewPos(int expandedPosition);
protected abstract int getExpandedViewMaxHeight();
+ protected abstract boolean isNotificationPanelFullyVisible();
protected abstract boolean shouldDisableNavbarGestures();
protected boolean isTopNotification(ViewGroup parent, NotificationData.Entry entry) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 7222c08..a457167 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -66,10 +66,10 @@ public class NotificationData {
return NotificationData.getUserExpanded(row);
}
/**
- * Return whether the entry has been manually cleared by the user.
+ * Return whether the entry has been manually dismissed by the user.
*/
- public boolean userCleared() {
- return NotificationData.getUserCleared(row);
+ public boolean userDismissed() {
+ return NotificationData.getUserDismissed(row);
}
/**
* Set the flag indicating that this was manually expanded by the user.
@@ -235,16 +235,16 @@ public class NotificationData {
}
/**
- * Return whether the entry was cleared by the user.
+ * Return whether the entry was dismissed by the user.
*/
- public static boolean getUserCleared(View row) {
- return readBooleanTag(row, R.id.user_cleared_tag);
+ public static boolean getUserDismissed(View row) {
+ return readBooleanTag(row, R.id.user_dismissed_tag);
}
/**
- * Set whether the entry is being touched by the user.
+ * Set whether the entry was dismissed by the user.
*/
- public static boolean setUserCleared(View row) {
- return writeBooleanTag(row, R.id.user_cleared_tag, true);
+ public static boolean setUserDismissed(View row) {
+ return writeBooleanTag(row, R.id.user_dismissed_tag, true);
}
}
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 82b6538..ad588af 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -290,7 +290,6 @@ public class PhoneStatusBar extends BaseStatusBar {
float mFlingVelocity;
int mFlingY;
int[] mAbsPos = new int[2];
- Runnable mPostCollapseCleanup = null;
private Animator mLightsOutAnimation;
private Animator mLightsOnAnimation;
@@ -340,6 +339,19 @@ public class PhoneStatusBar extends BaseStatusBar {
}
};
+ private final Runnable mNotifyClearAll = new Runnable() {
+ @Override
+ public void run() {
+ if (DEBUG) {
+ Slog.v(TAG, "Notifying status bar of notification clear");
+ }
+ try {
+ mPile.setViewRemoval(true);
+ mBarService.onClearAllNotifications();
+ } catch (RemoteException ex) { }
+ }
+ };
+
class SettingsObserver extends ContentObserver {
SettingsObserver(Handler handler) {
super(handler);
@@ -1878,11 +1890,6 @@ public class PhoneStatusBar extends BaseStatusBar {
// Close any "App info" popups that might have snuck on-screen
dismissPopups();
-
- if (mPostCollapseCleanup != null) {
- mPostCollapseCleanup.run();
- mPostCollapseCleanup = null;
- }
}
/**
@@ -2487,6 +2494,11 @@ public class PhoneStatusBar extends BaseStatusBar {
}
@Override
+ protected boolean isNotificationPanelFullyVisible() {
+ return mExpandedVisible && !mAnimating && !isShowingSettings();
+ }
+
+ @Override
public void updateExpandedViewPos(int thingy) {
if (DEBUG) Slog.v(TAG, "updateExpandedViewPos");
@@ -2522,7 +2534,7 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
public void onClick(View v) {
synchronized (mNotificationData) {
- // animate-swipe all dismissable notifications, then animate the shade closed
+ // animate-swipe all dismissable notifications
int numChildren = mPile.getChildCount();
int scrollTop = mScrollView.getScrollY();
@@ -2535,63 +2547,40 @@ public class PhoneStatusBar extends BaseStatusBar {
snapshot.add(child);
}
}
+
if (snapshot.isEmpty()) {
- animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
+ maybeCollapseAfterNotificationRemoval(true);
return;
}
- new Thread(new Runnable() {
- @Override
- public void run() {
- // Decrease the delay for every row we animate to give the sense of
- // accelerating the swipes
- final int ROW_DELAY_DECREMENT = 10;
- int currentDelay = 140;
- int totalDelay = 0;
-
- // Set the shade-animating state to avoid doing other work during
- // all of these animations. In particular, avoid layout and
- // redrawing when collapsing the shade.
- mPile.setViewRemoval(false);
-
- mPostCollapseCleanup = new Runnable() {
- @Override
- public void run() {
- if (DEBUG) {
- Slog.v(TAG, "running post-collapse cleanup");
- }
- try {
- mPile.setViewRemoval(true);
- mBarService.onClearAllNotifications();
- } catch (Exception ex) { }
- }
- };
-
- View sampleView = snapshot.get(0);
- int width = sampleView.getWidth();
- final int velocity = width * 8; // 1000/8 = 125 ms duration
- for (final View _v : snapshot) {
- mHandler.postDelayed(new Runnable() {
- @Override
- public void run() {
- mPile.dismissRowAnimated(_v, velocity);
- }
- }, totalDelay);
- currentDelay = Math.max(50, currentDelay - ROW_DELAY_DECREMENT);
- totalDelay += currentDelay;
+
+ // Decrease the delay for every row we animate to give the sense of
+ // accelerating the swipes
+ final int ROW_DELAY_DECREMENT = 10;
+ int currentDelay = 140;
+ int totalDelay = 0;
+
+ // Set the shade-animating state to avoid doing other work, in
+ // particular layout and redrawing, during all of these animations.
+ mPile.setViewRemoval(false);
+
+ View sampleView = snapshot.get(0);
+ int width = sampleView.getWidth();
+ final int velocity = width * 8; // 1000/8 = 125 ms duration
+ for (final View _v : snapshot) {
+ mHandler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ mPile.dismissRowAnimated(_v, velocity);
}
- // Delay the collapse animation until after all swipe animations have
- // finished. Provide some buffer because there may be some extra delay
- // before actually starting each swipe animation. Ideally, we'd
- // synchronize the end of those animations with the start of the collaps
- // exactly.
- mHandler.postDelayed(new Runnable() {
- @Override
- public void run() {
- animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
- }
- }, totalDelay + 225);
- }
- }).start();
+ }, totalDelay);
+ currentDelay = Math.max(50, currentDelay - ROW_DELAY_DECREMENT);
+ totalDelay += currentDelay;
+ }
+
+ // After ending all animations, tell the service to remove the
+ // notifications, which will trigger collapsing the shade
+ final View lastEntry = snapshot.get(snapshot.size() - 1);
+ mPile.runOnDismiss(lastEntry, mNotifyClearAll);
}
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java
index 9cbd853..4adc6c0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/IntruderAlertView.java
@@ -101,7 +101,7 @@ public class IntruderAlertView extends LinearLayout implements SwipeHelper.Callb
return true;
}
- public void onChildDismissed(View v, boolean fromUser) {
+ public void onChildDismissed(View v) {
Slog.v(TAG, "User swiped intruder to dismiss");
mBar.dismissIntruder();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
index 9e9dec2..2aa0f5e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java
@@ -61,7 +61,8 @@ public class NotificationRowLayout
HashMap<View, ValueAnimator> mDisappearingViews = new HashMap<View, ValueAnimator>();
private SwipeHelper mSwipeHelper;
-
+ private HashMap<View, Runnable> mDismissRunnables = new HashMap<View, Runnable>();
+
private OnSizeChangedListener mOnSizeChangedListener;
// Flag set during notification removal animation to avoid causing too much work until
@@ -111,6 +112,10 @@ public class NotificationRowLayout
mOnSizeChangedListener = l;
}
+ public void runOnDismiss(View child, Runnable runnable) {
+ mDismissRunnables.put(child, runnable);
+ }
+
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
@@ -166,14 +171,17 @@ public class NotificationRowLayout
return NotificationData.setUserLocked(v, userLocked);
}
- public void onChildDismissed(View v, boolean fromUser) {
+ public void onChildDismissed(View v) {
if (DEBUG) Slog.v(TAG, "onChildDismissed: " + v + " mRemoveViews=" + mRemoveViews);
final View veto = v.findViewById(R.id.veto);
if (veto != null && veto.getVisibility() != View.GONE && mRemoveViews) {
veto.performClick();
}
- if (fromUser) {
- NotificationData.setUserCleared(v);
+ NotificationData.setUserDismissed(v);
+
+ Runnable dismissRunnable = mDismissRunnables.remove(v);
+ if (dismissRunnable != null) {
+ dismissRunnable.run();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index d40bff6..2c9da8f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -383,6 +383,11 @@ public class TabletStatusBar extends BaseStatusBar implements
return getNotificationPanelHeight();
}
+ @Override
+ protected boolean isNotificationPanelFullyVisible() {
+ return mNotificationPanel.getVisibility() == View.VISIBLE;
+ }
+
private int getNotificationPanelHeight() {
final Resources res = mContext.getResources();
final Display d = mWindowManager.getDefaultDisplay();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
index d43e4a4..509e97c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
@@ -137,6 +137,11 @@ public class TvStatusBar extends BaseStatusBar {
}
@Override
+ protected boolean isNotificationPanelFullyVisible() {
+ return false;
+ }
+
+ @Override
protected boolean shouldDisableNavbarGestures() {
return true;
}
diff --git a/services/java/com/android/server/am/BatteryStatsService.java b/services/java/com/android/server/am/BatteryStatsService.java
index ab20208..99cb2c8 100644
--- a/services/java/com/android/server/am/BatteryStatsService.java
+++ b/services/java/com/android/server/am/BatteryStatsService.java
@@ -330,6 +330,13 @@ public final class BatteryStatsService extends IBatteryStats.Stub {
synchronized (mStats) {
mBluetoothPendingStats = false;
mStats.noteBluetoothOffLocked();
+ mStats.setBtHeadset(null);
+ }
+
+ BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ if (adapter != null && mBluetoothHeadset != null) {
+ adapter.closeProfileProxy(BluetoothProfile.HEADSET, mBluetoothHeadset);
+ mBluetoothHeadset = null;
}
}
diff --git a/services/java/com/android/server/power/ShutdownThread.java b/services/java/com/android/server/power/ShutdownThread.java
index c2c678a0..9c10c9d 100644
--- a/services/java/com/android/server/power/ShutdownThread.java
+++ b/services/java/com/android/server/power/ShutdownThread.java
@@ -156,7 +156,7 @@ public final class ShutdownThread extends Thread {
// See if the advanced reboot menu is enabled (only if primary user) and check the keyguard state
boolean advancedReboot = isPrimary ? advancedRebootEnabled(context) : false;
KeyguardManager km = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
- boolean locked = km.inKeyguardRestrictedInputMode();
+ boolean locked = km.inKeyguardRestrictedInputMode() && km.isKeyguardSecure();
if (advancedReboot && !locked) {
// Include options in power menu for rebooting into recovery or bootloader