当前位置: 首页 > news >正文

网站备案和实名认证自己做的网站百度收索不到

网站备案和实名认证,自己做的网站百度收索不到,昌平网站制作公司,2022中国企业排行榜1、讲在最前面 系统rom定制开发中,其中在低电量时,系统会自动关机,这个和不同的平台和底层驱动和硬件都有关系,需要结合这些来实际调整这个值,我们可以通过分析源码中电池服务的代码,然后进行修改如何实现…

1、讲在最前面

系统rom定制开发中,其中在低电量时,系统会自动关机,这个和不同的平台和底层驱动和硬件都有关系,需要结合这些来实际调整这个值,我们可以通过分析源码中电池服务的代码,然后进行修改如何实现这个功能。

2、系统中framework修改低电量关机值的核心类

frameworks\base\services\core\java\com\android\server\BatteryService.java
    private final class HealthHalCallback extends IHealthInfoCallback.Stubimplements HealthServiceWrapper.Callback {@Override public void healthInfoChanged(android.hardware.health.V2_0.HealthInfo props) {BatteryService.this.update(props);}private void update(android.hardware.health.V2_0.HealthInfo info) {traceBegin("HealthInfoUpdate");Trace.traceCounter(Trace.TRACE_TAG_POWER, "BatteryChargeCounter",info.legacy.batteryChargeCounter);Trace.traceCounter(Trace.TRACE_TAG_POWER, "BatteryCurrent",info.legacy.batteryCurrent);synchronized (mLock) {mRealBatteryLevel = info.legacy.batteryLevel;if (!mUpdatesStopped) {mHealthInfo = info.legacy;// Process the new values.processValuesLocked(false);mLock.notifyAll(); // for any waiters on new info} else {copy(mLastHealthInfo, info.legacy);}}traceEnd();}private void processValuesLocked(boolean force) {boolean logOutlier = false;long dischargeDuration = 0;mBatteryLevelCritical =mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN&& mHealthInfo.batteryLevel <= mCriticalBatteryLevel;if (mHealthInfo.chargerAcOnline) {mPlugType = BatteryManager.BATTERY_PLUGGED_AC;} else if (mHealthInfo.chargerUsbOnline) {mPlugType = BatteryManager.BATTERY_PLUGGED_USB;} else if (mHealthInfo.chargerWirelessOnline) {mPlugType = BatteryManager.BATTERY_PLUGGED_WIRELESS;} else {mPlugType = BATTERY_PLUGGED_NONE;}if (DEBUG) {Slog.d(TAG, "Processing new values: "+ "info=" + mHealthInfo+ ", mBatteryLevelCritical=" + mBatteryLevelCritical+ ", mPlugType=" + mPlugType);}// Let the battery stats keep track of the current level.try {mBatteryStats.setBatteryState(mHealthInfo.batteryStatus, mHealthInfo.batteryHealth,mPlugType, mHealthInfo.batteryLevel, mHealthInfo.batteryTemperature,mHealthInfo.batteryVoltage, mHealthInfo.batteryChargeCounter,mHealthInfo.batteryFullCharge);} catch (RemoteException e) {// Should never happen.}...
}private void shutdownIfNoPowerLocked() {// shut down gracefully if our battery is critically low and we are not powered.// wait until the system has booted before attempting to display the shutdown dialog.if (shouldShutdownLocked()) {/*SPRD : add power debug log start*/Slog.d(TAG, "Low battery shutdown, batteryLevel : " + mHealthInfo.batteryLevel);/*SPRD : add power debug log end*/mHandler.post(new Runnable() {@Overridepublic void run() {if (mActivityManagerInternal.isSystemReady()) {Intent intent = new Intent(Intent.ACTION_REQUEST_SHUTDOWN);intent.putExtra(Intent.EXTRA_KEY_CONFIRM, false);intent.putExtra(Intent.EXTRA_REASON,PowerManager.SHUTDOWN_LOW_BATTERY);intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);mContext.startActivityAsUser(intent, UserHandle.CURRENT);}}});}}private boolean shouldShutdownLocked() {if (mHealthInfo.batteryLevel > 0) {return false;}// Battery-less devices should not shutdown.if (!mHealthInfo.batteryPresent) {return false;}// add for bug#1021541boolean checkPlugState = (mUpdatesStopped && mHealthInfo.batteryLevel == mSetBatteryLevel&& mSetBatteryLevel != mRealBatteryLevel);if (DEBUG) Slog.d(TAG, "shutdownIfNoPowerLocked: mUpdatesStopped: " + mUpdatesStopped+ " mHealthInfo.batteryLevel:"  + mHealthInfo.batteryLevel+ " mSetBatteryLevel:" + mSetBatteryLevel + " mRealBatteryLevel:" + mRealBatteryLevel);return !checkPlugState || mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_CHARGING;}private boolean shouldShutdownLocked() {
//add startif (mHealthInfo.batteryLevel <= 2) {return true;}//add endif (mHealthInfo.batteryLevel > 0) {return false;}// Battery-less devices should not shutdown.if (!mHealthInfo.batteryPresent) {return false;}// add for bug#1021541boolean checkPlugState = (mUpdatesStopped && mHealthInfo.batteryLevel == mSetBatteryLevel&& mSetBatteryLevel != mRealBatteryLevel);if (DEBUG) Slog.d(TAG, "shutdownIfNoPowerLocked: mUpdatesStopped: " + mUpdatesStopped+ " mHealthInfo.batteryLevel:"  + mHealthInfo.batteryLevel+ " mSetBatteryLevel:" + mSetBatteryLevel + " mRealBatteryLevel:" + mRealBatteryLevel);return !checkPlugState || mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_CHARGING;}

经过源码分析,如果满足shouldShutdownLocked(),如果满足关机执行 Intent.ACTION_REQUEST_SHUTDOWN
添加

   if (mHealthInfo.batteryLevel <= 2) {return true;}
http://www.yayakq.cn/news/137705/

相关文章:

  • 深圳有实力的网站建设服务商wordpress 上传大小
  • 关于拳馆网站建设计划书宁夏 网站制作
  • 蓝色 宽屏 网站 模板下载个人网站备案名字大全
  • 专业网站建设公司兴田德润简介现在用什么做网站
  • 济宁网站建设topasp.net+制作网站开发
  • 广告做图网站太原网页制作招聘网
  • 房产证查询系统官方网站绍兴做网站比较专业的公司
  • 找一个网站做优化分析用c 做网站和数据库方法
  • 专门做兼职的网站网站做推广有用吗
  • 广东建设厅网站查询聚通装潢口碑好不好
  • 威龙电子商务做的网站如何查询营业执照注册信息
  • 阳江房产网站企业网站建设安阳
  • 网站售后电商网站基本功能
  • 商城开发网站建设开发lnmp wordpress 登陆
  • 做关于什么内容的网站学校官网查询入口
  • 视频素材库网站下载2020互联网公司排名
  • 增加网站收录上海网站建设公司排行
  • 常熟做网站推广的vs2012建设网站
  • 云南网站开发公司介绍加强普法网站和普法网络集群建设
  • 惠州网站建设找惠州邦搜索引擎排名原理
  • 哪个网站可以找做软件兼职的中国招标信息公开网
  • 泰安网站建设流程宿迁市建设局网站维修基金
  • 电子商务网站设计实践报告做网站和app怎么跑业务
  • 做网站具体流程关闭wordpress注册邮件
  • ps里新建网站尺寸怎么做企业网站设计建设
  • 潍坊住房和城乡建设厅网站电话移动 开发 网站建设
  • 东莞公司企业设计网站建设wordpress 表单数据
  • 网站上传源码后怎么弄河南省二级建造师报名入口官网
  • wordpress pc站m站西安php网站建设
  • 竞价网站做推广方案网站怎么优化呢