diff options
Diffstat (limited to 'packages')
19 files changed, 256 insertions, 123 deletions
diff --git a/packages/SystemUI/res/values-bn-rBD/strings.xml b/packages/SystemUI/res/values-bn-rBD/strings.xml index 908fb4c..049552c 100644 --- a/packages/SystemUI/res/values-bn-rBD/strings.xml +++ b/packages/SystemUI/res/values-bn-rBD/strings.xml @@ -231,7 +231,7 @@ <string name="quick_settings_airplane_mode_label" msgid="5510520633448831350">"বিমান মোড"</string> <string name="quick_settings_dnd_label" msgid="8735855737575028208">"বিরক্ত করবেন না"</string> <string name="quick_settings_dnd_priority_label" msgid="483232950670692036">"শুধুমাত্র অগ্রাধিকার"</string> - <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"কোন বাধা নয়"</string> + <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"কোনো বাধা নয়"</string> <string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"Bluetooth"</string> <string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"Bluetooth (<xliff:g id="NUMBER">%d</xliff:g> টি ডিভাইস)"</string> <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Bluetooth বন্ধ"</string> diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml index dc50de5..fde6fd2 100644 --- a/packages/SystemUI/res/values-hi/strings.xml +++ b/packages/SystemUI/res/values-hi/strings.xml @@ -231,7 +231,7 @@ <string name="quick_settings_airplane_mode_label" msgid="5510520633448831350">"हवाई जहाज़ मोड"</string> <string name="quick_settings_dnd_label" msgid="8735855737575028208">"परेशान ना करें"</string> <string name="quick_settings_dnd_priority_label" msgid="483232950670692036">"केवल प्राथमिकता"</string> - <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"कोई बाधा नहीं"</string> + <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"कोई मेसज और कॉल को नहीं रोका गया"</string> <string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"ब्लूटूथ"</string> <string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"ब्लूटूथ (<xliff:g id="NUMBER">%d</xliff:g> डिवाइस)"</string> <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"ब्लूटूथ बंद"</string> diff --git a/packages/SystemUI/res/values-km-rKH/strings.xml b/packages/SystemUI/res/values-km-rKH/strings.xml index d58ef52..c995637 100644 --- a/packages/SystemUI/res/values-km-rKH/strings.xml +++ b/packages/SystemUI/res/values-km-rKH/strings.xml @@ -176,16 +176,11 @@ <string name="accessibility_quick_settings_airplane_on" msgid="6406141469157599296">"បើករបៀបជិះយន្តហោះ។"</string> <string name="accessibility_quick_settings_airplane_changed_off" msgid="66846307818850664">"បានបិទរបៀបជិះយន្តហោះ។"</string> <string name="accessibility_quick_settings_airplane_changed_on" msgid="8983005603505087728">"បានបើករបៀបជិះយន្តហោះ។"</string> - <!-- no translation found for accessibility_quick_settings_dnd_priority_on (1448402297221249355) --> - <skip /> - <!-- no translation found for accessibility_quick_settings_dnd_none_on (5910777408232088752) --> - <skip /> - <!-- no translation found for accessibility_quick_settings_dnd_off (2371832603753738581) --> - <skip /> - <!-- no translation found for accessibility_quick_settings_dnd_changed_off (898107593453022935) --> - <skip /> - <!-- no translation found for accessibility_quick_settings_dnd_changed_on (4483780856613561039) --> - <skip /> + <string name="accessibility_quick_settings_dnd_priority_on" msgid="1448402297221249355">"បានបើកមុខងារកុំរំខាន (អាទិភាពប៉ុណ្ណោះ)។"</string> + <string name="accessibility_quick_settings_dnd_none_on" msgid="5910777408232088752">"បានបើកមុខងារកុំរំខាន សូមកុំរំខាន"</string> + <string name="accessibility_quick_settings_dnd_off" msgid="2371832603753738581">"បានបិទមុខងារកុំរំខាន។"</string> + <string name="accessibility_quick_settings_dnd_changed_off" msgid="898107593453022935">"បានបិទមុខងារកុំរំខាន។"</string> + <string name="accessibility_quick_settings_dnd_changed_on" msgid="4483780856613561039">"បានបើកមុខងារកុំរំខាន។"</string> <string name="accessibility_quick_settings_bluetooth_off" msgid="2133631372372064339">"បិទប៊្លូធូស។"</string> <string name="accessibility_quick_settings_bluetooth_on" msgid="7681999166216621838">"បើកប៊្លូធូស។"</string> <string name="accessibility_quick_settings_bluetooth_connecting" msgid="6953242966685343855">"ការភ្ជាប់ប៊្លូធូស។"</string> @@ -234,12 +229,9 @@ <string name="start_dreams" msgid="7219575858348719790">"ធាតុរក្សាអេក្រង់"</string> <string name="ethernet_label" msgid="7967563676324087464">"អ៊ីសឺរណិត"</string> <string name="quick_settings_airplane_mode_label" msgid="5510520633448831350">"របៀបពេលជិះយន្តហោះ"</string> - <!-- no translation found for quick_settings_dnd_label (8735855737575028208) --> - <skip /> - <!-- no translation found for quick_settings_dnd_priority_label (483232950670692036) --> - <skip /> - <!-- no translation found for quick_settings_dnd_none_label (7309935569360609114) --> - <skip /> + <string name="quick_settings_dnd_label" msgid="8735855737575028208">"កុំរំខាន"</string> + <string name="quick_settings_dnd_priority_label" msgid="483232950670692036">"អាទិភាពប៉ុណ្ណោះ"</string> + <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"សូមកុំរំខាន"</string> <string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"ប៊្លូធូស"</string> <string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"ប៊្លូធូស (ឧបករណ៍ <xliff:g id="NUMBER">%d</xliff:g>)"</string> <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"ប៊្លូធូសបានបិទ"</string> diff --git a/packages/SystemUI/res/values-ne-rNP/strings.xml b/packages/SystemUI/res/values-ne-rNP/strings.xml index a1854ad..a6869a5 100644 --- a/packages/SystemUI/res/values-ne-rNP/strings.xml +++ b/packages/SystemUI/res/values-ne-rNP/strings.xml @@ -176,11 +176,11 @@ <string name="accessibility_quick_settings_airplane_on" msgid="6406141469157599296">"हवाइजहाज मोड खुला।"</string> <string name="accessibility_quick_settings_airplane_changed_off" msgid="66846307818850664">"हवाइजहाज मोड बन्द छ।"</string> <string name="accessibility_quick_settings_airplane_changed_on" msgid="8983005603505087728">"हवाइजहाज मोड खोलियो।"</string> - <string name="accessibility_quick_settings_dnd_priority_on" msgid="1448402297221249355">"प्राथमिकता मात्र मा बाधा नपुर्याउनुहोस्।"</string> - <string name="accessibility_quick_settings_dnd_none_on" msgid="5910777408232088752">"कुनै रुकावटहरूमा बाधा नगर्नुहोस्।"</string> - <string name="accessibility_quick_settings_dnd_off" msgid="2371832603753738581">"बन्दलाई बाधा नपुर्याउनुहोस्"</string> - <string name="accessibility_quick_settings_dnd_changed_off" msgid="898107593453022935">"बन्द गर्नेलाई अवरोध नपुर्याउनुहोस्।"</string> - <string name="accessibility_quick_settings_dnd_changed_on" msgid="4483780856613561039">"चालु रहेकोलाई अवरोध नपुर्याउनुहोस्।"</string> + <string name="accessibility_quick_settings_dnd_priority_on" msgid="1448402297221249355">"प्राथमिकतालाई मात्र बाधा नपुर्याउनुहोस्।"</string> + <string name="accessibility_quick_settings_dnd_none_on" msgid="5910777408232088752">"बाधा नपुर्याउँनुहोस्, कुनै पनि अवरोध छैनन्।"</string> + <string name="accessibility_quick_settings_dnd_off" msgid="2371832603753738581">"निष्क्रियलाई बाधा नपुर्याउनुहोस्"</string> + <string name="accessibility_quick_settings_dnd_changed_off" msgid="898107593453022935">"निष्क्रिय गरिएकालाई अवरोध नपुर्याउनुहोस्।"</string> + <string name="accessibility_quick_settings_dnd_changed_on" msgid="4483780856613561039">"सक्रिय रहेकोलाई अवरोध नपुर्याउनुहोस्।"</string> <string name="accessibility_quick_settings_bluetooth_off" msgid="2133631372372064339">"ब्लुटुथ बन्द छ।"</string> <string name="accessibility_quick_settings_bluetooth_on" msgid="7681999166216621838">"ब्लुटुथ खुला छ।"</string> <string name="accessibility_quick_settings_bluetooth_connecting" msgid="6953242966685343855">"ब्लुटुथ जोडीदै।"</string> @@ -229,9 +229,9 @@ <string name="start_dreams" msgid="7219575858348719790">"दिवासपना"</string> <string name="ethernet_label" msgid="7967563676324087464">"Ethernet"</string> <string name="quick_settings_airplane_mode_label" msgid="5510520633448831350">"हवाइजहाज मोड"</string> - <string name="quick_settings_dnd_label" msgid="8735855737575028208">"नअल्मल्याउनुहोस्"</string> + <string name="quick_settings_dnd_label" msgid="8735855737575028208">"बाधा नपुर्याउँनुहोस्"</string> <string name="quick_settings_dnd_priority_label" msgid="483232950670692036">"प्राथमिकता मात्र"</string> - <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"कुनै रुकावटहरू छैन"</string> + <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"कुनै अवरोधहरू छैन"</string> <string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"ब्लुटुथ"</string> <string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"ब्लुटुथ (<xliff:g id="NUMBER">%d</xliff:g> उपकरणहरू)"</string> <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"ब्लुटुथ बन्द"</string> diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml index 84b7a9c..1acdace 100644 --- a/packages/SystemUI/res/values-pt/strings.xml +++ b/packages/SystemUI/res/values-pt/strings.xml @@ -313,8 +313,8 @@ <string name="speed_bump_explanation" msgid="1288875699658819755">"Notificações menos urgentes abaixo"</string> <string name="notification_tap_again" msgid="8524949573675922138">"Toque novamente para abrir"</string> <string name="keyguard_unlock" msgid="8043466894212841998">"Deslize para cima para desbloquear"</string> - <string name="phone_hint" msgid="3101468054914424646">"Deslize para a direita para usar o telefone"</string> - <string name="camera_hint" msgid="5241441720959174226">"Deslize para a esquerda para usar a câmera"</string> + <string name="phone_hint" msgid="3101468054914424646">"Deslize à direita p/ usar o telefone"</string> + <string name="camera_hint" msgid="5241441720959174226">"Deslize à esquerda p/ usar a câmera"</string> <string name="interruption_level_none" msgid="3831278883136066646">"Nenhum"</string> <string name="interruption_level_priority" msgid="6517366750688942030">"Prioridade"</string> <string name="interruption_level_all" msgid="1330581184930945764">"Tudo"</string> diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml index e49c20b..4ca33f6 100644 --- a/packages/SystemUI/res/values-ru/strings.xml +++ b/packages/SystemUI/res/values-ru/strings.xml @@ -181,7 +181,7 @@ <string name="accessibility_quick_settings_airplane_changed_off" msgid="66846307818850664">"Режим полета отключен."</string> <string name="accessibility_quick_settings_airplane_changed_on" msgid="8983005603505087728">"Режим полета включен."</string> <string name="accessibility_quick_settings_dnd_priority_on" msgid="1448402297221249355">"Режим \"Не беспокоить\" включен. Будут показаны только важные оповещения."</string> - <string name="accessibility_quick_settings_dnd_none_on" msgid="5910777408232088752">"Режим \"Не беспокоить\" включен. Никаких оповещений показано не будет."</string> + <string name="accessibility_quick_settings_dnd_none_on" msgid="5910777408232088752">"Включен режим \"Не беспокоить\". Все оповещения отключены."</string> <string name="accessibility_quick_settings_dnd_off" msgid="2371832603753738581">"Режим \"Не беспокоить\" выключен."</string> <string name="accessibility_quick_settings_dnd_changed_off" msgid="898107593453022935">"Режим \"Не беспокоить\" выключен."</string> <string name="accessibility_quick_settings_dnd_changed_on" msgid="4483780856613561039">"Режим \"Не беспокоить\" включен."</string> @@ -235,7 +235,7 @@ <string name="quick_settings_airplane_mode_label" msgid="5510520633448831350">"Режим полета"</string> <string name="quick_settings_dnd_label" msgid="8735855737575028208">"Не беспокоить"</string> <string name="quick_settings_dnd_priority_label" msgid="483232950670692036">"Только важные"</string> - <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"Никаких оповещений"</string> + <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"Без оповещений"</string> <string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"Bluetooth"</string> <string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"Bluetooth (<xliff:g id="NUMBER">%d</xliff:g>)"</string> <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"Bluetooth выкл."</string> diff --git a/packages/SystemUI/res/values-si-rLK/strings.xml b/packages/SystemUI/res/values-si-rLK/strings.xml index dc1815e..003b784 100644 --- a/packages/SystemUI/res/values-si-rLK/strings.xml +++ b/packages/SystemUI/res/values-si-rLK/strings.xml @@ -179,8 +179,8 @@ <string name="accessibility_quick_settings_dnd_priority_on" msgid="1448402297221249355">"බාධා නොකරන්න ක්රියාත්මකයි, ප්රමුඛතා පමණි."</string> <string name="accessibility_quick_settings_dnd_none_on" msgid="5910777408232088752">"බාධා නොකරන්න ක්රියාත්මකයි, බාධා කිරීම් නැත."</string> <string name="accessibility_quick_settings_dnd_off" msgid="2371832603753738581">"බාධා නොකරන්න ක්රියා විරහිතයි."</string> - <string name="accessibility_quick_settings_dnd_changed_off" msgid="898107593453022935">"බාධා නොකරන්න ක්රියා විරහිත කරන ලදී."</string> - <string name="accessibility_quick_settings_dnd_changed_on" msgid="4483780856613561039">"බාධා නොකරන්න ක්රියාත්මක කරන ලදී"</string> + <string name="accessibility_quick_settings_dnd_changed_off" msgid="898107593453022935">"බාධා නොකරන්න ක්රියා විරහිත කරන ලදි."</string> + <string name="accessibility_quick_settings_dnd_changed_on" msgid="4483780856613561039">"බාධා නොකරන්න ක්රියාත්මක කරන ලදි"</string> <string name="accessibility_quick_settings_bluetooth_off" msgid="2133631372372064339">"බ්ලූටූත් අක්රියයි."</string> <string name="accessibility_quick_settings_bluetooth_on" msgid="7681999166216621838">"බ්ලූටූත් සක්රියයි."</string> <string name="accessibility_quick_settings_bluetooth_connecting" msgid="6953242966685343855">"බ්ලූටූත් සම්බන්ධවෙමින්."</string> diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml index c4cad95..d12e309 100644 --- a/packages/SystemUI/res/values-zh-rCN/strings.xml +++ b/packages/SystemUI/res/values-zh-rCN/strings.xml @@ -178,16 +178,11 @@ <string name="accessibility_quick_settings_airplane_on" msgid="6406141469157599296">"飞行模式开启。"</string> <string name="accessibility_quick_settings_airplane_changed_off" msgid="66846307818850664">"飞行模式已关闭。"</string> <string name="accessibility_quick_settings_airplane_changed_on" msgid="8983005603505087728">"飞行模式已开启。"</string> - <!-- no translation found for accessibility_quick_settings_dnd_priority_on (1448402297221249355) --> - <skip /> - <!-- no translation found for accessibility_quick_settings_dnd_none_on (5910777408232088752) --> - <skip /> - <!-- no translation found for accessibility_quick_settings_dnd_off (2371832603753738581) --> - <skip /> - <!-- no translation found for accessibility_quick_settings_dnd_changed_off (898107593453022935) --> - <skip /> - <!-- no translation found for accessibility_quick_settings_dnd_changed_on (4483780856613561039) --> - <skip /> + <string name="accessibility_quick_settings_dnd_priority_on" msgid="1448402297221249355">"勿扰模式已开启,仅限优先打扰。"</string> + <string name="accessibility_quick_settings_dnd_none_on" msgid="5910777408232088752">"勿扰模式已开启,禁止打扰。"</string> + <string name="accessibility_quick_settings_dnd_off" msgid="2371832603753738581">"勿扰模式关闭。"</string> + <string name="accessibility_quick_settings_dnd_changed_off" msgid="898107593453022935">"已关闭勿扰模式。"</string> + <string name="accessibility_quick_settings_dnd_changed_on" msgid="4483780856613561039">"已开启勿扰模式。"</string> <string name="accessibility_quick_settings_bluetooth_off" msgid="2133631372372064339">"蓝牙关闭。"</string> <string name="accessibility_quick_settings_bluetooth_on" msgid="7681999166216621838">"蓝牙开启。"</string> <string name="accessibility_quick_settings_bluetooth_connecting" msgid="6953242966685343855">"蓝牙连接中。"</string> @@ -236,12 +231,9 @@ <string name="start_dreams" msgid="7219575858348719790">"互动屏保"</string> <string name="ethernet_label" msgid="7967563676324087464">"有线网络"</string> <string name="quick_settings_airplane_mode_label" msgid="5510520633448831350">"飞行模式"</string> - <!-- no translation found for quick_settings_dnd_label (8735855737575028208) --> - <skip /> - <!-- no translation found for quick_settings_dnd_priority_label (483232950670692036) --> - <skip /> - <!-- no translation found for quick_settings_dnd_none_label (7309935569360609114) --> - <skip /> + <string name="quick_settings_dnd_label" msgid="8735855737575028208">"勿扰"</string> + <string name="quick_settings_dnd_priority_label" msgid="483232950670692036">"仅限优先打扰"</string> + <string name="quick_settings_dnd_none_label" msgid="7309935569360609114">"禁止打扰"</string> <string name="quick_settings_bluetooth_label" msgid="6304190285170721401">"蓝牙"</string> <string name="quick_settings_bluetooth_multiple_devices_label" msgid="3912245565613684735">"蓝牙(<xliff:g id="NUMBER">%d</xliff:g> 台设备)"</string> <string name="quick_settings_bluetooth_off_label" msgid="8159652146149219937">"蓝牙:关闭"</string> diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 7f95b40..275a6be 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -439,6 +439,8 @@ public class KeyguardViewMediator extends SystemUI { public void onFingerprintRecognized(int userId) { if (mStatusBarKeyguardViewManager.isBouncerShowing()) { mViewMediatorCallback.keyguardDone(true); + } else { + mStatusBarKeyguardViewManager.animateCollapsePanels(); } }; diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/FakeShadowDrawable.java b/packages/SystemUI/src/com/android/systemui/recents/views/FakeShadowDrawable.java index 72f9001..509ad1b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/FakeShadowDrawable.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/FakeShadowDrawable.java @@ -159,9 +159,9 @@ class FakeShadowDrawable extends Drawable { } @Override - public void setColorFilter(ColorFilter cf) { - mCornerShadowPaint.setColorFilter(cf); - mEdgeShadowPaint.setColorFilter(cf); + public void setColorFilter(ColorFilter colorFilter) { + mCornerShadowPaint.setColorFilter(colorFilter); + mEdgeShadowPaint.setColorFilter(colorFilter); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index ca54349..3a812cc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -419,61 +419,67 @@ public abstract class BaseStatusBar extends SystemUI implements public void onNotificationPosted(final StatusBarNotification sbn, final RankingMap rankingMap) { if (DEBUG) Log.d(TAG, "onNotificationPosted: " + sbn); - mHandler.post(new Runnable() { - @Override - public void run() { - Notification n = sbn.getNotification(); - boolean isUpdate = mNotificationData.get(sbn.getKey()) != null - || isHeadsUp(sbn.getKey()); - - // Ignore children of notifications that have a summary, since we're not - // going to show them anyway. This is true also when the summary is canceled, - // because children are automatically canceled by NoMan in that case. - if (n.isGroupChild() && - mNotificationData.isGroupWithSummary(sbn.getGroupKey())) { - if (DEBUG) { - Log.d(TAG, "Ignoring group child due to existing summary: " + sbn); - } + if (sbn != null) { + mHandler.post(new Runnable() { + @Override + public void run() { + Notification n = sbn.getNotification(); + boolean isUpdate = mNotificationData.get(sbn.getKey()) != null + || isHeadsUp(sbn.getKey()); + + // Ignore children of notifications that have a summary, since we're not + // going to show them anyway. This is true also when the summary is canceled, + // because children are automatically canceled by NoMan in that case. + if (n.isGroupChild() && + mNotificationData.isGroupWithSummary(sbn.getGroupKey())) { + if (DEBUG) { + Log.d(TAG, "Ignoring group child due to existing summary: " + sbn); + } - // Remove existing notification to avoid stale data. + // Remove existing notification to avoid stale data. + if (isUpdate) { + removeNotification(sbn.getKey(), rankingMap); + } else { + mNotificationData.updateRanking(rankingMap); + } + return; + } if (isUpdate) { - removeNotification(sbn.getKey(), rankingMap); + updateNotification(sbn, rankingMap); } else { - mNotificationData.updateRanking(rankingMap); + addNotification(sbn, rankingMap); } - return; } - if (isUpdate) { - updateNotification(sbn, rankingMap); - } else { - addNotification(sbn, rankingMap); - } - } - }); + }); + } } @Override - public void onNotificationRemoved(final StatusBarNotification sbn, + public void onNotificationRemoved(StatusBarNotification sbn, final RankingMap rankingMap) { if (DEBUG) Log.d(TAG, "onNotificationRemoved: " + sbn); - mHandler.post(new Runnable() { - @Override - public void run() { - removeNotification(sbn.getKey(), rankingMap); - } - }); + if (sbn != null) { + final String key = sbn.getKey(); + mHandler.post(new Runnable() { + @Override + public void run() { + removeNotification(key, rankingMap); + } + }); + } } @Override public void onNotificationRankingUpdate(final RankingMap rankingMap) { if (DEBUG) Log.d(TAG, "onRankingUpdate"); + if (rankingMap != null) { mHandler.post(new Runnable() { @Override public void run() { updateNotificationRanking(rankingMap); } }); - } + } } }; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java index e89e15d..2d76645 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java @@ -160,7 +160,7 @@ public class BarTransitions { } @Override - public void setColorFilter(ColorFilter cf) { + public void setColorFilter(ColorFilter colorFilter) { // noop } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPreviewContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPreviewContainer.java index 287bb73..076e5f1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPreviewContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardPreviewContainer.java @@ -46,7 +46,7 @@ public class KeyguardPreviewContainer extends FrameLayout { } @Override - public void setColorFilter(ColorFilter cf) { + public void setColorFilter(ColorFilter colorFilter) { // noop } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 8aafe52..b14a70d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -2929,7 +2929,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } @Override - public void setColorFilter(ColorFilter cf) { + public void setColorFilter(ColorFilter colorFilter) { } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index 2f3a159..6369d5e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -31,6 +31,7 @@ import com.android.internal.policy.IKeyguardShowCallback; import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.ViewMediatorCallback; +import com.android.systemui.statusbar.CommandQueue; import static com.android.keyguard.KeyguardHostView.OnDismissAction; @@ -439,4 +440,8 @@ public class StatusBarKeyguardViewManager { public void keyguardGoingAway() { mPhoneStatusBar.keyguardGoingAway(); } + + public void animateCollapsePanels() { + mPhoneStatusBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE, true /* force */); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java index b89aa8f..56c1e10 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java @@ -120,7 +120,7 @@ public class TrustDrawable extends Drawable { } @Override - public void setColorFilter(ColorFilter cf) { + public void setColorFilter(ColorFilter colorFilter) { throw new UnsupportedOperationException("not implemented"); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java index 6998791..a3ebb09 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java @@ -118,7 +118,7 @@ public class KeyButtonRipple extends Drawable { } @Override - public void setColorFilter(ColorFilter cf) { + public void setColorFilter(ColorFilter colorFilter) { // Not supported. } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherScrim.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherScrim.java index 68ddfa6..2d04d8e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherScrim.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherScrim.java @@ -76,7 +76,7 @@ public class KeyguardUserSwitcherScrim extends Drawable } @Override - public void setColorFilter(ColorFilter cf) { + public void setColorFilter(ColorFilter colorFilter) { } @Override diff --git a/packages/services/Proxy/src/com/android/proxyhandler/ProxyServer.java b/packages/services/Proxy/src/com/android/proxyhandler/ProxyServer.java index edb1630..ac40222 100644 --- a/packages/services/Proxy/src/com/android/proxyhandler/ProxyServer.java +++ b/packages/services/Proxy/src/com/android/proxyhandler/ProxyServer.java @@ -20,6 +20,7 @@ import android.util.Log; import com.android.net.IProxyPortListener; import com.google.android.collect.Lists; +import com.google.android.collect.Sets; import java.io.IOException; import java.io.InputStream; @@ -33,6 +34,7 @@ import java.net.SocketException; import java.net.URI; import java.net.URISyntaxException; import java.util.List; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -46,6 +48,10 @@ public class ProxyServer extends Thread { private static final String TAG = "ProxyServer"; + // HTTP Headers + private static final String HEADER_CONNECTION = "connection"; + private static final String HEADER_PROXY_CONNECTION = "proxy-connection"; + private ExecutorService threadExecutor; public boolean mIsRunning = false; @@ -65,10 +71,6 @@ public class ProxyServer extends Thread { public void run() { try { String requestLine = getLine(connection.getInputStream()); - if (requestLine == null) { - connection.close(); - return; - } String[] splitLine = requestLine.split(" "); if (splitLine.length < 3) { connection.close(); @@ -76,22 +78,30 @@ public class ProxyServer extends Thread { } String requestType = splitLine[0]; String urlString = splitLine[1]; + String httpVersion = splitLine[2]; - String host = ""; - int port = 80; + URI url = null; + String host; + int port; if (requestType.equals(CONNECT)) { String[] hostPortSplit = urlString.split(":"); host = hostPortSplit[0]; - try { - port = Integer.parseInt(hostPortSplit[1]); - } catch (NumberFormatException nfe) { + // Use default SSL port if not specified. Parse it otherwise + if (hostPortSplit.length < 2) { port = 443; + } else { + try { + port = Integer.parseInt(hostPortSplit[1]); + } catch (NumberFormatException nfe) { + connection.close(); + return; + } } urlString = "Https://" + host + ":" + port; } else { try { - URI url = new URI(urlString); + url = new URI(urlString); host = url.getHost(); port = url.getPort(); if (port < 0) { @@ -122,44 +132,99 @@ public class ProxyServer extends Thread { } else { server = new Socket(host, port); if (requestType.equals(CONNECT)) { - while (getLine(connection.getInputStream()).length() != 0); + skipToRequestBody(connection); // No proxy to respond so we must. sendLine(connection, HTTP_OK); } else { - sendLine(server, requestLine); + // Proxying the request directly to the origin server. + sendAugmentedRequestToHost(connection, server, + requestType, url, httpVersion); } } } catch (IOException ioe) { - + if (Log.isLoggable(TAG, Log.VERBOSE)) { + Log.v(TAG, "Unable to connect to proxy " + proxy, ioe); + } } if (server != null) { break; } } - if (server == null) { + if (list.isEmpty()) { server = new Socket(host, port); if (requestType.equals(CONNECT)) { - while (getLine(connection.getInputStream()).length() != 0); + skipToRequestBody(connection); // No proxy to respond so we must. sendLine(connection, HTTP_OK); } else { - sendLine(server, requestLine); + // Proxying the request directly to the origin server. + sendAugmentedRequestToHost(connection, server, + requestType, url, httpVersion); } } // Pass data back and forth until complete. - SocketConnect.connect(connection, server); - } catch (IOException e) { + if (server != null) { + SocketConnect.connect(connection, server); + } + } catch (Exception e) { Log.d(TAG, "Problem Proxying", e); } try { connection.close(); } catch (IOException ioe) { + // Do nothing + } + } + /** + * Sends HTTP request-line (i.e. the first line in the request) + * that contains absolute path of a given absolute URI. + * + * @param server server to send the request to. + * @param requestType type of the request, a.k.a. HTTP method. + * @param absoluteUri absolute URI which absolute path should be extracted. + * @param httpVersion version of HTTP, e.g. HTTP/1.1. + * @throws IOException if the request-line cannot be sent. + */ + private void sendRequestLineWithPath(Socket server, String requestType, + URI absoluteUri, String httpVersion) throws IOException { + + String absolutePath = getAbsolutePathFromAbsoluteURI(absoluteUri); + String outgoingRequestLine = String.format("%s %s %s", + requestType, absolutePath, httpVersion); + sendLine(server, outgoingRequestLine); + } + + /** + * Extracts absolute path form a given URI. E.g., passing + * <code>http://google.com:80/execute?query=cat#top</code> + * will result in <code>/execute?query=cat#top</code>. + * + * @param uri URI which absolute path has to be extracted, + * @return the absolute path of the URI, + */ + private String getAbsolutePathFromAbsoluteURI(URI uri) { + String rawPath = uri.getRawPath(); + String rawQuery = uri.getRawQuery(); + String rawFragment = uri.getRawFragment(); + StringBuilder absolutePath = new StringBuilder(); + + if (rawPath != null) { + absolutePath.append(rawPath); + } else { + absolutePath.append("/"); + } + if (rawQuery != null) { + absolutePath.append("?").append(rawQuery); } + if (rawFragment != null) { + absolutePath.append("#").append(rawFragment); + } + return absolutePath.toString(); } private String getLine(InputStream inputStream) throws IOException { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); int byteBuffer = inputStream.read(); if (byteBuffer < 0) return ""; do { @@ -179,6 +244,79 @@ public class ProxyServer extends Thread { os.write('\n'); os.flush(); } + + /** + * Reads from socket until an empty line is read which indicates the end of HTTP headers. + * + * @param socket socket to read from. + * @throws IOException if an exception took place during the socket read. + */ + private void skipToRequestBody(Socket socket) throws IOException { + while (getLine(socket.getInputStream()).length() != 0); + } + + /** + * Sends an augmented request to the final host (DIRECT connection). + * + * @param src socket to read HTTP headers from.The socket current position should point + * to the beginning of the HTTP header section. + * @param dst socket to write the augmented request to. + * @param httpMethod original request http method. + * @param uri original request absolute URI. + * @param httpVersion original request http version. + * @throws IOException if an exception took place during socket reads or writes. + */ + private void sendAugmentedRequestToHost(Socket src, Socket dst, + String httpMethod, URI uri, String httpVersion) throws IOException { + + sendRequestLineWithPath(dst, httpMethod, uri, httpVersion); + filterAndForwardRequestHeaders(src, dst); + + // Currently the proxy does not support keep-alive connections; therefore, + // the proxy has to request the destination server to close the connection + // after the destination server sent the response. + sendLine(dst, "Connection: close"); + + // Sends and empty line that indicates termination of the header section. + sendLine(dst, ""); + } + + /** + * Forwards original request headers filtering out the ones that have to be removed. + * + * @param src source socket that contains original request headers. + * @param dst destination socket to send the filtered headers to. + * @throws IOException if the data cannot be read from or written to the sockets. + */ + private void filterAndForwardRequestHeaders(Socket src, Socket dst) throws IOException { + String line; + do { + line = getLine(src.getInputStream()); + if (line.length() > 0 && !shouldRemoveHeaderLine(line)) { + sendLine(dst, line); + } + } while (line.length() > 0); + } + + /** + * Returns true if a given header line has to be removed from the original request. + * + * @param line header line that should be analysed. + * @return true if the header line should be removed and not forwarded to the destination. + */ + private boolean shouldRemoveHeaderLine(String line) { + int colIndex = line.indexOf(":"); + if (colIndex != -1) { + String headerName = line.substring(0, colIndex).trim(); + if (headerName.regionMatches(true, 0, HEADER_CONNECTION, 0, + HEADER_CONNECTION.length()) + || headerName.regionMatches(true, 0, HEADER_PROXY_CONNECTION, + 0, HEADER_PROXY_CONNECTION.length())) { + return true; + } + } + return false; + } } public ProxyServer() { @@ -192,23 +330,21 @@ public class ProxyServer extends Thread { try { serverSocket = new ServerSocket(0); - if (serverSocket != null) { - setPort(serverSocket.getLocalPort()); + setPort(serverSocket.getLocalPort()); - while (mIsRunning) { - try { - Socket socket = serverSocket.accept(); - // Only receive local connections. - if (socket.getInetAddress().isLoopbackAddress()) { - ProxyConnection parser = new ProxyConnection(socket); + while (mIsRunning) { + try { + Socket socket = serverSocket.accept(); + // Only receive local connections. + if (socket.getInetAddress().isLoopbackAddress()) { + ProxyConnection parser = new ProxyConnection(socket); - threadExecutor.execute(parser); - } else { - socket.close(); - } - } catch (IOException e) { - e.printStackTrace(); + threadExecutor.execute(parser); + } else { + socket.close(); } + } catch (IOException e) { + e.printStackTrace(); } } } catch (SocketException e) { |