我在具有Android源代码的设备上编码。在普通的Android设备上,当我长时间按电源按钮10秒时,设备重新启动了,但是在我的情况下,当我长时间按电源按钮10秒时,设备会关闭。您有一个想法吗
您去这里:
https://android.googlesource.com/platform/frameworks/base//7d276c3/policy/policy/src/src/com/android/android/internal/policy/policy/phophercle/phonewindowwindowmanager.java
private final Runnable mPowerLongPress = new Runnable() {
public void run() {
// The context isn't read
if (mLongPressOnPowerBehavior < 0) {
mLongPressOnPowerBehavior = mContext.getResources().getInteger(
com.android.internal.R.integer.config_longPressOnPowerBehavior);
}
switch (mLongPressOnPowerBehavior) {
case LONG_PRESS_POWER_NOTHING:
break;
case LONG_PRESS_POWER_GLOBAL_ACTIONS:
mPowerKeyHandled = true;
performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
showGlobalActionsDialog();
break;
case LONG_PRESS_POWER_SHUT_OFF:
mPowerKeyHandled = true;
performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
ShutdownThread.shutdown(mContext, true);
break;
}
}
};