+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+
+<bitmapxmlns:android="http://schemas.android.com/apk/res/android"+android:src="@drawable/ic_lock_power_reboot_alpha"+android:tint="?attr/colorControlNormal"/>
importjava.util.List;+importandroid.os.IPowerManager;///mh.mmi/*** Helper to show the global actions dialog. Each item is an {@link Action} that* may show depending on whether the keyguard is showing, and whether the device
@@ -93,6 +95,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac/* Valid settings for global actions keys.* see config.xml config_globalActionList */privatestaticfinalStringGLOBAL_ACTION_KEY_POWER="power";+privatestaticfinalStringGLOBAL_ACTION_KEY_REBOOT="reboot";///mh.mmiprivatestaticfinalStringGLOBAL_ACTION_KEY_AIRPLANE="airplane";privatestaticfinalStringGLOBAL_ACTION_KEY_BUGREPORT="bugreport";privatestaticfinalStringGLOBAL_ACTION_KEY_SILENT="silent";
@@ -273,6+276,8 @@ classGlobalActionsimplementsDialogInterface.OnDismissListener,DialogInterfac}if(GLOBAL_ACTION_KEY_POWER.equals(actionKey)){mItems.add(newPowerAction());+}elseif(GLOBAL_ACTION_KEY_REBOOT.equals(actionKey)){///mh.mmi+ mItems.add(newRebootAction());}elseif(GLOBAL_ACTION_KEY_AIRPLANE.equals(actionKey)){mItems.add(mAirplaneModeOn);}elseif(GLOBAL_ACTION_KEY_BUGREPORT.equals(actionKey)){
@@ -366,6+371,37 @@ classGlobalActionsimplementsDialogInterface.OnDismissListener,DialogInterfacmWindowManagerFuncs.shutdown(false/* confirm */);}}++///mh.mmi start+privatefinalclassRebootActionextendsSinglePressAction{++privateRebootAction(){+super(com.android.internal.R.drawable.ic_lock_power_reboot,R.string.factorytest_reboot);+}++@Override+publicbooleanshowDuringKeyguard(){+returntrue;+}++@Override+publicbooleanshowBeforeProvisioning(){+returntrue;+}++@Override+publicvoidonPress(){+try{+IPowerManager pm =IPowerManager.Stub.asInterface(ServiceManager.getService(Context.POWER_SERVICE));+ pm.reboot(true,null,false);+}+catch(RemoteException e){+Log.e(TAG,"PowerManager service died!", e);+return;+}+}+}+///mh.endprivateActiongetBugReportAction(){returnnewSinglePressAction(com.android.internal.R.drawable.ic_lock_bugreport,