diff options
Diffstat (limited to 'packages')
74 files changed, 977 insertions, 602 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index f8809d7..95fd62d 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -17,11 +17,7 @@ package com.android.providers.settings; import java.io.FileNotFoundException; -import java.io.UnsupportedEncodingException; -import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; -import java.util.LinkedHashMap; -import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -47,6 +43,7 @@ import android.provider.MediaStore; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; +import android.util.LruCache; public class SettingsProvider extends ContentProvider { private static final String TAG = "SettingsProvider"; @@ -293,7 +290,7 @@ public class SettingsProvider extends ContentProvider { "" + (MAX_CACHE_ENTRIES + 1) /* limit */); try { synchronized (cache) { - cache.clear(); + cache.evictAll(); cache.setFullyMatchesDisk(true); // optimistic int rows = 0; while (c.moveToNext()) { @@ -359,8 +356,8 @@ public class SettingsProvider extends ContentProvider { // possibly with a null value, or null on failure. private Bundle lookupValue(String table, SettingsCache cache, String key) { synchronized (cache) { - if (cache.containsKey(key)) { - Bundle value = cache.get(key); + Bundle value = cache.get(key); + if (value != null) { if (value != TOO_LARGE_TO_CACHE_MARKER) { return value; } @@ -725,13 +722,13 @@ public class SettingsProvider extends ContentProvider { * associated helper functions to keep cache coherent with the * database. */ - private static final class SettingsCache extends LinkedHashMap<String, Bundle> { + private static final class SettingsCache extends LruCache<String, Bundle> { private final String mCacheName; private boolean mCacheFullyMatchesDisk = false; // has the whole database slurped. public SettingsCache(String name) { - super(MAX_CACHE_ENTRIES, 0.75f /* load factor */, true /* access ordered */); + super(MAX_CACHE_ENTRIES); mCacheName = name; } @@ -751,14 +748,10 @@ public class SettingsProvider extends ContentProvider { } @Override - protected boolean removeEldestEntry(Map.Entry eldest) { - if (size() <= MAX_CACHE_ENTRIES) { - return false; - } - synchronized (this) { + protected void entryRemoved(boolean evicted, String key, Bundle oldValue, Bundle newValue) { + if (evicted) { mCacheFullyMatchesDisk = false; } - return true; } /** @@ -772,7 +765,7 @@ public class SettingsProvider extends ContentProvider { Bundle bundle = (value == null) ? NULL_SETTING : Bundle.forPair("value", value); if (value == null || value.length() <= MAX_CACHE_ENTRY_SIZE) { synchronized (this) { - if (!containsKey(key)) { + if (get(key) == null) { put(key, bundle); } } @@ -826,7 +819,7 @@ public class SettingsProvider extends ContentProvider { return; } synchronized (cache) { - cache.clear(); + cache.evictAll(); cache.mCacheFullyMatchesDisk = false; } } diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notification_dnd.png b/packages/SystemUI/res/drawable-mdpi/ic_notification_dnd.png Binary files differnew file mode 100644 index 0000000..6d4da7f --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_notification_dnd.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png Binary files differindex e4d5a32..7b54daf 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_default.png diff --git a/packages/SystemUI/res/drawable-mdpi/pocket_drag_pattern.png b/packages/SystemUI/res/drawable-mdpi/pocket_drag_pattern.png Binary files differnew file mode 100644 index 0000000..abde010 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/pocket_drag_pattern.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4g.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4g.png Binary files differnew file mode 100644 index 0000000..84ac927 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4g.png diff --git a/packages/SystemUI/res/drawable-xlarge-mdpi/recents_thumbnail_bg.png b/packages/SystemUI/res/drawable-xlarge-mdpi/recents_thumbnail_bg.png Binary files differindex 9f72549..87a67c9 100644 --- a/packages/SystemUI/res/drawable-xlarge-mdpi/recents_thumbnail_bg.png +++ b/packages/SystemUI/res/drawable-xlarge-mdpi/recents_thumbnail_bg.png diff --git a/packages/SystemUI/res/drawable-xlarge-mdpi/recents_thumbnail_bg_press.png b/packages/SystemUI/res/drawable-xlarge-mdpi/recents_thumbnail_bg_press.png Binary files differnew file mode 100644 index 0000000..a1c39e6 --- /dev/null +++ b/packages/SystemUI/res/drawable-xlarge-mdpi/recents_thumbnail_bg_press.png diff --git a/packages/SystemUI/res/drawable/pocket_drag_bg.xml b/packages/SystemUI/res/drawable/pocket_drag_bg.xml new file mode 100644 index 0000000..573a702 --- /dev/null +++ b/packages/SystemUI/res/drawable/pocket_drag_bg.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<bitmap + xmlns:android="http://schemas.android.com/apk/res/android" + android:tileMode="repeat" + android:src="@drawable/pocket_drag_pattern" + /> diff --git a/packages/SystemUI/res/drawable/recents_thumbnail_bg_holo.xml b/packages/SystemUI/res/drawable/recents_thumbnail_bg_holo.xml new file mode 100644 index 0000000..f9bba2a --- /dev/null +++ b/packages/SystemUI/res/drawable/recents_thumbnail_bg_holo.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* apps/common/assets/default/default/skins/StatusBar.xml +** +** Copyright 2011, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<transition xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@drawable/recents_thumbnail_bg_press"/> + <item android:drawable="@drawable/recents_thumbnail_bg_press"/> +</transition> diff --git a/packages/SystemUI/res/drawable/recents_thumbnail_bg_selector.xml b/packages/SystemUI/res/drawable/recents_thumbnail_bg_selector.xml new file mode 100644 index 0000000..0e58e12 --- /dev/null +++ b/packages/SystemUI/res/drawable/recents_thumbnail_bg_selector.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2011 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android" + android:exitFadeDuration="@android:integer/config_mediumAnimTime"> + + <item android:state_window_focused="false" android:drawable="@android:color/transparent" /> + + <!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. --> + <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/recents_thumbnail_bg_holo" /> + <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/recents_thumbnail_bg_holo" /> + <item android:state_focused="true" android:drawable="@drawable/recents_thumbnail_bg_holo" /> +</selector> + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml index 6c173c9..d9f3f23 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml @@ -32,7 +32,6 @@ android:id="@+id/bar_contents" android:layout_width="match_parent" android:layout_height="match_parent" - android:animateLayoutChanges="true" > <!-- notification icons & panel access --> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml index efbf359..f6ed804 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml @@ -85,7 +85,9 @@ android:layout_height="wrap_content" android:overScrollMode="ifContentScrolls" android:layout_marginTop="3dip" - android:layout_weight="1"> + android:layout_weight="1" + android:scrollbarAlwaysDrawVerticalTrack="true" + android:scrollbarDefaultDelayBeforeFade="75000"> <LinearLayout android:id="@+id/input_method_menu_list" android:layout_width="wrap_content" diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml index 6e3b0d7..f53b29e 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml @@ -41,6 +41,7 @@ android:src="@drawable/ic_sysbar_ime_default" android:visibility="gone" /> + <com.android.systemui.statusbar.tablet.NotificationIconArea android:id="@+id/notificationIcons" android:layout_width="wrap_content" diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml index 3fdfdbb..bfa6c36 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml @@ -22,14 +22,14 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" - android:layout_width="156dip"> + android:layout_width="@dimen/status_bar_recents_thumbnail_view_width"> <ImageView android:id="@+id/app_thumbnail" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" - android:layout_marginLeft="105dip" + android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin" android:scaleType="center" /> @@ -40,6 +40,9 @@ android:layout_alignParentTop="true" android:layout_marginLeft="123dip" android:layout_marginTop="16dip" + android:maxWidth="@dimen/status_bar_recents_thumbnail_max_width" + android:maxHeight="@dimen/status_bar_recents_thumbnail_max_height" + android:adjustViewBounds="true" /> <View android:id="@+id/recents_callout_line" @@ -55,26 +58,33 @@ /> <TextView android:id="@+id/app_label" - android:layout_width="113dip" + android:layout_width="97dip" android:layout_height="wrap_content" android:textSize="18dip" - android:fadingEdge="none" - android:fadingEdgeLength="0dp" + android:fadingEdge="horizontal" + android:fadingEdgeLength="10dip" android:scrollHorizontally="true" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="16dip" android:layout_marginTop="32dip" + android:singleLine="true" + android:ellipsize="marquee" /> <TextView android:id="@+id/app_description" - android:layout_width="wrap_content" + android:layout_width="97dip" android:layout_height="wrap_content" android:textSize="18dip" + android:fadingEdge="horizontal" + android:fadingEdgeLength="10dip" + android:scrollHorizontally="true" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="16dip" android:layout_marginTop="61dip" + android:singleLine="true" + android:ellipsize="marquee" /> </RelativeLayout> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml index ecd2b6f..eda19b7 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml @@ -36,36 +36,35 @@ <LinearLayout android:id="@+id/recents_glow" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="horizontal" - android:layout_marginBottom="-28dip" + android:layout_marginBottom="-49dip" android:layout_gravity="bottom" - android:background="@drawable/recents_blue_glow"> + android:background="@drawable/recents_blue_glow" + android:orientation="horizontal" + > - <LinearLayout android:id="@+id/recents_container" - android:layout_width="356dip" + <ListView android:id="@+id/recents_container" + android:layout_width="@dimen/status_bar_recents_width" android:layout_height="wrap_content" - android:orientation="vertical" android:layout_marginRight="100dip" + android:divider="@null" + android:scrollingCache="true" + android:stackFromBottom="true" + android:fadingEdge="vertical" + android:scrollbars="none" + android:fadingEdgeLength="30dip" + android:listSelector="@drawable/recents_thumbnail_bg_selector" /> </LinearLayout> </FrameLayout> - <!-- The outer FrameLayout is just used as an opaque background for the dismiss icon --> - <FrameLayout + <View android:id="@+id/recents_dismiss_button" android:layout_width="80px" android:layout_height="@*android:dimen/status_bar_height" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" - android:background="#ff000000"> - - <View android:id="@+id/recents_dismiss_button" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@drawable/ic_sysbar_back_ime" - /> - - </FrameLayout> + android:background="@drawable/ic_sysbar_back_ime" + /> </com.android.systemui.statusbar.tablet.RecentAppsPanel> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel_footer.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel_footer.xml new file mode 100644 index 0000000..4d14d1f --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel_footer.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* apps/common/assets/default/default/skins/StatusBar.xml +** +** Copyright 2011, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/listview_footer_padding" + android:layout_height="24dip" + android:layout_width="match_parent"> +</FrameLayout> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml index 75bbb3a..fbb3c78 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml @@ -21,7 +21,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingRight="48dp" > <!-- Airplane mode --> diff --git a/packages/SystemUI/res/values-ar-xlarge/strings.xml b/packages/SystemUI/res/values-ar-xlarge/strings.xml index 82054e0..af0eed0 100644 --- a/packages/SystemUI/res/values-ar-xlarge/strings.xml +++ b/packages/SystemUI/res/values-ar-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi متصل"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"جارٍ البحث عن GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"تم تعيين الموقع بواسطة GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-bg-xlarge/strings.xml b/packages/SystemUI/res/values-bg-xlarge/strings.xml index 4e734c1..d44366d 100644 --- a/packages/SystemUI/res/values-bg-xlarge/strings.xml +++ b/packages/SystemUI/res/values-bg-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: има връзка"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Търси се GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Местоположението е зададено от GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-ca-xlarge/strings.xml b/packages/SystemUI/res/values-ca-xlarge/strings.xml index 8fb96a1..a0ace2c 100644 --- a/packages/SystemUI/res/values-ca-xlarge/strings.xml +++ b/packages/SystemUI/res/values-ca-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: connectat"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"S\'està cercant un GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"S\'ha establert la ubicació per GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-cs-xlarge/strings.xml b/packages/SystemUI/res/values-cs-xlarge/strings.xml index 2f3f38f..5fe365c 100644 --- a/packages/SystemUI/res/values-cs-xlarge/strings.xml +++ b/packages/SystemUI/res/values-cs-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: připojeno"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Vyhledávání satelitů GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Poloha nastavena pomocí GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-da-xlarge/strings.xml b/packages/SystemUI/res/values-da-xlarge/strings.xml index c7f1101..ae430b3 100644 --- a/packages/SystemUI/res/values-da-xlarge/strings.xml +++ b/packages/SystemUI/res/values-da-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi er forbundet"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Søger efter GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Placeringen er angivet ved hjælp af GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-de-xlarge/strings.xml b/packages/SystemUI/res/values-de-xlarge/strings.xml index c4b7cc5..825cd0d 100644 --- a/packages/SystemUI/res/values-de-xlarge/strings.xml +++ b/packages/SystemUI/res/values-de-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Mit WLAN verbunden"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Suche nach GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Standort durch GPS festgelegt"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-el-xlarge/strings.xml b/packages/SystemUI/res/values-el-xlarge/strings.xml index 26ebe47..4902bb5 100644 --- a/packages/SystemUI/res/values-el-xlarge/strings.xml +++ b/packages/SystemUI/res/values-el-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: συνδέθηκε"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Αναζήτηση για GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Ρύθμιση τοποθεσίας με GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-en-rGB-xlarge/strings.xml b/packages/SystemUI/res/values-en-rGB-xlarge/strings.xml index c6887e1..de1eb52 100644 --- a/packages/SystemUI/res/values-en-rGB-xlarge/strings.xml +++ b/packages/SystemUI/res/values-en-rGB-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi connected"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Searching for GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Location set by GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-es-rUS-xlarge-land/strings.xml b/packages/SystemUI/res/values-es-rUS-xlarge-land/strings.xml new file mode 100644 index 0000000..78a4c18 --- /dev/null +++ b/packages/SystemUI/res/values-es-rUS-xlarge-land/strings.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- XL --> + <string name="toast_rotation_locked" msgid="2686639138967158852">"La pantalla está bloqueada en orientación paisaje."</string> +</resources> diff --git a/packages/SystemUI/res/values-es-rUS-xlarge-port/strings.xml b/packages/SystemUI/res/values-es-rUS-xlarge-port/strings.xml new file mode 100644 index 0000000..9daef6a --- /dev/null +++ b/packages/SystemUI/res/values-es-rUS-xlarge-port/strings.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<resources xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- XL --> + <string name="toast_rotation_locked" msgid="4297721709987511908">"La pantalla está bloqueada en orientación retrato."</string> +</resources> diff --git a/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml b/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml index 9e85c12..2ace144 100644 --- a/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml +++ b/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"WiFi conectado"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Buscando GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"La ubicación se estableció por GPS."</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-es-xlarge/strings.xml b/packages/SystemUI/res/values-es-xlarge/strings.xml index b8e5e84..dd490fb 100644 --- a/packages/SystemUI/res/values-es-xlarge/strings.xml +++ b/packages/SystemUI/res/values-es-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Con conexión WiFi"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Buscando GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Ubicación definida por GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-fa-xlarge/strings.xml b/packages/SystemUI/res/values-fa-xlarge/strings.xml index 1c0f5be..6e0654d 100644 --- a/packages/SystemUI/res/values-fa-xlarge/strings.xml +++ b/packages/SystemUI/res/values-fa-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi متصل شد"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"جستجوی GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"مکان تنظیم شده توسط GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-fi-xlarge/strings.xml b/packages/SystemUI/res/values-fi-xlarge/strings.xml index 2c70717..7d49e9b 100644 --- a/packages/SystemUI/res/values-fi-xlarge/strings.xml +++ b/packages/SystemUI/res/values-fi-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wifi yhdistetty"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Haetaan GPS-yhteyttä"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Sijainti määritetty GPS:n avulla"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-fr-xlarge/strings.xml b/packages/SystemUI/res/values-fr-xlarge/strings.xml index 41ecad4..98dc6c0 100644 --- a/packages/SystemUI/res/values-fr-xlarge/strings.xml +++ b/packages/SystemUI/res/values-fr-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Connecté au Wi-Fi"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Recherche de GPS en cours"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Position définie par GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-hr-xlarge/strings.xml b/packages/SystemUI/res/values-hr-xlarge/strings.xml index ea91e64..08adaf0 100644 --- a/packages/SystemUI/res/values-hr-xlarge/strings.xml +++ b/packages/SystemUI/res/values-hr-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: povezano"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Pretraživanje GPS-a"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokaciju utvrdio GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-hu-xlarge/strings.xml b/packages/SystemUI/res/values-hu-xlarge/strings.xml index 9902663..41d60fc 100644 --- a/packages/SystemUI/res/values-hu-xlarge/strings.xml +++ b/packages/SystemUI/res/values-hu-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi csatlakozva"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"GPS keresése"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"A GPS beállította a helyet"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-in-xlarge/strings.xml b/packages/SystemUI/res/values-in-xlarge/strings.xml index 3323bfd..8d95060 100644 --- a/packages/SystemUI/res/values-in-xlarge/strings.xml +++ b/packages/SystemUI/res/values-in-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi tersambung"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Menelusuri GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokasi yang disetel oleh GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-it-xlarge/strings.xml b/packages/SystemUI/res/values-it-xlarge/strings.xml index 2e01bcc..68393fb 100644 --- a/packages/SystemUI/res/values-it-xlarge/strings.xml +++ b/packages/SystemUI/res/values-it-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: connesso"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Ricerca del GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Posizione stabilita dal GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-iw-xlarge/strings.xml b/packages/SystemUI/res/values-iw-xlarge/strings.xml index 0e03df3..fd3ce0e 100644 --- a/packages/SystemUI/res/values-iw-xlarge/strings.xml +++ b/packages/SystemUI/res/values-iw-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi מחובר"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"מחפש GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"מיקום מוגדר על ידי GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-ja-xlarge/strings.xml b/packages/SystemUI/res/values-ja-xlarge/strings.xml index 2506520..c7c0824 100644 --- a/packages/SystemUI/res/values-ja-xlarge/strings.xml +++ b/packages/SystemUI/res/values-ja-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi接続済み"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"GPSで検索中"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"GPSにより現在地が設定されました"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-ko-xlarge/strings.xml b/packages/SystemUI/res/values-ko-xlarge/strings.xml index b0ddfab..3777154 100644 --- a/packages/SystemUI/res/values-ko-xlarge/strings.xml +++ b/packages/SystemUI/res/values-ko-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi 연결됨"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"GPS 검색"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS에서 설정한 위치"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-lt-xlarge/strings.xml b/packages/SystemUI/res/values-lt-xlarge/strings.xml index e03b885..90dd501 100644 --- a/packages/SystemUI/res/values-lt-xlarge/strings.xml +++ b/packages/SystemUI/res/values-lt-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Prisijungta prie „Wi-Fi“"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Ieškoma GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS nustatyta vieta"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-lv-xlarge/strings.xml b/packages/SystemUI/res/values-lv-xlarge/strings.xml index ba51eb9..c533ecb 100644 --- a/packages/SystemUI/res/values-lv-xlarge/strings.xml +++ b/packages/SystemUI/res/values-lv-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Izv. sav. ar Wi-Fi"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Notiek GPS meklēšana..."</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS iestatītā atrašanās vieta"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-nb-xlarge/strings.xml b/packages/SystemUI/res/values-nb-xlarge/strings.xml index 215f430..2bf63e8 100644 --- a/packages/SystemUI/res/values-nb-xlarge/strings.xml +++ b/packages/SystemUI/res/values-nb-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: tilkoblet"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Søker etter GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Posisjon angitt av GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-nl-xlarge/strings.xml b/packages/SystemUI/res/values-nl-xlarge/strings.xml index adaa25f..7a63401 100644 --- a/packages/SystemUI/res/values-nl-xlarge/strings.xml +++ b/packages/SystemUI/res/values-nl-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Verbonden via Wi-Fi"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Zoeken naar GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Locatie bepaald met GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-pl-xlarge/strings.xml b/packages/SystemUI/res/values-pl-xlarge/strings.xml index 65f4f31..1334b70 100644 --- a/packages/SystemUI/res/values-pl-xlarge/strings.xml +++ b/packages/SystemUI/res/values-pl-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: połączono"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Wyszukiwanie sygnału GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokalizacja ustawiona wg GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml b/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml index f5df355..a5d6bac 100644 --- a/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml +++ b/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi ligado"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"A procurar GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Localização definida por GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-pt-xlarge/strings.xml b/packages/SystemUI/res/values-pt-xlarge/strings.xml index ea2af73..5209ab9 100644 --- a/packages/SystemUI/res/values-pt-xlarge/strings.xml +++ b/packages/SystemUI/res/values-pt-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi conectado"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Procurando GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Localização definida por GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-ro-xlarge/strings.xml b/packages/SystemUI/res/values-ro-xlarge/strings.xml index f8d9c87..2dedd3b 100644 --- a/packages/SystemUI/res/values-ro-xlarge/strings.xml +++ b/packages/SystemUI/res/values-ro-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi conectat"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Se caută dispozitivul GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Locaţie setată prin GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-ru-xlarge/strings.xml b/packages/SystemUI/res/values-ru-xlarge/strings.xml index 1573274..212fa83 100644 --- a/packages/SystemUI/res/values-ru-xlarge/strings.xml +++ b/packages/SystemUI/res/values-ru-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi подкл."</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Выполняется поиск при помощи GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Местоположение установлено при помощи GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-sk-xlarge/strings.xml b/packages/SystemUI/res/values-sk-xlarge/strings.xml index 1beb8de..0fcdd4a 100644 --- a/packages/SystemUI/res/values-sk-xlarge/strings.xml +++ b/packages/SystemUI/res/values-sk-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi: pripojené"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Hľadanie signálu GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Poloha určená pomocou GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-sl-xlarge/strings.xml b/packages/SystemUI/res/values-sl-xlarge/strings.xml index a4f5a18..615c565 100644 --- a/packages/SystemUI/res/values-sl-xlarge/strings.xml +++ b/packages/SystemUI/res/values-sl-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi – povezano"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Iskanje GPS-a"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokacija nastavljena z GPS-om"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-sr-xlarge/strings.xml b/packages/SystemUI/res/values-sr-xlarge/strings.xml index b51a043..d66765b 100644 --- a/packages/SystemUI/res/values-sr-xlarge/strings.xml +++ b/packages/SystemUI/res/values-sr-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi је повезан"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Тражи се GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Локацију је подесио GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-sv-xlarge/strings.xml b/packages/SystemUI/res/values-sv-xlarge/strings.xml index e6797d5..b53269e 100644 --- a/packages/SystemUI/res/values-sv-xlarge/strings.xml +++ b/packages/SystemUI/res/values-sv-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi-ansluten"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Sökning efter GPS pågår"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Platsen har identifierats av GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-th-xlarge/strings.xml b/packages/SystemUI/res/values-th-xlarge/strings.xml index 2f5ca3d..8222140 100644 --- a/packages/SystemUI/res/values-th-xlarge/strings.xml +++ b/packages/SystemUI/res/values-th-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"เชื่อมต่อ Wi-Fi แล้ว"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"การค้นหาสำหรับ GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"ตำแหน่งที่กำหนดโดย GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-tl-xlarge/strings.xml b/packages/SystemUI/res/values-tl-xlarge/strings.xml index 8fa8b65..0eef090 100644 --- a/packages/SystemUI/res/values-tl-xlarge/strings.xml +++ b/packages/SystemUI/res/values-tl-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Konektado ang WiFi"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Naghahanap ng GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Lokasyon na itinatakda ng GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-tr-xlarge/strings.xml b/packages/SystemUI/res/values-tr-xlarge/strings.xml index e9f7d7b..8c382fb 100644 --- a/packages/SystemUI/res/values-tr-xlarge/strings.xml +++ b/packages/SystemUI/res/values-tr-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Kablosuz bağlandı"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"GPS aranıyor"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Konum GPS ile belirlendi"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-uk-xlarge/strings.xml b/packages/SystemUI/res/values-uk-xlarge/strings.xml index e2ab840..6b1b193 100644 --- a/packages/SystemUI/res/values-uk-xlarge/strings.xml +++ b/packages/SystemUI/res/values-uk-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi під\'єднано"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Виконується пошук за допомогою GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Місцезнаходження встановлено за допомогою GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-vi-xlarge/strings.xml b/packages/SystemUI/res/values-vi-xlarge/strings.xml index acbbd46..b44e1c3 100644 --- a/packages/SystemUI/res/values-vi-xlarge/strings.xml +++ b/packages/SystemUI/res/values-vi-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Đã kết nối Wi-Fi"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"Tìm kiếm GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"Vị trí đặt bởi GPS"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-xlarge/strings.xml b/packages/SystemUI/res/values-xlarge/strings.xml index dfd5851..35be532 100644 --- a/packages/SystemUI/res/values-xlarge/strings.xml +++ b/packages/SystemUI/res/values-xlarge/strings.xml @@ -43,4 +43,11 @@ <!-- Notification text: when GPS has found a fix [CHAR LIMIT=50] --> <string name="gps_notification_found_text">Location set by GPS</string> + + <!-- Title for the pseudo-notification shown when notifications are disabled (do-not-disturb + mode) --> + <string name="notifications_off_title">Notifications off</string> + + <!-- Content text for do-not-disturb mode notification --> + <string name="notifications_off_text">Tap here to turn notifications back on.</string> </resources> diff --git a/packages/SystemUI/res/values-xlarge/styles.xml b/packages/SystemUI/res/values-xlarge/styles.xml index c1cd533..12c8950 100644 --- a/packages/SystemUI/res/values-xlarge/styles.xml +++ b/packages/SystemUI/res/values-xlarge/styles.xml @@ -22,9 +22,11 @@ </style> <style name="StatusBarPanelSettingsRow"> + <item name="android:paddingRight">48dp</item> <item name="android:layout_height">64dp</item> <item name="android:layout_width">match_parent</item> <item name="android:orientation">horizontal</item> + <item name="android:background">?android:attr/listChoiceBackgroundIndicator</item> </style> <style name="StatusBarPanelSettingsIcon"> @@ -43,6 +45,7 @@ </style> <style name="StatusBarPanelSettingsPanelSeparator"> + <item name="android:layout_marginRight">48dp</item> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">1dp</item> <item name="android:background">@android:drawable/divider_horizontal_dark</item> diff --git a/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml b/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml index 6122556..f599dca 100644 --- a/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml +++ b/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi 已连接"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"正在搜索 GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS 设置的位置"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml b/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml index 4e77075..2191db7 100644 --- a/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml +++ b/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml @@ -24,4 +24,8 @@ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="1456658018593445677">"Wi-Fi 已連線"</string> <string name="gps_notification_searching_text" msgid="894185519046488403">"正在搜尋 GPS"</string> <string name="gps_notification_found_text" msgid="5306445324124275852">"GPS 已定位"</string> + <!-- no translation found for notifications_off_title (2297252328026582111) --> + <skip /> + <!-- no translation found for notifications_off_text (3754847213329718358) --> + <skip /> </resources> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 93cf377..88cd43c 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -2,21 +2,34 @@ <!-- * Copyright (c) 2006, The Android Open Source Project * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * 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 + * 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 + * 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> <!-- Margin at the edge of the screen to ignore touch events for in the windowshade. --> <dimen name="status_bar_edge_ignore">5dp</dimen> + + <!-- Recent Applications parameters --> + <!-- Width of a recent app view, including all content --> + <dimen name="status_bar_recents_thumbnail_view_width">156dp</dimen> + <!-- How far the thumbnail for a recent app appears from left edge --> + <dimen name="status_bar_recents_thumbnail_left_margin">110dp</dimen> + <!-- Upper width limit for application icon --> + <dimen name="status_bar_recents_thumbnail_max_width">64dp</dimen> + <!-- Upper height limit for application icon --> + <dimen name="status_bar_recents_thumbnail_max_height">64dp</dimen> + <!-- Width of scrollable area in recents --> + <dimen name="status_bar_recents_width">356dp</dimen> + </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java index dfe0262..826ac92 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java @@ -246,6 +246,16 @@ public class PhoneStatusBarPolicy { R.drawable.stat_sys_data_fully_out_3g, R.drawable.stat_sys_data_fully_inandout_3g } }; + private static final int[][] sDataNetType_4g = { + { R.drawable.stat_sys_data_connected_4g, + R.drawable.stat_sys_data_in_4g, + R.drawable.stat_sys_data_out_4g, + R.drawable.stat_sys_data_inandout_4g }, + { R.drawable.stat_sys_data_fully_connected_4g, + R.drawable.stat_sys_data_fully_in_4g, + R.drawable.stat_sys_data_fully_out_4g, + R.drawable.stat_sys_data_fully_inandout_4g } + }; private static final int[][] sDataNetType_e = { { R.drawable.stat_sys_data_connected_e, R.drawable.stat_sys_data_in_e, @@ -599,16 +609,6 @@ public class PhoneStatusBarPolicy { return (mSignalStrength != null) && !mSignalStrength.isGsm(); } - private boolean isEvdo() { - return ( (mServiceState != null) - && ((mServiceState.getRadioTechnology() - == ServiceState.RADIO_TECHNOLOGY_EVDO_0) - || (mServiceState.getRadioTechnology() - == ServiceState.RADIO_TECHNOLOGY_EVDO_A) - || (mServiceState.getRadioTechnology() - == ServiceState.RADIO_TECHNOLOGY_EVDO_B))); - } - private boolean hasService() { if (mServiceState != null) { switch (mServiceState.getState()) { @@ -624,7 +624,6 @@ public class PhoneStatusBarPolicy { } private final void updateSignalStrength() { - int iconLevel = -1; int[] iconList; // Display signal strength while in "emergency calls only" mode @@ -641,18 +640,6 @@ public class PhoneStatusBarPolicy { } if (!isCdma()) { - int asu = mSignalStrength.getGsmSignalStrength(); - - // ASU ranges from 0 to 31 - TS 27.007 Sec 8.5 - // asu = 0 (-113dB or less) is very weak - // signal, its better to show 0 bars to the user in such cases. - // asu = 99 is a special case, where the signal strength is unknown. - if (asu <= 2 || asu == 99) iconLevel = 0; - else if (asu >= 12) iconLevel = 4; - else if (asu >= 8) iconLevel = 3; - else if (asu >= 5) iconLevel = 2; - else iconLevel = 1; - // Though mPhone is a Manager, this call is not an IPC if (mPhone.isNetworkRoaming()) { iconList = sSignalImages_r[mInetCondition]; @@ -661,67 +648,11 @@ public class PhoneStatusBarPolicy { } } else { iconList = sSignalImages[mInetCondition]; - - // If 3G(EV) and 1x network are available than 3G should be - // displayed, displayed RSSI should be from the EV side. - // If a voice call is made then RSSI should switch to 1x. - if ((mPhoneState == TelephonyManager.CALL_STATE_IDLE) && isEvdo()){ - iconLevel = getEvdoLevel(); - if (false) { - Slog.d(TAG, "use Evdo level=" + iconLevel + " to replace Cdma Level=" - + getCdmaLevel()); - } - } else { - iconLevel = getCdmaLevel(); - } } - mPhoneSignalIconId = iconList[iconLevel]; + mPhoneSignalIconId = iconList[mSignalStrength.getLevel()]; mService.setIcon("phone_signal", mPhoneSignalIconId, 0); } - private int getCdmaLevel() { - final int cdmaDbm = mSignalStrength.getCdmaDbm(); - final int cdmaEcio = mSignalStrength.getCdmaEcio(); - int levelDbm = 0; - int levelEcio = 0; - - if (cdmaDbm >= -75) levelDbm = 4; - else if (cdmaDbm >= -85) levelDbm = 3; - else if (cdmaDbm >= -95) levelDbm = 2; - else if (cdmaDbm >= -100) levelDbm = 1; - else levelDbm = 0; - - // Ec/Io are in dB*10 - if (cdmaEcio >= -90) levelEcio = 4; - else if (cdmaEcio >= -110) levelEcio = 3; - else if (cdmaEcio >= -130) levelEcio = 2; - else if (cdmaEcio >= -150) levelEcio = 1; - else levelEcio = 0; - - return (levelDbm < levelEcio) ? levelDbm : levelEcio; - } - - private int getEvdoLevel() { - int evdoDbm = mSignalStrength.getEvdoDbm(); - int evdoSnr = mSignalStrength.getEvdoSnr(); - int levelEvdoDbm = 0; - int levelEvdoSnr = 0; - - if (evdoDbm >= -65) levelEvdoDbm = 4; - else if (evdoDbm >= -75) levelEvdoDbm = 3; - else if (evdoDbm >= -90) levelEvdoDbm = 2; - else if (evdoDbm >= -105) levelEvdoDbm = 1; - else levelEvdoDbm = 0; - - if (evdoSnr >= 7) levelEvdoSnr = 4; - else if (evdoSnr >= 5) levelEvdoSnr = 3; - else if (evdoSnr >= 3) levelEvdoSnr = 2; - else if (evdoSnr >= 1) levelEvdoSnr = 1; - else levelEvdoSnr = 0; - - return (levelEvdoDbm < levelEvdoSnr) ? levelEvdoDbm : levelEvdoSnr; - } - private final void updateDataNetType(int net) { switch (net) { case TelephonyManager.NETWORK_TYPE_EDGE: @@ -749,9 +680,12 @@ public class PhoneStatusBarPolicy { case TelephonyManager.NETWORK_TYPE_EVDO_0: //fall through case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_EVDO_B: + case TelephonyManager.NETWORK_TYPE_EHRPD: mDataIconList = sDataNetType_3g[mInetCondition]; break; - // TODO - add support for NETWORK_TYPE_LTE and NETWORK_TYPE_EHRPD + case TelephonyManager.NETWORK_TYPE_LTE: + mDataIconList = sDataNetType_4g[mInetCondition]; + break; default: mDataIconList = sDataNetType_g[mInetCondition]; break; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java index e80e37d..e81cec2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java @@ -25,12 +25,14 @@ import android.os.SystemClock; import android.os.ServiceManager; import android.util.AttributeSet; import android.util.Slog; +import android.view.accessibility.AccessibilityEvent; import android.view.HapticFeedbackConstants; import android.view.IWindowManager; import android.view.InputDevice; import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.MotionEvent; +import android.view.SoundEffectConstants; import android.view.ViewConfiguration; import android.widget.ImageView; import android.widget.RemoteViews.RemoteView; @@ -42,18 +44,22 @@ public class KeyButtonView extends ImageView { IWindowManager mWindowManager; long mDownTime; - boolean mSending, mLongPressed; + boolean mSending; int mCode; int mRepeat; + int mTouchSlop; + Runnable mCheckLongPress = new Runnable() { public void run() { if (isPressed()) { - mLongPressed = true; mRepeat++; sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY | KeyEvent.FLAG_LONG_PRESS); + + sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); + //playSoundEffect(SoundEffectConstants.CLICK); } } }; @@ -79,6 +85,7 @@ public class KeyButtonView extends ImageView { ServiceManager.getService(Context.WINDOW_SERVICE)); setClickable(true); + mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); } public boolean onTouchEvent(MotionEvent ev) { @@ -91,7 +98,6 @@ public class KeyButtonView extends ImageView { mDownTime = SystemClock.uptimeMillis(); mRepeat = 0; mSending = true; - mLongPressed = false; sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY, mDownTime); setPressed(true); @@ -102,12 +108,15 @@ public class KeyButtonView extends ImageView { if (mSending) { x = (int)ev.getX(); y = (int)ev.getY(); - setPressed(x >= 0 && x < getWidth() && y >= 0 && y < getHeight()); + setPressed(x >= -mTouchSlop + && x < getWidth() + mTouchSlop + && y >= -mTouchSlop + && y < getHeight() + mTouchSlop); } break; case MotionEvent.ACTION_CANCEL: setPressed(false); - if (mSending && !mLongPressed) { + if (mSending) { mSending = false; sendEvent(KeyEvent.ACTION_UP, KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY @@ -116,12 +125,18 @@ public class KeyButtonView extends ImageView { } break; case MotionEvent.ACTION_UP: + final boolean doIt = isPressed(); setPressed(false); - if (mSending && !mLongPressed) { + if (mSending) { mSending = false; - sendEvent(KeyEvent.ACTION_UP, - KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY); removeCallbacks(mCheckLongPress); + if (doIt) { + sendEvent(KeyEvent.ACTION_UP, + KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY); + + sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); + playSoundEffect(SoundEffectConstants.CLICK); + } } break; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index 0dc7e8d..326cd74 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -33,6 +33,11 @@ import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Binder; +import android.os.Handler; +import android.os.HandlerThread; +import android.os.Looper; +import android.os.Message; +import android.os.Messenger; import android.os.RemoteException; import android.os.SystemProperties; import android.provider.Settings; @@ -51,6 +56,7 @@ import com.android.internal.telephony.IccCard; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.telephony.cdma.EriInfo; import com.android.server.am.BatteryStatsService; +import com.android.internal.util.AsyncChannel; import com.android.systemui.R; @@ -83,6 +89,7 @@ public class NetworkController extends BroadcastReceiver { // wifi final WifiManager mWifiManager; + AsyncChannel mWifiChannel; boolean mWifiEnabled, mWifiConnected; int mWifiLevel; String mWifiSsid; @@ -146,6 +153,14 @@ public class NetworkController extends BroadcastReceiver { // wifi mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); + HandlerThread handlerThread = new HandlerThread("WifiServiceThread"); + handlerThread.start(); + Handler handler = new WifiHandler(handlerThread.getLooper()); + mWifiChannel = new AsyncChannel(); + Messenger wifiMessenger = mWifiManager.getMessenger(); + if (wifiMessenger != null) { + mWifiChannel.connect(mContext, handler, wifiMessenger); + } // broadcasts IntentFilter filter = new IntentFilter(); @@ -195,6 +210,7 @@ public class NetworkController extends BroadcastReceiver { mLabelViews.add(v); } + @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (action.equals(WifiManager.RSSI_CHANGED_ACTION) @@ -317,13 +333,6 @@ public class NetworkController extends BroadcastReceiver { return (mSignalStrength != null) && !mSignalStrength.isGsm(); } - private boolean isEvdo() { - return ((mServiceState != null) - && ((mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_0) - || (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_A) - || (mServiceState.getRadioTechnology() == ServiceState.RADIO_TECHNOLOGY_EVDO_B))); - } - private boolean hasService() { if (mServiceState != null) { switch (mServiceState.getState()) { @@ -343,50 +352,6 @@ public class NetworkController extends BroadcastReceiver { return (! "wifi-only".equals(SystemProperties.get("ro.carrier"))); } - private int getCdmaLevel() { - if (mSignalStrength == null) return 0; - final int cdmaDbm = mSignalStrength.getCdmaDbm(); - final int cdmaEcio = mSignalStrength.getCdmaEcio(); - int levelDbm = 0; - int levelEcio = 0; - - if (cdmaDbm >= -75) levelDbm = 4; - else if (cdmaDbm >= -85) levelDbm = 3; - else if (cdmaDbm >= -95) levelDbm = 2; - else if (cdmaDbm >= -100) levelDbm = 1; - else levelDbm = 0; - - // Ec/Io are in dB*10 - if (cdmaEcio >= -90) levelEcio = 4; - else if (cdmaEcio >= -110) levelEcio = 3; - else if (cdmaEcio >= -130) levelEcio = 2; - else if (cdmaEcio >= -150) levelEcio = 1; - else levelEcio = 0; - - return (levelDbm < levelEcio) ? levelDbm : levelEcio; - } - - private int getEvdoLevel() { - if (mSignalStrength == null) return 0; - int evdoDbm = mSignalStrength.getEvdoDbm(); - int evdoSnr = mSignalStrength.getEvdoSnr(); - int levelEvdoDbm = 0; - int levelEvdoSnr = 0; - - if (evdoDbm >= -65) levelEvdoDbm = 4; - else if (evdoDbm >= -75) levelEvdoDbm = 3; - else if (evdoDbm >= -90) levelEvdoDbm = 2; - else if (evdoDbm >= -105) levelEvdoDbm = 1; - else levelEvdoDbm = 0; - - if (evdoSnr >= 7) levelEvdoSnr = 4; - else if (evdoSnr >= 5) levelEvdoSnr = 3; - else if (evdoSnr >= 3) levelEvdoSnr = 2; - else if (evdoSnr >= 1) levelEvdoSnr = 1; - else levelEvdoSnr = 0; - - return (levelEvdoDbm < levelEvdoSnr) ? levelEvdoDbm : levelEvdoSnr; - } private void updateAirplaneMode() { mAirplaneMode = (Settings.System.getInt(mContext.getContentResolver(), @@ -402,44 +367,23 @@ public class NetworkController extends BroadcastReceiver { if (mSignalStrength == null) { mPhoneSignalIconId = R.drawable.stat_sys_signal_null; mDataSignalIconId = R.drawable.stat_sys_signal_0; // note we use 0 instead of null - } else if (isCdma()) { - // If 3G(EV) and 1x network are available than 3G should be - // displayed, displayed RSSI should be from the EV side. - // If a voice call is made then RSSI should switch to 1x. - int iconLevel; - if ((mPhoneState == TelephonyManager.CALL_STATE_IDLE) && isEvdo()){ - iconLevel = getEvdoLevel(); - } else { - iconLevel = getCdmaLevel(); - } - int[] iconList; - if (isCdmaEri()) { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; - } else { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; - } - mPhoneSignalIconId = iconList[iconLevel]; - mDataSignalIconId = TelephonyIcons.DATA_SIGNAL_STRENGTH[mInetCondition][iconLevel]; } else { - int asu = mSignalStrength.getGsmSignalStrength(); - - // ASU ranges from 0 to 31 - TS 27.007 Sec 8.5 - // asu = 0 (-113dB or less) is very weak - // signal, its better to show 0 bars to the user in such cases. - // asu = 99 is a special case, where the signal strength is unknown. int iconLevel; - if (asu <= 2 || asu == 99) iconLevel = 0; - else if (asu >= 12) iconLevel = 4; - else if (asu >= 8) iconLevel = 3; - else if (asu >= 5) iconLevel = 2; - else iconLevel = 1; - - // Though mPhone is a Manager, this call is not an IPC int[] iconList; - if (mPhone.isNetworkRoaming()) { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; + iconLevel = mSignalStrength.getLevel(); + if (isCdma()) { + if (isCdmaEri()) { + iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; + } else { + iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; + } } else { - iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; + // Though mPhone is a Manager, this call is not an IPC + if (mPhone.isNetworkRoaming()) { + iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition]; + } else { + iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH[mInetCondition]; + } } mPhoneSignalIconId = iconList[iconLevel]; mDataSignalIconId = TelephonyIcons.DATA_SIGNAL_STRENGTH[mInetCondition][iconLevel]; @@ -484,10 +428,14 @@ public class NetworkController extends BroadcastReceiver { case TelephonyManager.NETWORK_TYPE_EVDO_0: //fall through case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_EVDO_B: + case TelephonyManager.NETWORK_TYPE_EHRPD: mDataIconList = TelephonyIcons.DATA_3G[mInetCondition]; mDataTypeIconId = R.drawable.stat_sys_signal_3g; break; - // TODO - add support for NETWORK_TYPE_LTE and NETWORK_TYPE_EHRPD + case TelephonyManager.NETWORK_TYPE_LTE: + mDataIconList = TelephonyIcons.DATA_4G[mInetCondition]; + mDataTypeIconId = R.drawable.stat_sys_signal_4g; + break; default: mDataIconList = TelephonyIcons.DATA_G[mInetCondition]; mDataTypeIconId = R.drawable.stat_sys_signal_gprs; @@ -604,6 +552,44 @@ public class NetworkController extends BroadcastReceiver { // ===== Wifi =================================================================== + class WifiHandler extends Handler { + + WifiHandler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case AsyncChannel.CMD_CHANNEL_HALF_CONNECTED: + if (msg.arg1 == AsyncChannel.STATUS_SUCCESSFUL) { + mWifiChannel.sendMessage(Message.obtain(this, + AsyncChannel.CMD_CHANNEL_FULL_CONNECTION)); + } else { + Slog.e(TAG, "Failed to connect to wifi"); + } + break; + case WifiManager.DATA_ACTIVITY_NOTIFICATION: + int dataActivity = msg.arg1; + /* TODO: update icons based on data activity */ + switch (dataActivity) { + case WifiManager.DATA_ACTIVITY_IN: + break; + case WifiManager.DATA_ACTIVITY_OUT: + break; + case WifiManager.DATA_ACTIVITY_INOUT: + break; + case WifiManager.DATA_ACTIVITY_NONE: + break; + } + break; + default: + //Ignore + break; + } + } + } + private void updateWifiState(Intent intent) { final String action = intent.getAction(); if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java index 29d35e3..9093b3e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java @@ -124,5 +124,18 @@ class TelephonyIcons { R.drawable.stat_sys_data_fully_inandout_1x } }; + // LTE and eHRPD + static final int[][] DATA_4G = { + { R.drawable.stat_sys_data_connected_4g, + R.drawable.stat_sys_data_in_4g, + R.drawable.stat_sys_data_out_4g, + R.drawable.stat_sys_data_inandout_4g }, + { R.drawable.stat_sys_data_fully_connected_4g, + R.drawable.stat_sys_data_fully_in_4g, + R.drawable.stat_sys_data_fully_out_4g, + R.drawable.stat_sys_data_fully_inandout_4g } + }; + + } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java index b1e74ad..ce0848b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java @@ -90,8 +90,8 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, if (imi2 == null) return 0; if (imi1 == null) return 1; if (mPackageManager != null) { - CharSequence imiId1 = imi1.loadLabel(mPackageManager); - CharSequence imiId2 = imi2.loadLabel(mPackageManager); + CharSequence imiId1 = imi1.loadLabel(mPackageManager) + "/" + imi1.getId(); + CharSequence imiId2 = imi2.loadLabel(mPackageManager) + "/" + imi2.getId(); if (imiId1 != null && imiId2 != null) { return imiId1.toString().compareTo(imiId2.toString()); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java index 2ec2af0..8a88792 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java @@ -164,7 +164,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, } public void setNotificationCount(int n) { - Slog.d(TAG, "notificationCount=" + n); +// Slog.d(TAG, "notificationCount=" + n); if (!mShowing) { // just do it, already setContentFrameVisible(n > 0, false); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/PanelBackgroundView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/PanelBackgroundView.java index 5eafdc1..9ac933f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/PanelBackgroundView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/PanelBackgroundView.java @@ -14,28 +14,25 @@ * limitations under the License. */ -package com.android.systemui.statusbar.phone; +package com.android.systemui.statusbar.tablet; import android.content.Context; -import android.content.res.TypedArray; +import android.graphics.Canvas; import android.util.AttributeSet; -import android.util.Slog; import android.view.View; -import android.graphics.BitmapFactory; -import android.graphics.Bitmap; -import android.graphics.Paint; -import android.graphics.Canvas; public class PanelBackgroundView extends View { + /* private Bitmap mTexture; private Paint mPaint; private int mTextureWidth; private int mTextureHeight; - + */ + public PanelBackgroundView(Context context, AttributeSet attrs) { super(context, attrs); /* - mTexture = BitmapFactory.decodeResource(getResources(), + mTexture = BitmapFactory.decodeResource(getResources(), com.android.internal.R.drawable.status_bar_background); mTextureWidth = mTexture.getWidth(); mTextureHeight = mTexture.getHeight(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java index 86c3e75..1135b73 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java @@ -44,33 +44,37 @@ import android.util.AttributeSet; import android.util.DisplayMetrics; import android.util.Log; import android.util.Slog; +import android.view.LayoutInflater; import android.view.View; -import android.view.View.OnClickListener; -import android.view.animation.DecelerateInterpolator; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.AdapterView.OnItemClickListener; +import android.widget.BaseAdapter; import android.widget.ImageView; -import android.widget.LinearLayout; +import android.widget.ListView; import android.widget.RelativeLayout; import android.widget.TextView; import com.android.systemui.R; -public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, OnClickListener { +public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, OnItemClickListener { private static final int GLOW_PADDING = 15; private static final String TAG = "RecentAppsPanel"; private static final boolean DEBUG = TabletStatusBar.DEBUG; - private static final int DISPLAY_TASKS_PORTRAIT = 7; // Limited by max binder transaction size - private static final int DISPLAY_TASKS_LANDSCAPE = 5; // number of recent tasks to display - private static final int MAX_TASKS = DISPLAY_TASKS_PORTRAIT + 1; // allow extra for non-apps + private static final int DISPLAY_TASKS = 20; + private static final int MAX_TASKS = DISPLAY_TASKS + 1; // allow extra for non-apps private TabletStatusBar mBar; private ArrayList<ActivityDescription> mActivityDescriptions; private int mIconDpi; private View mRecentsScrim; private View mRecentsGlowView; - private LinearLayout mRecentsContainer; + private ListView mRecentsContainer; private Bitmap mGlowBitmap; private boolean mShowing; private Choreographer mChoreo; private View mRecentsDismissButton; + private ActvityDescriptionAdapter mListAdapter; + protected int mLastVisibleItem; static class ActivityDescription { int id; @@ -98,6 +102,63 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O } }; + /* package */ final static class ViewHolder { + private ImageView thumbnailView; + private ImageView iconView; + private TextView labelView; + private TextView descriptionView; + private ActivityDescription activityDescription; + } + + /* package */ final class ActvityDescriptionAdapter extends BaseAdapter { + private LayoutInflater mInflater; + + public ActvityDescriptionAdapter(Context context) { + mInflater = LayoutInflater.from(context); + } + + public int getCount() { + return mActivityDescriptions != null ? mActivityDescriptions.size() : 0; + } + + public Object getItem(int position) { + return position; // we only need the index + } + + public long getItemId(int position) { + return position; // we just need something unique for this position + } + + public View getView(int position, View convertView, ViewGroup parent) { + ViewHolder holder; + if (convertView == null) { + convertView = mInflater.inflate(R.layout.status_bar_recent_item, null); + holder = new ViewHolder(); + holder.thumbnailView = (ImageView) convertView.findViewById(R.id.app_thumbnail); + holder.iconView = (ImageView) convertView.findViewById(R.id.app_icon); + holder.labelView = (TextView) convertView.findViewById(R.id.app_label); + holder.descriptionView = (TextView) convertView.findViewById(R.id.app_description); + convertView.setTag(holder); + } else { + holder = (ViewHolder) convertView.getTag(); + } + + // activityId is reverse since most recent appears at the bottom... + final int activityId = mActivityDescriptions.size() - position - 1; + + final ActivityDescription activityDescription = mActivityDescriptions.get(activityId); + final Bitmap thumb = activityDescription.thumbnail; + holder.thumbnailView.setImageBitmap(compositeBitmap(mGlowBitmap, thumb)); + holder.iconView.setImageDrawable(activityDescription.icon); + holder.labelView.setText(activityDescription.label); + holder.descriptionView.setText(activityDescription.description); + holder.thumbnailView.setTag(activityDescription); + holder.activityDescription = activityDescription; + + return convertView; + } + } + public boolean isInContentArea(int x, int y) { // use mRecentsContainer's exact bounds to determine horizontal position final int l = mRecentsContainer.getLeft(); @@ -267,9 +328,41 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O } @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + // Keep track of the last visible item in the list so we can restore it + // to the bottom when the orientation changes. + int childCount = mRecentsContainer.getChildCount(); + if (childCount > 0) { + mLastVisibleItem = mRecentsContainer.getFirstVisiblePosition() + childCount - 1; + View view = mRecentsContainer.getChildAt(childCount - 1); + final int distanceFromBottom = mRecentsContainer.getHeight() - view.getTop(); + //final int distanceFromBottom = view.getHeight() + BOTTOM_OFFSET; + + // This has to happen post-layout, so run it "in the future" + post(new Runnable() { + public void run() { + mRecentsContainer.setSelectionFromTop(mLastVisibleItem, + mRecentsContainer.getHeight() - distanceFromBottom); + } + }); + } + } + + @Override protected void onFinishInflate() { super.onFinishInflate(); - mRecentsContainer = (LinearLayout) findViewById(R.id.recents_container); + LayoutInflater inflater = (LayoutInflater) + mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + + mRecentsContainer = (ListView) findViewById(R.id.recents_container); + View footer = inflater.inflate(R.layout.status_bar_recent_panel_footer, + mRecentsContainer, false); + mRecentsContainer.setScrollbarFadingEnabled(true); + mRecentsContainer.addFooterView(footer, null, false); + mRecentsContainer.setAdapter(mListAdapter = new ActvityDescriptionAdapter(mContext)); + mRecentsContainer.setOnItemClickListener(this); + mRecentsGlowView = findViewById(R.id.recents_glow); mRecentsScrim = (View) findViewById(R.id.recents_bg_protect); mChoreo = new Choreographer(this, mRecentsScrim, mRecentsGlowView); @@ -287,20 +380,16 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O } @Override - protected void onConfigurationChanged(Configuration newConfig) { - super.onConfigurationChanged(newConfig); - // we show more in portrait mode, so update UI if orientation changes - updateUiElements(newConfig, false); - } - - @Override protected void onVisibilityChanged(View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); if (DEBUG) Log.v(TAG, "onVisibilityChanged(" + changedView + ", " + visibility + ")"); if (visibility == View.VISIBLE && changedView == this) { refreshApplicationList(); - mRecentsContainer.setScrollbarFadingEnabled(true); - mRecentsContainer.scrollTo(0, 0); + post(new Runnable() { + public void run() { + mRecentsContainer.setSelection(mActivityDescriptions.size() - 1); + } + }); } } @@ -374,8 +463,9 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O if (title != null && title.length() > 0 && icon != null) { if (DEBUG) Log.v(TAG, "creating activity desc for id=" + id + ", label=" + title); ActivityDescription item = new ActivityDescription( - recentInfo.thumbnail, icon, title, - recentInfo.description, intent, id, index, info.packageName); + am.getTaskThumbnail(recentInfo.persistentId), + icon, title, recentInfo.description, intent, id, + index, info.packageName); activityDescriptions.add(item); ++index; } else { @@ -401,11 +491,12 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O private void refreshApplicationList() { mActivityDescriptions = getRecentTasks(); + mListAdapter.notifyDataSetInvalidated(); if (mActivityDescriptions.size() > 0) { - updateUiElements(getResources().getConfiguration(), true); + mLastVisibleItem = mActivityDescriptions.size() - 1; // scroll to bottom after reloading + updateUiElements(getResources().getConfiguration()); } else { // Immediately hide this panel - mShowing = false; hide(false); } } @@ -425,44 +516,29 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O canvas.drawBitmap(thumbnail, new Rect(0, 0, srcWidth-1, srcHeight-1), new RectF(GLOW_PADDING, - GLOW_PADDING - 4.0f, - outBitmap.getWidth() - GLOW_PADDING + 2.0f, - outBitmap.getHeight() - GLOW_PADDING + 3.0f), paint); + GLOW_PADDING - 7.0f, + outBitmap.getWidth() - GLOW_PADDING + 3.0f, + outBitmap.getHeight() - GLOW_PADDING + 7.0f), paint); } return outBitmap; } - private void updateUiElements(Configuration config, boolean animate) { - mRecentsContainer.removeAllViews(); - - final int first = 0; - final boolean isPortrait = config.orientation == Configuration.ORIENTATION_PORTRAIT; - final int taskCount = isPortrait ? DISPLAY_TASKS_PORTRAIT : DISPLAY_TASKS_LANDSCAPE; - final int last = Math.min(mActivityDescriptions.size(), taskCount) - 1; - for (int i = last; i >= first; i--) { - ActivityDescription activityDescription = mActivityDescriptions.get(i); - View view = View.inflate(mContext, R.layout.status_bar_recent_item, null); - ImageView appThumbnail = (ImageView) view.findViewById(R.id.app_thumbnail); - ImageView appIcon = (ImageView) view.findViewById(R.id.app_icon); - TextView appLabel = (TextView) view.findViewById(R.id.app_label); - TextView appDesc = (TextView) view.findViewById(R.id.app_description); - final Bitmap thumb = activityDescription.thumbnail; - appThumbnail.setImageBitmap(compositeBitmap(mGlowBitmap, thumb)); - appIcon.setImageDrawable(activityDescription.icon); - appLabel.setText(activityDescription.label); - appDesc.setText(activityDescription.description); - appThumbnail.setOnClickListener(this); - appThumbnail.setTag(activityDescription); - mRecentsContainer.addView(view); - } + private void updateUiElements(Configuration config) { + final int items = mActivityDescriptions.size(); + + mRecentsContainer.setVisibility(items > 0 ? View.VISIBLE : View.GONE); + mRecentsGlowView.setVisibility(items > 0 ? View.VISIBLE : View.GONE); + } - int views = mRecentsContainer.getChildCount(); - mRecentsContainer.setVisibility(views > 0 ? View.VISIBLE : View.GONE); - mRecentsGlowView.setVisibility(views > 0 ? View.VISIBLE : View.GONE); + private void hide(boolean animate) { + if (!animate) { + setVisibility(View.GONE); + } + mBar.animateCollapse(); } - public void onClick(View v) { - ActivityDescription ad = (ActivityDescription)v.getTag(); + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { + ActivityDescription ad = ((ViewHolder) view.getTag()).activityDescription; final ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE); if (ad.id >= 0) { @@ -477,11 +553,4 @@ public class RecentAppsPanel extends RelativeLayout implements StatusBarPanel, O } hide(true); } - - private void hide(boolean animate) { - setVisibility(View.GONE); - if (animate) { - mBar.animateCollapse(); - } - } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java index a67f915..ddb43b8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java @@ -16,26 +16,28 @@ package com.android.systemui.statusbar.tablet; +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; -import android.content.Context; -import android.util.Slog; -import android.view.View; -import android.util.AttributeSet; -import android.widget.ImageView; -import android.widget.TextView; -import android.view.DragEvent; -import android.view.MotionEvent; import android.content.ClipData; import android.content.ClipDescription; -import android.graphics.Paint; +import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.PixelFormat; import android.graphics.Point; +import android.util.AttributeSet; +import android.util.Slog; +import android.view.DragEvent; +import android.view.Gravity; +import android.view.MotionEvent; +import android.view.View; import android.view.WindowManager; -import android.widget.FrameLayout; import android.view.WindowManagerImpl; -import android.graphics.PixelFormat; -import android.view.Gravity; +import android.widget.FrameLayout; +import android.widget.ImageView; +import android.widget.TextView; import com.android.systemui.R; @@ -45,87 +47,149 @@ public class ShirtPocket extends ImageView { private ClipData mClipping = null; - private View mWindow = null; private ImageView mPreviewIcon; - private TextView mDescription; - private TextView mAltText; - public ShirtPocket(Context context, AttributeSet attrs) { - super(context, attrs); - } + public static class DropZone extends View { + ShirtPocket mPocket; + public DropZone(Context context, AttributeSet attrs) { + super(context, attrs); + } + public void setPocket(ShirtPocket p) { + mPocket = p; + } - // TODO: "pin area" panel, dragging things out - ObjectAnimator mAnimHide, mAnimShow; - - protected void onAttachedToWindow() { - // Drag API notes: we must be visible to receive drag events - setVisibility(View.VISIBLE); + public void onAttachedToWindow() { + super.onAttachedToWindow(); + if (mPocket.holding()) { + show(false); + } else { + hide(false); + } + } - refresh(); + // Drag API notes: we must be visible to receive drag events + private void show(boolean animate) { + setTranslationY(0f); + if (animate) { + setAlpha(0f); + ObjectAnimator.ofFloat(this, "alpha", 0f, 1f).start(); + } else { + setAlpha(1f); + } + } - setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - if (mClipping != null) { - if (mWindow.getVisibility() == View.VISIBLE) hideWindow(); - else showWindow(); + private void hide(boolean animate) { + AnimatorListenerAdapter onEnd = new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator _a) { + DropZone.this.setTranslationY(getHeight() + 2); + DropZone.this.setAlpha(0f); } + }; + if (animate) { + Animator a = ObjectAnimator.ofFloat(this, "alpha", getAlpha(), 0f); + a.addListener(onEnd); + a.start(); + } else { + onEnd.onAnimationEnd(null); } - }); - } + } - private void refresh() { - setClickable(mClipping != null); - // XXX: TODO - } - - private void showWindow() { - getHandler().post(new Runnable() { - public void run() { - mWindow.setVisibility(View.VISIBLE); - refresh(); + @Override + public boolean onDragEvent(DragEvent event) { + if (DEBUG) Slog.d(TAG, "onDragEvent: " + event); + switch (event.getAction()) { + // We want to appear whenever a potential drag takes off from anywhere in the UI. + case DragEvent.ACTION_DRAG_STARTED: + show(true); + break; + case DragEvent.ACTION_DRAG_ENTERED: + if (DEBUG) Slog.d(TAG, "entered!"); + // XXX: TODO + break; + case DragEvent.ACTION_DRAG_EXITED: + if (DEBUG) Slog.d(TAG, "exited!"); + break; + case DragEvent.ACTION_DROP: + if (DEBUG) Slog.d(TAG, "dropped!"); + mPocket.stash(event.getClipData()); + break; + case DragEvent.ACTION_DRAG_ENDED: + hide(true); + break; } - }); + return true; // we want everything, thank you + } } - private void hideWindow() { - getHandler().post(new Runnable() { - public void run() { - mWindow.setVisibility(View.GONE); - refresh(); - } - }); + public ShirtPocket(Context context, AttributeSet attrs) { + super(context, attrs); } + + // TODO: "pin area" panel, dragging things out + ObjectAnimator mAnimHide, mAnimShow; - private void hideWindowInJustASec() { - getHandler().postDelayed(new Runnable() { - public void run() { - mWindow.setVisibility(View.GONE); - refresh(); - } - }, - 250); + protected void onAttachedToWindow() { + } + + public boolean holding() { + return (mClipping != null); } private void stash(ClipData clipping) { mClipping = clipping; if (mClipping != null) { + setVisibility(View.VISIBLE); Bitmap icon = mClipping.getIcon(); - mDescription.setText(mClipping.getDescription().getLabel()); +// mDescription.setText(mClipping.getDescription().getLabel()); if (icon != null) { - mPreviewIcon.setImageBitmap(icon); - mPreviewIcon.setVisibility(View.VISIBLE); - mAltText.setVisibility(View.GONE); + setImageBitmap(icon); } else { - mPreviewIcon.setVisibility(View.GONE); - mAltText.setVisibility(View.VISIBLE); if (mClipping.getItemCount() > 0) { // TODO: figure out how to visualize every kind of ClipData! - mAltText.setText(mClipping.getItemAt(0).coerceToText(getContext())); + //mAltText.setText(mClipping.getItemAt(0).coerceToText(getContext())); } } + } else { + setVisibility(View.GONE); } } + @Override + public boolean onTouchEvent(MotionEvent ev) { + final int action = ev.getAction(); + if (action == MotionEvent.ACTION_DOWN) { + final ClipData clip = mClipping; + if (clip != null) { + final Bitmap icon = clip.getIcon(); + DragShadowBuilder shadow; + if (icon != null) { + shadow = new DragShadowBuilder(this) { + public void onProvideShadowMetrics(Point shadowSize, Point shadowTouchPoint) { + shadowSize.set(icon.getWidth(), icon.getHeight()); + shadowTouchPoint.set(shadowSize.x / 2, shadowSize.y / 2); + } + public void onDrawShadow(Canvas canvas) { + canvas.drawBitmap(icon, 0, 0, new Paint()); + } + }; + } else { + // uhhh, what now? + shadow = new DragShadowBuilder(this); + } + + startDrag(clip, shadow, null, 0); + + // TODO: only discard the clipping if it was accepted + stash(null); + + return true; + } + } + return false; + } + + /* private boolean isInViewContentArea(View v, int x, int y) { final int l = v.getPaddingLeft(); final int r = v.getWidth() - v.getPaddingRight(); @@ -167,38 +231,12 @@ public class ShirtPocket extends ImageView { // TODO: only discard the clipping if it was accepted stash(null); - hideWindowInJustASec(); // will refresh the icon - return true; } } return false; } }; - - public boolean onDragEvent(DragEvent event) { - if (DEBUG) Slog.d(TAG, "onDragEvent: " + event); - switch (event.getAction()) { - // We want to appear whenever a potential drag takes off from anywhere in the UI. - case DragEvent.ACTION_DRAG_STARTED: - // XXX: TODO - break; - case DragEvent.ACTION_DRAG_ENTERED: - if (DEBUG) Slog.d(TAG, "entered!"); - // XXX: TODO - break; - case DragEvent.ACTION_DRAG_EXITED: - if (DEBUG) Slog.d(TAG, "exited!"); - setVisibility(mClipping == null ? View.GONE : View.VISIBLE); - break; - case DragEvent.ACTION_DROP: - if (DEBUG) Slog.d(TAG, "dropped!"); - stash(event.getClipData()); - break; - case DragEvent.ACTION_DRAG_ENDED: - break; - } - return true; // we want everything, thank you - } + */ } 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 7a13fde..4557105 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -28,6 +28,7 @@ import android.app.Notification; import android.app.StatusBarManager; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.content.res.Configuration; import android.content.res.Resources; import android.inputmethodservice.InputMethodService; @@ -41,11 +42,13 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.text.TextUtils; import android.util.Slog; +import android.view.accessibility.AccessibilityEvent; import android.view.Gravity; import android.view.IWindowManager; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; +import android.view.SoundEffectConstants; import android.view.VelocityTracker; import android.view.View; import android.view.ViewConfiguration; @@ -67,6 +70,7 @@ import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BluetoothController; import com.android.systemui.statusbar.policy.LocationController; import com.android.systemui.statusbar.policy.NetworkController; +import com.android.systemui.statusbar.policy.Prefs; import com.android.systemui.recent.RecentApplicationsActivity; public class TabletStatusBar extends StatusBar implements @@ -91,7 +95,7 @@ public class TabletStatusBar extends StatusBar implements public static final int MSG_CLOSE_INPUT_METHODS_PANEL = 1041; public static final int MSG_STOP_TICKER = 2000; - // Fitts' Law assistance for LatinIME; TODO: replace with a more general approach + // Fitts' Law assistance for LatinIME; see policy.EventHole private static final boolean FAKE_SPACE_BAR = true; // The height of the bar, as definied by the build. It may be taller if we're plugged @@ -105,13 +109,16 @@ public class TabletStatusBar extends StatusBar implements IWindowManager mWindowManager; // tracking all current notifications - private NotificationData mNotns = new NotificationData(); + private NotificationData mNotificationData = new NotificationData(); TabletStatusBarView mStatusBarView; View mNotificationArea; View mNotificationTrigger; NotificationIconArea mNotificationIconArea; - View mNavigationArea; + ViewGroup mNavigationArea; + + boolean mNotificationDNDMode; + NotificationData.Entry mNotificationDNDDummyEntry; ImageView mBackButton; View mHomeButton; @@ -139,7 +146,8 @@ public class TabletStatusBar extends StatusBar implements LocationController mLocationController; NetworkController mNetworkController; - View mBarContents; + ViewGroup mBarContents; + LayoutTransition mBarContentsLayoutTransition; // hide system chrome ("lights out") support View mShadow; @@ -154,7 +162,6 @@ public class TabletStatusBar extends StatusBar implements // for disabling the status bar int mDisabled = 0; - boolean mNotificationsOn = true; private RecentAppsPanel mRecentsPanel; private InputMethodsPanel mInputMethodsPanel; @@ -263,6 +270,8 @@ public class TabletStatusBar extends StatusBar implements lp.gravity = Gravity.BOTTOM | Gravity.LEFT; lp.setTitle("RecentsPanel"); lp.windowAnimations = R.style.Animation_RecentPanel; + lp.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED + | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING; WindowManagerImpl.getDefault().addView(mRecentsPanel, lp); mRecentsPanel.setBar(this); @@ -338,14 +347,27 @@ public class TabletStatusBar extends StatusBar implements sb.setHandler(mHandler); - mBarContents = sb.findViewById(R.id.bar_contents); + mBarContents = (ViewGroup) sb.findViewById(R.id.bar_contents); + // layout transitions for the status bar's contents + mBarContentsLayoutTransition = new LayoutTransition(); + // add/removal will fade as normal + mBarContentsLayoutTransition.setAnimator(LayoutTransition.APPEARING, + ObjectAnimator.ofFloat(null, "alpha", 0f, 1f)); + mBarContentsLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, + ObjectAnimator.ofFloat(null, "alpha", 1f, 0f)); + // no animations for siblings on change: just jump into place please + mBarContentsLayoutTransition.setAnimator(LayoutTransition.CHANGE_APPEARING, null); + mBarContentsLayoutTransition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, null); + // quick like bunny + mBarContentsLayoutTransition.setDuration(250 * (DEBUG?10:1)); + mBarContents.setLayoutTransition(mBarContentsLayoutTransition); // the whole right-hand side of the bar mNotificationArea = sb.findViewById(R.id.notificationArea); // the button to open the notification area mNotificationTrigger = sb.findViewById(R.id.notificationTrigger); - mNotificationTrigger.setOnClickListener(mOnClickListener); + mNotificationTrigger.setOnTouchListener(new NotificationTriggerTouchListener()); // the more notifications icon mNotificationIconArea = (NotificationIconArea)sb.findViewById(R.id.notificationIcons); @@ -377,11 +399,12 @@ public class TabletStatusBar extends StatusBar implements // The navigation buttons mBackButton = (ImageView)sb.findViewById(R.id.back); - mNavigationArea = sb.findViewById(R.id.navigationArea); + mNavigationArea = (ViewGroup) sb.findViewById(R.id.navigationArea); mHomeButton = mNavigationArea.findViewById(R.id.home); mMenuButton = mNavigationArea.findViewById(R.id.menu); mRecentButton = mNavigationArea.findViewById(R.id.recent_apps); mRecentButton.setOnClickListener(mOnClickListener); + mNavigationArea.setLayoutTransition(mBarContentsLayoutTransition); // The bar contents buttons mNotificationAndImeArea = (ViewGroup)sb.findViewById(R.id.notificationAndImeArea); @@ -489,25 +512,43 @@ public class TabletStatusBar extends StatusBar implements switch (m.what) { case MSG_OPEN_NOTIFICATION_PEEK: if (DEBUG) Slog.d(TAG, "opening notification peek window; arg=" + m.arg1); + if (m.arg1 >= 0) { - final int N = mNotns.size(); - if (mNotificationPeekIndex >= 0 && mNotificationPeekIndex < N) { - NotificationData.Entry entry = mNotns.get(N-1-mNotificationPeekIndex); - entry.icon.setBackgroundColor(0); - mNotificationPeekIndex = -1; - mNotificationPeekKey = null; + final int N = mNotificationData.size(); + + if (!mNotificationDNDMode) { + if (mNotificationPeekIndex >= 0 && mNotificationPeekIndex < N) { + NotificationData.Entry entry = mNotificationData.get(N-1-mNotificationPeekIndex); + entry.icon.setBackgroundColor(0); + mNotificationPeekIndex = -1; + mNotificationPeekKey = null; + } } final int peekIndex = m.arg1; if (peekIndex < N) { //Slog.d(TAG, "loading peek: " + peekIndex); - NotificationData.Entry entry = mNotns.get(N-1-peekIndex); + NotificationData.Entry entry = + mNotificationDNDMode + ? mNotificationDNDDummyEntry + : mNotificationData.get(N-1-peekIndex); NotificationData.Entry copy = new NotificationData.Entry( entry.key, entry.notification, entry.icon); inflateViews(copy, mNotificationPeekRow); + if (mNotificationDNDMode) { + copy.content.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + SharedPreferences.Editor editor = Prefs.edit(mContext); + editor.putBoolean(Prefs.DO_NOT_DISTURB_PREF, false); + editor.apply(); + animateCollapse(); + } + }); + } + entry.icon.setBackgroundColor(0x20FFFFFF); // mNotificationPeekRow.setLayoutTransition( @@ -530,9 +571,13 @@ public class TabletStatusBar extends StatusBar implements if (DEBUG) Slog.d(TAG, "closing notification peek window"); mNotificationPeekWindow.setVisibility(View.GONE); mNotificationPeekRow.removeAllViews(); - final int N = mNotns.size(); + + final int N = mNotificationData.size(); if (mNotificationPeekIndex >= 0 && mNotificationPeekIndex < N) { - NotificationData.Entry entry = mNotns.get(N-1-mNotificationPeekIndex); + NotificationData.Entry entry = + mNotificationDNDMode + ? mNotificationDNDDummyEntry + : mNotificationData.get(N-1-mNotificationPeekIndex); entry.icon.setBackgroundColor(0); } @@ -544,7 +589,7 @@ public class TabletStatusBar extends StatusBar implements if (!mNotificationPanel.isShowing()) { mNotificationPeekWindow.setVisibility(View.GONE); mNotificationPanel.show(true, true); - mNotificationArea.setVisibility(View.GONE); + mNotificationArea.setVisibility(View.INVISIBLE); mTicker.halt(); } break; @@ -558,6 +603,7 @@ public class TabletStatusBar extends StatusBar implements case MSG_OPEN_RECENTS_PANEL: if (DEBUG) Slog.d(TAG, "opening recents panel"); if (mRecentsPanel != null) { + disable(StatusBarManager.DISABLE_BACK); mRecentsPanel.setVisibility(View.VISIBLE); mRecentsPanel.show(true, true); } @@ -565,6 +611,7 @@ public class TabletStatusBar extends StatusBar implements case MSG_CLOSE_RECENTS_PANEL: if (DEBUG) Slog.d(TAG, "closing recents panel"); if (mRecentsPanel != null && mRecentsPanel.isShowing()) { + disable(StatusBarManager.DISABLE_NONE); mRecentsPanel.show(false, true); } break; @@ -641,9 +688,9 @@ public class TabletStatusBar extends StatusBar implements } public void updateNotification(IBinder key, StatusBarNotification notification) { - if (DEBUG) Slog.d(TAG, "updateNotification(" + key + " -> " + notification + ") // TODO"); + if (DEBUG) Slog.d(TAG, "updateNotification(" + key + " -> " + notification + ")"); - final NotificationData.Entry oldEntry = mNotns.findByKey(key); + final NotificationData.Entry oldEntry = mNotificationData.findByKey(key); if (oldEntry == null) { Slog.w(TAG, "updateNotification for unknown key: " + key); return; @@ -658,7 +705,8 @@ public class TabletStatusBar extends StatusBar implements Slog.d(TAG, "old notification: when=" + oldNotification.notification.when + " ongoing=" + oldNotification.isOngoing() + " expanded=" + oldEntry.expanded - + " contentView=" + oldContentView); + + " contentView=" + oldContentView + + " rowParent=" + oldEntry.row.getParent()); Slog.d(TAG, "new notification: when=" + notification.notification.when + " ongoing=" + oldNotification.isOngoing() + " contentView=" + contentView); @@ -674,7 +722,7 @@ public class TabletStatusBar extends StatusBar implements && oldContentView.getLayoutId() == contentView.getLayoutId(); ViewGroup rowParent = (ViewGroup) oldEntry.row.getParent(); boolean orderUnchanged = notification.notification.when==oldNotification.notification.when - && notification.priority == oldNotification.priority; + && notification.priority == oldNotification.priority; // priority now encompasses isOngoing() boolean isLastAnyway = rowParent.indexOfChild(oldEntry.row) == rowParent.getChildCount()-1; if (contentsUnchanged && (orderUnchanged || isLastAnyway)) { @@ -739,7 +787,7 @@ public class TabletStatusBar extends StatusBar implements } public void removeNotification(IBinder key) { - if (DEBUG) Slog.d(TAG, "removeNotification(" + key + ") // TODO"); + if (DEBUG) Slog.d(TAG, "removeNotification(" + key + ")"); removeNotificationViews(key); mTicker.remove(key); setAreThereNotifications(); @@ -779,16 +827,18 @@ public class TabletStatusBar extends StatusBar implements } } if ((diff & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) { + mNotificationDNDMode = Prefs.read(mContext) + .getBoolean(Prefs.DO_NOT_DISTURB_PREF, Prefs.DO_NOT_DISTURB_DEFAULT); + if ((state & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) { - Slog.i(TAG, "DISABLE_NOTIFICATION_ICONS: yes"); - // synchronize with current shadow state - mNotificationIconArea.setVisibility(View.GONE); + Slog.i(TAG, "DISABLE_NOTIFICATION_ICONS: yes" + (mNotificationDNDMode?" (DND)":"")); mTicker.halt(); } else { - Slog.i(TAG, "DISABLE_NOTIFICATION_ICONS: no"); - // synchronize with current shadow state - mNotificationIconArea.setVisibility(View.VISIBLE); + Slog.i(TAG, "DISABLE_NOTIFICATION_ICONS: no" + (mNotificationDNDMode?" (DND)":"")); } + + // refresh icons to show either notifications or the DND message + reloadAllNotificationIcons(); } else if ((diff & StatusBarManager.DISABLE_NOTIFICATION_TICKER) != 0) { if ((state & StatusBarManager.DISABLE_NOTIFICATION_TICKER) != 0) { mTicker.halt(); @@ -797,7 +847,7 @@ public class TabletStatusBar extends StatusBar implements if ((diff & StatusBarManager.DISABLE_NAVIGATION) != 0) { if ((state & StatusBarManager.DISABLE_NAVIGATION) != 0) { Slog.i(TAG, "DISABLE_NAVIGATION: yes"); - mNavigationArea.setVisibility(View.GONE); + mNavigationArea.setVisibility(View.INVISIBLE); mInputMethodSwitchButton.setScreenLocked(true); } else { Slog.i(TAG, "DISABLE_NAVIGATION: no"); @@ -852,6 +902,9 @@ public class TabletStatusBar extends StatusBar implements } public void animateExpand() { + mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PEEK); + mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); + mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PANEL); mHandler.sendEmptyMessage(MSG_OPEN_NOTIFICATION_PANEL); } @@ -863,6 +916,8 @@ public class TabletStatusBar extends StatusBar implements mHandler.sendEmptyMessage(MSG_CLOSE_RECENTS_PANEL); mHandler.removeMessages(MSG_CLOSE_INPUT_METHODS_PANEL); mHandler.sendEmptyMessage(MSG_CLOSE_INPUT_METHODS_PANEL); + mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PEEK); + mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); } // called by StatusBar @@ -947,7 +1002,7 @@ public class TabletStatusBar extends StatusBar implements } private void setAreThereNotifications() { - final boolean hasClearable = mNotns.hasClearableItems(); + final boolean hasClearable = mNotificationData.hasClearableItems(); } /** @@ -985,16 +1040,11 @@ public class TabletStatusBar extends StatusBar implements public void onClickNotificationTrigger() { if (DEBUG) Slog.d(TAG, "clicked notification icons; disabled=" + mDisabled); if ((mDisabled & StatusBarManager.DISABLE_EXPAND) == 0) { - if (!mNotificationsOn) { - mNotificationsOn = true; - mIconLayout.setVisibility(View.VISIBLE); // TODO: animation - } else { - int msg = !mNotificationPanel.isShowing() - ? MSG_OPEN_NOTIFICATION_PANEL - : MSG_CLOSE_NOTIFICATION_PANEL; - mHandler.removeMessages(msg); - mHandler.sendEmptyMessage(msg); - } + int msg = !mNotificationPanel.isShowing() + ? MSG_OPEN_NOTIFICATION_PANEL + : MSG_CLOSE_NOTIFICATION_PANEL; + mHandler.removeMessages(msg); + mHandler.sendEmptyMessage(msg); } } @@ -1081,7 +1131,7 @@ public class TabletStatusBar extends StatusBar implements } StatusBarNotification removeNotificationViews(IBinder key) { - NotificationData.Entry entry = mNotns.remove(key); + NotificationData.Entry entry = mNotificationData.remove(key); if (entry == null) { Slog.w(TAG, "removeNotification for unknown key: " + key); return null; @@ -1102,10 +1152,76 @@ public class TabletStatusBar extends StatusBar implements return entry.notification; } + private class NotificationTriggerTouchListener implements View.OnTouchListener { + VelocityTracker mVT; + float mInitialTouchX, mInitialTouchY; + int mTouchSlop; + + public NotificationTriggerTouchListener() { + mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); + } + + public boolean onTouch(View v, MotionEvent event) { +// Slog.d(TAG, String.format("touch: (%.1f, %.1f) initial: (%.1f, %.1f)", +// event.getX(), +// event.getY(), +// mInitialTouchX, +// mInitialTouchY)); + final int action = event.getAction(); + switch (action) { + case MotionEvent.ACTION_DOWN: + mVT = VelocityTracker.obtain(); + mInitialTouchX = event.getX(); + mInitialTouchY = event.getY(); + // fall through + case MotionEvent.ACTION_OUTSIDE: + case MotionEvent.ACTION_MOVE: + // check for fling + if (mVT != null) { + mVT.addMovement(event); + mVT.computeCurrentVelocity(1000); // pixels per second + // require a little more oomph once we're already in peekaboo mode + if (mVT.getYVelocity() < -mNotificationFlingVelocity) { + animateExpand(); + mVT.recycle(); + mVT = null; + } + } + return true; + case MotionEvent.ACTION_UP: + case MotionEvent.ACTION_CANCEL: + if (mVT != null) { + if (action == MotionEvent.ACTION_UP + // was this a sloppy tap? + && Math.abs(event.getX() - mInitialTouchX) < mTouchSlop + && Math.abs(event.getY() - mInitialTouchY) < (mTouchSlop / 3) + // dragging off the bottom doesn't count + && (int)event.getY() < v.getBottom()) { + animateExpand(); + v.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); + v.playSoundEffect(SoundEffectConstants.CLICK); + } + + mVT.recycle(); + mVT = null; + return true; + } + } + return false; + } + } + private class NotificationIconTouchListener implements View.OnTouchListener { + final static int NOTIFICATION_PEEK_HOLD_THRESH = 200; // ms + final static int NOTIFICATION_PEEK_FADE_DELAY = 5000; // ms + VelocityTracker mVT; + int mPeekIndex; + float mInitialTouchX, mInitialTouchY; + int mTouchSlop; public NotificationIconTouchListener() { + mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); } public boolean onTouch(View v, MotionEvent event) { @@ -1113,34 +1229,46 @@ public class TabletStatusBar extends StatusBar implements boolean panelShowing = mNotificationPanel.isShowing(); if (panelShowing) return false; - switch (event.getAction()) { + int numIcons = mIconLayout.getChildCount(); + int newPeekIndex = (int)(event.getX() * numIcons / mIconLayout.getWidth()); + if (newPeekIndex > numIcons - 1) newPeekIndex = numIcons - 1; + else if (newPeekIndex < 0) newPeekIndex = 0; + + final int action = event.getAction(); + switch (action) { case MotionEvent.ACTION_DOWN: mVT = VelocityTracker.obtain(); + mInitialTouchX = event.getX(); + mInitialTouchY = event.getY(); + mPeekIndex = -1; // fall through case MotionEvent.ACTION_OUTSIDE: case MotionEvent.ACTION_MOVE: // peek and switch icons if necessary - int numIcons = mIconLayout.getChildCount(); - int peekIndex = (int)((float)event.getX() * numIcons / mIconLayout.getWidth()); - if (peekIndex > numIcons - 1) peekIndex = numIcons - 1; - else if (peekIndex < 0) peekIndex = 0; - if (!peeking || mNotificationPeekIndex != peekIndex) { - if (DEBUG) Slog.d(TAG, "will peek at notification #" + peekIndex); + if (newPeekIndex != mPeekIndex) { + mPeekIndex = newPeekIndex; + + if (DEBUG) Slog.d(TAG, "will peek at notification #" + mPeekIndex); Message peekMsg = mHandler.obtainMessage(MSG_OPEN_NOTIFICATION_PEEK); - peekMsg.arg1 = peekIndex; + peekMsg.arg1 = mPeekIndex; mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); - // no delay if we're scrubbing left-right - mHandler.sendMessage(peekMsg); + if (peeking) { + // no delay if we're scrubbing left-right + mHandler.sendMessage(peekMsg); + } else { + // wait for fling + mHandler.sendMessageDelayed(peekMsg, NOTIFICATION_PEEK_HOLD_THRESH); + } } // check for fling if (mVT != null) { mVT.addMovement(event); - mVT.computeCurrentVelocity(1000); + mVT.computeCurrentVelocity(1000); // pixels per second // require a little more oomph once we're already in peekaboo mode if (!panelShowing && ( (peeking && mVT.getYVelocity() < -mNotificationFlingVelocity*3) @@ -1155,9 +1283,30 @@ public class TabletStatusBar extends StatusBar implements case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); + if (!peeking) { + if (action == MotionEvent.ACTION_UP + // was this a sloppy tap? + && Math.abs(event.getX() - mInitialTouchX) < mTouchSlop + && Math.abs(event.getY() - mInitialTouchY) < (mTouchSlop / 3) + // dragging off the bottom doesn't count + && (int)event.getY() < v.getBottom()) { + Message peekMsg = mHandler.obtainMessage(MSG_OPEN_NOTIFICATION_PEEK); + peekMsg.arg1 = mPeekIndex; + mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); + mHandler.sendMessage(peekMsg); + + v.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); + v.playSoundEffect(SoundEffectConstants.CLICK); + + peeking = true; // not technically true yet, but the next line will run + } + } + if (peeking) { - mHandler.sendEmptyMessageDelayed(MSG_CLOSE_NOTIFICATION_PEEK, 5000); + mHandler.sendEmptyMessageDelayed(MSG_CLOSE_NOTIFICATION_PEEK, + NOTIFICATION_PEEK_FADE_DELAY); } + mVT.recycle(); mVT = null; return true; @@ -1192,7 +1341,7 @@ public class TabletStatusBar extends StatusBar implements } // Add the icon. - int pos = mNotns.add(entry); + int pos = mNotificationData.add(entry); if (DEBUG) { Slog.d(TAG, "addNotificationViews: added at " + pos); } @@ -1213,10 +1362,39 @@ public class TabletStatusBar extends StatusBar implements if (mIconLayout == null) return; + // first, populate the main notification panel + loadNotificationPanel(); + final LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(mIconSize + 2*mIconHPadding, mNaturalBarHeight); - int N = mNotns.size(); + // alternate behavior in DND mode + if (mNotificationDNDMode) { + if (mIconLayout.getChildCount() == 0) { + final StatusBarIconView iconView = new StatusBarIconView(mContext, "_dnd"); + iconView.setImageResource(R.drawable.ic_notification_dnd); + iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); + iconView.setPadding(mIconHPadding, 0, mIconHPadding, 0); + + final Notification dndNotification = new Notification.Builder(mContext) + .setContentTitle(mContext.getText(R.string.notifications_off_title)) + .setContentText(mContext.getText(R.string.notifications_off_text)) + .setSmallIcon(R.drawable.ic_notification_dnd) + .setOngoing(true) + .getNotification(); + + mNotificationDNDDummyEntry = new NotificationData.Entry( + null, + new StatusBarNotification("", 0, "", 0, 0, dndNotification), + iconView); + + mIconLayout.addView(iconView, params); + } + + return; + } + + int N = mNotificationData.size(); if (DEBUG) { Slog.d(TAG, "refreshing icons: " + N + " notifications, mIconLayout=" + mIconLayout); @@ -1231,7 +1409,7 @@ public class TabletStatusBar extends StatusBar implements MAX_NOTIFICATION_ICONS_IME_BUTTON_VISIBLE : MAX_NOTIFICATION_ICONS; for (int i=0; i< maxNotificationIconsCount; i++) { if (i>=N) break; - toShow.add(mNotns.get(N-i-1).icon); + toShow.add(mNotificationData.get(N-i-1).icon); } ArrayList<View> toRemove = new ArrayList<View>(); @@ -1253,17 +1431,15 @@ public class TabletStatusBar extends StatusBar implements mIconLayout.addView(v, i, params); } } - - loadNotificationPanel(); } private void loadNotificationPanel() { - int N = mNotns.size(); + int N = mNotificationData.size(); ArrayList<View> toShow = new ArrayList<View>(); for (int i=0; i<N; i++) { - View row = mNotns.get(N-i-1).row; + View row = mNotificationData.get(N-i-1).row; toShow.add(row); } @@ -1378,155 +1554,6 @@ public class TabletStatusBar extends StatusBar implements return true; } -/* - public class ShadowController { - boolean mShowShadows; - Map<View, View> mShadowsForElements = new IdentityHashMap<View, View>(7); - Map<View, View> mElementsForShadows = new IdentityHashMap<View, View>(7); - LayoutTransition mElementTransition, mShadowTransition; - - View mTouchTarget; - - ShadowController(boolean showShadows) { - mShowShadows = showShadows; - mTouchTarget = null; - - mElementTransition = new LayoutTransition(); -// AnimatorSet s = new AnimatorSet(); -// s.play(ObjectAnimator.ofInt(null, "top", 48, 0)) -// .with(ObjectAnimator.ofFloat(null, "scaleY", 0.5f, 1f)) -// .with(ObjectAnimator.ofFloat(null, "alpha", 0.5f, 1f)) -// ; - mElementTransition.setAnimator(LayoutTransition.APPEARING, //s); - ObjectAnimator.ofInt(null, "top", 48, 0)); - mElementTransition.setDuration(LayoutTransition.APPEARING, 100); - mElementTransition.setStartDelay(LayoutTransition.APPEARING, 0); - -// s = new AnimatorSet(); -// s.play(ObjectAnimator.ofInt(null, "top", 0, 48)) -// .with(ObjectAnimator.ofFloat(null, "scaleY", 1f, 0.5f)) -// .with(ObjectAnimator.ofFloat(null, "alpha", 1f, 0.5f)) -// ; - mElementTransition.setAnimator(LayoutTransition.DISAPPEARING, //s); - ObjectAnimator.ofInt(null, "top", 0, 48)); - mElementTransition.setDuration(LayoutTransition.DISAPPEARING, 400); - - mShadowTransition = new LayoutTransition(); - mShadowTransition.setAnimator(LayoutTransition.APPEARING, - ObjectAnimator.ofFloat(null, "alpha", 0f, 1f)); - mShadowTransition.setDuration(LayoutTransition.APPEARING, 200); - mShadowTransition.setStartDelay(LayoutTransition.APPEARING, 100); - mShadowTransition.setAnimator(LayoutTransition.DISAPPEARING, - ObjectAnimator.ofFloat(null, "alpha", 1f, 0f)); - mShadowTransition.setDuration(LayoutTransition.DISAPPEARING, 100); - - ViewGroup bar = (ViewGroup) TabletStatusBar.this.mBarContents; - bar.setLayoutTransition(mElementTransition); - ViewGroup nav = (ViewGroup) TabletStatusBar.this.mNavigationArea; - nav.setLayoutTransition(mElementTransition); - ViewGroup shadowGroup = (ViewGroup) bar.findViewById(R.id.shadows); - shadowGroup.setLayoutTransition(mShadowTransition); - } - - public void add(View element, View shadow) { - shadow.setOnTouchListener(makeTouchListener()); - mShadowsForElements.put(element, shadow); - mElementsForShadows.put(shadow, element); - } - - public boolean getShadowState() { - return mShowShadows; - } - - public View.OnTouchListener makeTouchListener() { - return new View.OnTouchListener() { - public boolean onTouch(View v, MotionEvent ev) { - final int action = ev.getAction(); - - if (DEBUG) Slog.d(TAG, "ShadowController: v=" + v + ", ev=" + ev); - - // currently redirecting events? - if (mTouchTarget == null) { - mTouchTarget = mElementsForShadows.get(v); - } - - if (mTouchTarget != null && mTouchTarget.getVisibility() != View.GONE) { - boolean last = false; - switch (action) { - case MotionEvent.ACTION_CANCEL: - case MotionEvent.ACTION_UP: - mHandler.removeMessages(MSG_RESTORE_SHADOWS); - if (mShowShadows) { - mHandler.sendEmptyMessageDelayed(MSG_RESTORE_SHADOWS, - v == mNotificationShadow ? 5000 : 500); - } - last = true; - break; - case MotionEvent.ACTION_DOWN: - mHandler.removeMessages(MSG_RESTORE_SHADOWS); - setElementShadow(mTouchTarget, false); - break; - } - mTouchTarget.dispatchTouchEvent(ev); - if (last) mTouchTarget = null; - return true; - } - - return false; - } - }; - } - - public void refresh() { - for (View element : mShadowsForElements.keySet()) { - setElementShadow(element, mShowShadows); - } - } - - public void showAllShadows() { - mShowShadows = true; - refresh(); - } - - public void hideAllShadows() { - mShowShadows = false; - refresh(); - } - - // Use View.INVISIBLE for things hidden due to shadowing, and View.GONE for things that are - // disabled (and should not be shadowed or re-shown) - public void setElementShadow(View button, boolean shade) { - View shadow = mShadowsForElements.get(button); - if (shadow != null) { - if (button.getVisibility() != View.GONE) { - shadow.setVisibility(shade ? View.VISIBLE : View.INVISIBLE); - button.setVisibility(shade ? View.INVISIBLE : View.VISIBLE); - } - } - } - - // Hide both element and shadow, using default layout animations. - public void hideElement(View button) { - Slog.d(TAG, "hiding: " + button); - View shadow = mShadowsForElements.get(button); - if (shadow != null) { - shadow.setVisibility(View.GONE); - } - button.setVisibility(View.GONE); - } - - // Honoring the current shadow state. - public void showElement(View button) { - Slog.d(TAG, "showing: " + button); - View shadow = mShadowsForElements.get(button); - if (shadow != null) { - shadow.setVisibility(mShowShadows ? View.VISIBLE : View.INVISIBLE); - } - button.setVisibility(mShowShadows ? View.INVISIBLE : View.VISIBLE); - } - } - */ - public class TouchOutsideListener implements View.OnTouchListener { private int mMsg; private StatusBarPanel mPanel; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java index a072aed..a8f4262 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java @@ -158,7 +158,9 @@ public class TabletTicker private void advance() { // Out with the old... if (mCurrentView != null) { - mWindow.removeView(mCurrentView); + if (mWindow != null) { + mWindow.removeView(mCurrentView); + } mCurrentView = null; mCurrentKey = null; mCurrentNotification = null; diff --git a/packages/SystemUI/src/com/android/systemui/usb/UsbStorageActivity.java b/packages/SystemUI/src/com/android/systemui/usb/UsbStorageActivity.java index 1368baa..43dfb96 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/UsbStorageActivity.java +++ b/packages/SystemUI/src/com/android/systemui/usb/UsbStorageActivity.java @@ -30,7 +30,7 @@ import android.content.DialogInterface.OnCancelListener; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; -import android.hardware.UsbManager; +import android.hardware.usb.UsbManager; import android.os.Bundle; import android.os.Environment; import android.os.Handler; |