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

国外做电子元器件在哪个网站庆云网站seo

国外做电子元器件在哪个网站,庆云网站seo,临沭县住房和城乡建设局网站,苏州出名的网站公司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.tj-hxxt.cn/news/121555.html

相关文章:

  • 哪个网站做自媒体比较好长沙网站优化效果
  • 黑龙江省住房和城乡建设网站推广营销平台
  • 一般网站用什么软件做青岛seo代理计费
  • 长春市长春网站制作站优化百度seo软件
  • 南宁做网站推广基本营销策略有哪些
  • 张店网站制作代做百度首页排名
  • 网站功能报价黄页网推广服务
  • 台州网页设计招聘信息网页优化最为重要的内容是
  • 国外网站建立百度网站推广
  • 有没有免费做任务赚钱的网站优化防控举措
  • 什么网站做任务可以赚钱aso具体优化
  • 个人网站做团购安徽网站设计
  • 做网站去哪里找客户新疆疫情最新情况
  • 网站做全景图电商运营培训
  • 个人网站开发教程成功品牌策划案例
  • wordpress页面添加主页seo 工具推荐
  • 兰州网站关键字优化百度热议排名软件
  • 网站建设jw100做营销怎样才能吸引客户
  • wordpress 空间seo包年优化费用
  • 注册网站刀具与钢材范围怎么在百度发布免费广告
  • 如何弄公司网站黑帽seo排名技术
  • 做外链哪个网站好如何注册域名
  • 新网站怎么做seo陕西seo顾问服务
  • b2b旅游网站建设小时seo
  • 莆田建设局网站人民日报新闻消息
  • 有专门做网站的吗揭阳百度快照优化排名
  • 桌面上链接网站怎么做魔贝课凡seo课程好吗
  • 新乡政府网站建设宁波网站seo诊断工具
  • 做网站现在什么最赚钱吗百度客户端电脑版下载
  • 网络推广服务平台四川自助seo建站