android:resource="@id/about_settings" />
</activity>
+ <activity android:name="Settings$PowerOff"
+ android:label="@string/power_off"
+ android:theme="@*android:style/Theme.Holo.Dialog.Alert">
+ <intent-filter>
+ <action android:name="android.intent.ACTION_REQUEST_SHUTDOWN" />
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+
<activity android:name="SettingsLicenseActivity"
android:label="@string/settings_license_activity_title"
android:theme="@android:style/Theme.Holo.Panel"
-keep class com.android.settings.inputmethod.*
-keep class com.android.settings.MasterClear
-keep class com.android.settings.MasterClearConfirm
+-keep class com.android.settings.PowerOff
-keep class com.android.settings.accounts.*
-keep class com.android.settings.fuelgauge.*
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"إلغاء"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"تحديثات إضافية للنظام"</string>
+ <string name="power_off" msgid="4266614107412865048">"ﺈﻴﻗﺎﻓ ﺎﻠﺘﺸﻐﻴﻟ"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Отказ"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Допълнителни системни актуализации"</string>
+ <string name="power_off" msgid="4266614107412865048">"Изключване"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancel·la"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Actualitzacions addicionals del sistema"</string>
+ <string name="power_off" msgid="4266614107412865048">"Apaga"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Zrušit"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Další aktualizace systému"</string>
+ <string name="power_off" msgid="4266614107412865048">"Vypnout"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Annuller"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Yderligere systemopdateringer"</string>
+ <string name="power_off" msgid="4266614107412865048">"Sluk"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Abbrechen"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Zusätzliche Systemupdates"</string>
+ <string name="power_off" msgid="4266614107412865048">"Ausschalten"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Ακύρωση"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Πρόσθετες ενημερώσεις συστήματος"</string>
+ <string name="power_off" msgid="4266614107412865048">"Απενεργοποίηση"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancel"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Additional system updates"</string>
+ <string name="power_off" msgid="4266614107412865048">"Power off"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancelar"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Actualizaciones del sistema adicionales"</string>
+ <string name="power_off" msgid="4266614107412865048">"Apagar"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancelar"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Otras actualizaciones del sistema"</string>
+ <string name="power_off" msgid="4266614107412865048">"Apagar"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"لغو"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"به روزرسانی های دیگر سیستم"</string>
+ <string name="power_off" msgid="4266614107412865048">"ﺥﺎﻣﻮﺷ کﺭﺪﻧ"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Peruuta"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Järjestelmän lisäpäivitykset"</string>
+ <string name="power_off" msgid="4266614107412865048">"Virta pois"</string>
</resources>
<!-- no translation found for percentage (5866131581207788624) -->
<skip />
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Mises à jour supplémentaires du système"</string>
+ <string name="power_off" msgid="4266614107412865048">"Éteindre"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Odustani"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Dodatna ažuriranja sustava"</string>
+ <string name="power_off" msgid="4266614107412865048">"Isključi"</string>
</resources>
<!-- no translation found for percentage (5866131581207788624) -->
<skip />
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"További rendszerfrissítések"</string>
+ <string name="power_off" msgid="4266614107412865048">"Kikapcsolás"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Batal"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Pemutakhiran sistem tambahan"</string>
+ <string name="power_off" msgid="4266614107412865048">"Matikan daya"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Annulla"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Aggiornamenti di sistema aggiuntivi"</string>
+ <string name="power_off" msgid="4266614107412865048">"Spegni"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"ביטול"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"עדכוני מערכת נוספים"</string>
+ <string name="power_off" msgid="4266614107412865048">"כיבוי"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"キャンセル"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"その他のシステムアップデート"</string>
+ <string name="power_off" msgid="4266614107412865048">"電源を切る"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"취소"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"추가 시스템 업데이트"</string>
+ <string name="power_off" msgid="4266614107412865048">"종료"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Atšaukti"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Papildomi sistemos naujiniai"</string>
+ <string name="power_off" msgid="4266614107412865048">"Išjungti maitinimą"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Atcelt"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Papildu sistēmas atjauninājumi"</string>
+ <string name="power_off" msgid="4266614107412865048">"Strāvas padeve ir izslēgta."</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Avbryt"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Ytterligere systemoppdateringer"</string>
+ <string name="power_off" msgid="4266614107412865048">"Slå av"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Annuleren"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Aanvullende systeemupdates"</string>
+ <string name="power_off" msgid="4266614107412865048">"Uitschakelen"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Anuluj"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Dodatkowe aktualizacje systemu"</string>
+ <string name="power_off" msgid="4266614107412865048">"Wyłącz"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancelar"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Atualizações adicionais do sistema"</string>
+ <string name="power_off" msgid="4266614107412865048">"Desligar"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Cancelar"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Atualizações adicionais do sistema"</string>
+ <string name="power_off" msgid="4266614107412865048">"Desligar"</string>
</resources>
<skip />
<!-- no translation found for additional_system_update_settings_list_item_title (214987609894661992) -->
<skip />
+ <string name="power_off" msgid="4266614107412865048">"Serrar"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Anulaţi"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Actualizări de sistem suplimentare"</string>
+ <string name="power_off" msgid="4266614107412865048">"Opriţi alimentarea"</string>
</resources>
<!-- no translation found for percentage (5866131581207788624) -->
<skip />
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Дополнительные обновления системы"</string>
+ <string name="power_off" msgid="4266614107412865048">"Выключение"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Zrušiť"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Ďalšie aktualizácie systému"</string>
+ <string name="power_off" msgid="4266614107412865048">"Vypnúť"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Prekliči"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Dodatne posodobitve sistema"</string>
+ <string name="power_off" msgid="4266614107412865048">"Izklopi"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Откажи"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Додатна ажурирања система"</string>
+ <string name="power_off" msgid="4266614107412865048">"Искључи"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Avbryt"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g> %%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Ytterligare systemuppdateringar"</string>
+ <string name="power_off" msgid="4266614107412865048">"Stäng av"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"ยกเลิก"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"การอัปเดตระบบอื่นๆ"</string>
+ <string name="power_off" msgid="4266614107412865048">"ปิดเครื่อง"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Kanselahin"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Mga karagdagang pag-update sa system"</string>
+ <string name="power_off" msgid="4266614107412865048">"I-off"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"İptal"</string>
<string name="percentage" msgid="5866131581207788624">"%%<xliff:g id="NUMBER">%d</xliff:g>"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Ek sistem güncellemeleri"</string>
+ <string name="power_off" msgid="4266614107412865048">"Kapat"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Скасувати"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Додаткові оновлення системи"</string>
+ <string name="power_off" msgid="4266614107412865048">"Вимкнути"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"Hủy"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"Bản cập nhật hệ thống bổ sung"</string>
+ <string name="power_off" msgid="4266614107412865048">"Tắt nguồn"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"取消"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"其他系统更新"</string>
+ <string name="power_off" msgid="4266614107412865048">"关机"</string>
</resources>
<string name="backup_pw_cancel_button_text" msgid="8845630125391744615">"取消"</string>
<string name="percentage" msgid="5866131581207788624">"<xliff:g id="NUMBER">%d</xliff:g>%%"</string>
<string name="additional_system_update_settings_list_item_title" msgid="214987609894661992">"其他系統更新"</string>
+ <string name="power_off" msgid="4266614107412865048">"關機"</string>
</resources>
"system_update_settings_list_item_title" in this project. [CHAR LIMIT=25] -->
<string name="additional_system_update_settings_list_item_title">Additional system updates</string>
+ <!-- Main settings screen, setting title for the user to go into the About phone screen -->
+ <string name="power_off">Power Off</string>
</resources>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ android:title="@string/power_off">
+
+</PreferenceScreen>
android:icon="@drawable/ic_settings_about"
android:title="@string/about_settings" />
+ <!-- Power Off -->
+ <header
+ android:id="@+id/poweroff"
+ android:fragment="com.android.settings.PowerOff"
+ android:icon="@drawable/ic_settings_poweroff"
+ android:title="@string/power_off" >
+ <intent android:action="com.android.settings.PowerOff" />
+ </header>
</preference-headers>
--- /dev/null
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package com.android.settings;
+
+import android.app.Activity;
+import android.app.ActivityManager;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.util.Slog;
+import android.content.BroadcastReceiver;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Build;
+import android.os.Bundle;
+import android.preference.Preference;
+import android.preference.PreferenceGroup;
+import android.preference.PreferenceScreen;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.WindowManager;
+import android.content.Context;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.List;
+import android.os.Handler;
+
+public class PowerOff extends SettingsPreferenceFragment{
+ private Context mContext;
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ }
+ public void onStart() {
+ super.onStart();
+ beginshutdown();
+ }
+
+ public void beginshutdown()
+ {
+ final CloseDialogReceiver closer = new CloseDialogReceiver(getActivity());
+ final AlertDialog dialog = new AlertDialog.Builder(getActivity())
+ .setIconAttribute(android.R.attr.alertDialogIcon)
+ .setTitle(com.android.internal.R.string.power_off)
+ .setMessage(com.android.internal.R.string.shutdown_confirm_question)
+ .setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ Intent shutdown = new Intent(Intent.ACTION_REQUEST_SHUTDOWN);
+ shutdown.putExtra(Intent.EXTRA_KEY_CONFIRM, false);
+ shutdown.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(shutdown);
+ }
+ })
+ .setNegativeButton(com.android.internal.R.string.no, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int which) {
+ Intent close = new Intent(Intent.ACTION_MAIN);
+ close.addCategory(Intent.CATEGORY_HOME);
+ close.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(close);
+ finish();
+ }
+ })
+ .create();
+ closer.dialog = dialog;
+ dialog.setOnDismissListener(closer);
+ dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
+ if (!getActivity().getResources().getBoolean(
+ com.android.internal.R.bool.config_sf_slowBlur)) {
+ dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+ }
+ dialog.show();
+
+ }
+ private static class CloseDialogReceiver extends BroadcastReceiver
+ implements DialogInterface.OnDismissListener {
+ private Context mContext;
+ public Dialog dialog;
+
+ CloseDialogReceiver(Context context) {
+ mContext = context;
+ IntentFilter filter = new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
+ context.registerReceiver(this, filter);
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ dialog.cancel();
+ }
+
+ public void onDismiss(DialogInterface unused) {
+ mContext.unregisterReceiver(this);
+ }
+ }
+ public void onResume() {
+ super.onResume();
+ }
+ public void onPause() {
+ super.onPause();
+ }
+ public void onStop() {
+ super.onStop();
+ }
+ public void onDestroy() {
+ super.onDestroy();
+ }
+ }