packages/apps/Settings
Revision | 6883e39d778535950b80861ca04eeec79a3e9763 (tree) |
---|---|
Time | 2013-01-15 13:51:39 |
Author | Jackson Hsu <jacksonx.hsu@inte...> |
Commiter | Chih-Wei Huang |
Implement poweroff function in Settings menu
Bugzilla 8729 13343
Add "Power Off" layout under "About tablet" in Settings menu. System can
shutdown when you touch "ok", otherwise back to home screen.
Change-Id: I1c572dca93203e02dd829247d20806a43966e64f
Signed-off-by: Jackson Hsu <jacksonx.hsu@intel.com>
@@ -582,6 +582,16 @@ | ||
582 | 582 | android:resource="@id/about_settings" /> |
583 | 583 | </activity> |
584 | 584 | |
585 | + <activity android:name="Settings$PowerOff" | |
586 | + android:label="@string/power_off" | |
587 | + android:theme="@*android:style/Theme.Holo.Dialog.Alert"> | |
588 | + <intent-filter> | |
589 | + <action android:name="android.intent.ACTION_REQUEST_SHUTDOWN" /> | |
590 | + <action android:name="android.intent.action.MAIN" /> | |
591 | + <category android:name="android.intent.category.DEFAULT" /> | |
592 | + </intent-filter> | |
593 | + </activity> | |
594 | + | |
585 | 595 | <activity android:name="SettingsLicenseActivity" |
586 | 596 | android:label="@string/settings_license_activity_title" |
587 | 597 | android:theme="@android:style/Theme.Holo.Panel" |
@@ -9,6 +9,7 @@ | ||
9 | 9 | -keep class com.android.settings.inputmethod.* |
10 | 10 | -keep class com.android.settings.MasterClear |
11 | 11 | -keep class com.android.settings.MasterClearConfirm |
12 | +-keep class com.android.settings.PowerOff | |
12 | 13 | -keep class com.android.settings.accounts.* |
13 | 14 | -keep class com.android.settings.fuelgauge.* |
14 | 15 |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"إلغاء"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"تحديثات إضافية للنظام"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"ﺈﻴﻗﺎﻓ ﺎﻠﺘﺸﻐﻴﻟ"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Отказ"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Допълнителни системни актуализации"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Изключване"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancel·la"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Actualitzacions addicionals del sistema"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Apaga"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Zrušit"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Další aktualizace systému"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Vypnout"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Annuller"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Yderligere systemopdateringer"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Sluk"</string> | |
1583 | 1584 | </resources> |
@@ -1581,4 +1581,5 @@ | ||
1581 | 1581 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Abbrechen"</string> |
1582 | 1582 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1583 | 1583 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Zusätzliche Systemupdates"</string> |
1584 | + <string name="power_off" msgid="4266614107412865048">"Ausschalten"</string> | |
1584 | 1585 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Ακύρωση"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Πρόσθετες ενημερώσεις συστήματος"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Απενεργοποίηση"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancel"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Additional system updates"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Power off"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancelar"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Actualizaciones del sistema adicionales"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Apagar"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancelar"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Otras actualizaciones del sistema"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Apagar"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"لغو"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"به روزرسانی های دیگر سیستم"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"ﺥﺎﻣﻮﺷ کﺭﺪﻧ"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Peruuta"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Järjestelmän lisäpäivitykset"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Virta pois"</string> | |
1583 | 1584 | </resources> |
@@ -1582,4 +1582,5 @@ | ||
1582 | 1582 | <!-- no translation found for percentage (5866131581207788624) --> |
1583 | 1583 | <skip /> |
1584 | 1584 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Mises à jour supplémentaires du système"</string> |
1585 | + <string name="power_off" msgid="4266614107412865048">"Éteindre"</string> | |
1585 | 1586 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Odustani"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Dodatna ažuriranja sustava"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Isključi"</string> | |
1583 | 1584 | </resources> |
@@ -1582,4 +1582,5 @@ | ||
1582 | 1582 | <!-- no translation found for percentage (5866131581207788624) --> |
1583 | 1583 | <skip /> |
1584 | 1584 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"További rendszerfrissítések"</string> |
1585 | + <string name="power_off" msgid="4266614107412865048">"Kikapcsolás"</string> | |
1585 | 1586 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Batal"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Pemutakhiran sistem tambahan"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Matikan daya"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Annulla"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Aggiornamenti di sistema aggiuntivi"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Spegni"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"ביטול"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"עדכוני מערכת נוספים"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"כיבוי"</string> | |
1583 | 1584 | </resources> |
@@ -1585,4 +1585,5 @@ | ||
1585 | 1585 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"キャンセル"</string> |
1586 | 1586 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1587 | 1587 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"その他のシステムアップデート"</string> |
1588 | + <string name="power_off" msgid="4266614107412865048">"電源を切る"</string> | |
1588 | 1589 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"취소"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"추가 시스템 업데이트"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"종료"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Atšaukti"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Papildomi sistemos naujiniai"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Išjungti maitinimą"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Atcelt"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Papildu sistēmas atjauninājumi"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Strāvas padeve ir izslēgta."</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Avbryt"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Ytterligere systemoppdateringer"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Slå av"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Annuleren"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Aanvullende systeemupdates"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Uitschakelen"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Anuluj"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Dodatkowe aktualizacje systemu"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Wyłącz"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancelar"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Atualizações adicionais do sistema"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Desligar"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancelar"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Atualizações adicionais do sistema"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Desligar"</string> | |
1583 | 1584 | </resources> |
@@ -2411,4 +2411,5 @@ | ||
2411 | 2411 | <skip /> |
2412 | 2412 | <!-- no translation found for additional_system_update_settings_list_item_title (214987609894661992) --> |
2413 | 2413 | <skip /> |
2414 | + <string name="power_off" msgid="4266614107412865048">"Serrar"</string> | |
2414 | 2415 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Anulaţi"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Actualizări de sistem suplimentare"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Opriţi alimentarea"</string> | |
1583 | 1584 | </resources> |
@@ -1582,4 +1582,5 @@ | ||
1582 | 1582 | <!-- no translation found for percentage (5866131581207788624) --> |
1583 | 1583 | <skip /> |
1584 | 1584 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Дополнительные обновления системы"</string> |
1585 | + <string name="power_off" msgid="4266614107412865048">"Выключение"</string> | |
1585 | 1586 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Zrušiť"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Ďalšie aktualizácie systému"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Vypnúť"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Prekliči"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Dodatne posodobitve sistema"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Izklopi"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Откажи"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Додатна ажурирања система"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Искључи"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Avbryt"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Ytterligare systemuppdateringar"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Stäng av"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"ยกเลิก"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"การอัปเดตระบบอื่นๆ"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"ปิดเครื่อง"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Kanselahin"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Mga karagdagang pag-update sa system"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"I-off"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"İptal"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"%%<xliff:g id="NUMBER">%d</xliff:g>"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Ek sistem güncellemeleri"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Kapat"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Скасувати"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Додаткові оновлення системи"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Вимкнути"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Hủy"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Bản cập nhật hệ thống bổ sung"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"Tắt nguồn"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"取消"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"其他系统更新"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"关机"</string> | |
1583 | 1584 | </resources> |
@@ -1580,4 +1580,5 @@ | ||
1580 | 1580 | <string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"取消"</string> |
1581 | 1581 | <string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string> |
1582 | 1582 | <string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"其他系統更新"</string> |
1583 | + <string name="power_off" msgid="4266614107412865048">"關機"</string> | |
1583 | 1584 | </resources> |
@@ -3788,4 +3788,6 @@ found in the list of installed apps.</string> | ||
3788 | 3788 | "system_update_settings_list_item_title" in this project. [CHAR LIMIT=25] --> |
3789 | 3789 | <string name="additional_system_update_settings_list_item_title">Additional system updates</string> |
3790 | 3790 | |
3791 | + <!-- Main settings screen, setting title for the user to go into the About phone screen --> | |
3792 | + <string name="power_off">Power Off</string> | |
3791 | 3793 | </resources> |
@@ -0,0 +1,20 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<!-- Copyright (C) 2008 The Android Open Source Project | |
3 | + | |
4 | + Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | + you may not use this file except in compliance with the License. | |
6 | + You may obtain a copy of the License at | |
7 | + | |
8 | + http://www.apache.org/licenses/LICENSE-2.0 | |
9 | + | |
10 | + Unless required by applicable law or agreed to in writing, software | |
11 | + distributed under the License is distributed on an "AS IS" BASIS, | |
12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | + See the License for the specific language governing permissions and | |
14 | + limitations under the License. | |
15 | +--> | |
16 | + | |
17 | +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" | |
18 | + android:title="@string/power_off"> | |
19 | + | |
20 | +</PreferenceScreen> |
@@ -182,4 +182,12 @@ | ||
182 | 182 | android:icon="@drawable/ic_settings_about" |
183 | 183 | android:title="@string/about_settings" /> |
184 | 184 | |
185 | + <!-- Power Off --> | |
186 | + <header | |
187 | + android:id="@+id/poweroff" | |
188 | + android:fragment="com.android.settings.PowerOff" | |
189 | + android:icon="@drawable/ic_settings_poweroff" | |
190 | + android:title="@string/power_off" > | |
191 | + <intent android:action="com.android.settings.PowerOff" /> | |
192 | + </header> | |
185 | 193 | </preference-headers> |
@@ -0,0 +1,121 @@ | ||
1 | +/* | |
2 | + * Copyright (C) 2006 The Android Open Source Project | |
3 | + * | |
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | + * you may not use this file except in compliance with the License. | |
6 | + * You may obtain a copy of the License at | |
7 | + * | |
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | + * | |
10 | + * Unless required by applicable law or agreed to in writing, software | |
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | + * See the License for the specific language governing permissions and | |
14 | + * limitations under the License. | |
15 | + */ | |
16 | + | |
17 | +package com.android.settings; | |
18 | + | |
19 | +import android.app.Activity; | |
20 | +import android.app.ActivityManager; | |
21 | +import android.app.AlertDialog; | |
22 | +import android.app.Dialog; | |
23 | +import android.util.Slog; | |
24 | +import android.content.BroadcastReceiver; | |
25 | +import android.content.DialogInterface; | |
26 | +import android.content.Intent; | |
27 | +import android.content.IntentFilter; | |
28 | +import android.os.Build; | |
29 | +import android.os.Bundle; | |
30 | +import android.preference.Preference; | |
31 | +import android.preference.PreferenceGroup; | |
32 | +import android.preference.PreferenceScreen; | |
33 | +import android.provider.Settings; | |
34 | +import android.util.Log; | |
35 | +import android.view.WindowManager; | |
36 | +import android.content.Context; | |
37 | + | |
38 | +import java.io.BufferedReader; | |
39 | +import java.io.FileReader; | |
40 | +import java.io.IOException; | |
41 | +import java.util.List; | |
42 | +import android.os.Handler; | |
43 | + | |
44 | +public class PowerOff extends SettingsPreferenceFragment{ | |
45 | + private Context mContext; | |
46 | + public void onCreate(Bundle icicle) { | |
47 | + super.onCreate(icicle); | |
48 | + } | |
49 | + public void onStart() { | |
50 | + super.onStart(); | |
51 | + beginshutdown(); | |
52 | + } | |
53 | + | |
54 | + public void beginshutdown() | |
55 | + { | |
56 | + final CloseDialogReceiver closer = new CloseDialogReceiver(getActivity()); | |
57 | + final AlertDialog dialog = new AlertDialog.Builder(getActivity()) | |
58 | + .setIconAttribute(android.R.attr.alertDialogIcon) | |
59 | + .setTitle(com.android.internal.R.string.power_off) | |
60 | + .setMessage(com.android.internal.R.string.shutdown_confirm_question) | |
61 | + .setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() { | |
62 | + public void onClick(DialogInterface dialog, int which) { | |
63 | + Intent shutdown = new Intent(Intent.ACTION_REQUEST_SHUTDOWN); | |
64 | + shutdown.putExtra(Intent.EXTRA_KEY_CONFIRM, false); | |
65 | + shutdown.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
66 | + startActivity(shutdown); | |
67 | + } | |
68 | + }) | |
69 | + .setNegativeButton(com.android.internal.R.string.no, new DialogInterface.OnClickListener() { | |
70 | + public void onClick(DialogInterface dialog, int which) { | |
71 | + Intent close = new Intent(Intent.ACTION_MAIN); | |
72 | + close.addCategory(Intent.CATEGORY_HOME); | |
73 | + close.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
74 | + startActivity(close); | |
75 | + finish(); | |
76 | + } | |
77 | + }) | |
78 | + .create(); | |
79 | + closer.dialog = dialog; | |
80 | + dialog.setOnDismissListener(closer); | |
81 | + dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); | |
82 | + if (!getActivity().getResources().getBoolean( | |
83 | + com.android.internal.R.bool.config_sf_slowBlur)) { | |
84 | + dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); | |
85 | + } | |
86 | + dialog.show(); | |
87 | + | |
88 | + } | |
89 | + private static class CloseDialogReceiver extends BroadcastReceiver | |
90 | + implements DialogInterface.OnDismissListener { | |
91 | + private Context mContext; | |
92 | + public Dialog dialog; | |
93 | + | |
94 | + CloseDialogReceiver(Context context) { | |
95 | + mContext = context; | |
96 | + IntentFilter filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); | |
97 | + context.registerReceiver(this, filter); | |
98 | + } | |
99 | + | |
100 | + @Override | |
101 | + public void onReceive(Context context, Intent intent) { | |
102 | + dialog.cancel(); | |
103 | + } | |
104 | + | |
105 | + public void onDismiss(DialogInterface unused) { | |
106 | + mContext.unregisterReceiver(this); | |
107 | + } | |
108 | + } | |
109 | + public void onResume() { | |
110 | + super.onResume(); | |
111 | + } | |
112 | + public void onPause() { | |
113 | + super.onPause(); | |
114 | + } | |
115 | + public void onStop() { | |
116 | + super.onStop(); | |
117 | + } | |
118 | + public void onDestroy() { | |
119 | + super.onDestroy(); | |
120 | + } | |
121 | + } |