android 屏蔽锁屏,安卓系统禁止锁屏
修改系统设置默认值:platform/frameworks/base/packages/SettingsProvider/res/values/defaults.xml,将其中的:falsefalse这两项的值都改为 true:truetrue修改 platform/frameworks/base/services/core/java/com/android/server/power/PowerM
修改系统设置默认值:platform/frameworks/base/packages/SettingsProvider/res/values/defaults.xml,将其中的:
false
false
这两项的值都改为 true:
true
true
修改 platform/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java 中
private void updateStayOnLocked(int dirty) {
if ((dirty & (DIRTY_BATTERY_STATE | DIRTY_SETTINGS)) != 0) {
final boolean wasStayOn = mStayOn;
if (mStayOnWhilePluggedInSetting != 0
&& !isMaximumScreenOffTimeoutFromDeviceAdminEnforcedLocked()) {
mStayOn = mBatteryManagerInternal.isPowered(mStayOnWhilePluggedInSetting);
} else {
mStayOn = false;
}
if (mStayOn != wasStayOn) {
mDirty |= DIRTY_STAY_ON;
}
}
}
改为:
private void updateStayOnLocked(int dirty) {
if ((dirty & (DIRTY_BATTERY_STATE | DIRTY_SETTINGS)) != 0) {
final boolean wasStayOn = mStayOn;
if (mStayOnWhilePluggedInSetting != 0
&& !isMaximumScreenOffTimeoutFromDeviceAdminEnforcedLocked()) {
mStayOn = mBatteryManagerInternal.isPowered(mStayOnWhilePluggedInSetting);
} else {
mStayOn = false;
}
mStayOn = true;
if (mStayOn != wasStayOn) {
mDirty |= DIRTY_STAY_ON;
}
}
}
更多推荐
所有评论(0)