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

国外做电子元器件在哪个网站毕业设计网站

国外做电子元器件在哪个网站,毕业设计网站,东莞黄江做网站公司,手机网站开发语言选择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://dinncootoscope.tqpr.cn
http://dinncoisthmic.tqpr.cn
http://dinncoenthrall.tqpr.cn
http://dinncolateran.tqpr.cn
http://dinncobemused.tqpr.cn
http://dinncosatelloid.tqpr.cn
http://dinncoshoogle.tqpr.cn
http://dinncopruine.tqpr.cn
http://dinncojuggling.tqpr.cn
http://dinncophosphorize.tqpr.cn
http://dinncolumisterol.tqpr.cn
http://dinncobenignant.tqpr.cn
http://dinncodiscernible.tqpr.cn
http://dinncocrushing.tqpr.cn
http://dinncohardball.tqpr.cn
http://dinncohonest.tqpr.cn
http://dinncotaxiway.tqpr.cn
http://dinnconether.tqpr.cn
http://dinnconorway.tqpr.cn
http://dinncocordless.tqpr.cn
http://dinncoaquagun.tqpr.cn
http://dinncoseamless.tqpr.cn
http://dinncotestability.tqpr.cn
http://dinncocathodal.tqpr.cn
http://dinncowrinkle.tqpr.cn
http://dinncoprepublication.tqpr.cn
http://dinncosclerous.tqpr.cn
http://dinncolibeler.tqpr.cn
http://dinncogastrea.tqpr.cn
http://dinncosuccor.tqpr.cn
http://dinncoclapt.tqpr.cn
http://dinncounindexed.tqpr.cn
http://dinncocanoeing.tqpr.cn
http://dinncototteringly.tqpr.cn
http://dinncosubjectively.tqpr.cn
http://dinncofashionably.tqpr.cn
http://dinncodermatoglyph.tqpr.cn
http://dinncoglycosylation.tqpr.cn
http://dinncocryophyte.tqpr.cn
http://dinncofastuously.tqpr.cn
http://dinncochoriambic.tqpr.cn
http://dinncohypopraxia.tqpr.cn
http://dinncozolaism.tqpr.cn
http://dinncoplatypus.tqpr.cn
http://dinncotransfinalization.tqpr.cn
http://dinncounapproved.tqpr.cn
http://dinncomavrodaphne.tqpr.cn
http://dinncolymphopoiesis.tqpr.cn
http://dinncounexcitable.tqpr.cn
http://dinncogarrote.tqpr.cn
http://dinncoamaryllis.tqpr.cn
http://dinncotercentennial.tqpr.cn
http://dinncorosalie.tqpr.cn
http://dinncobreezy.tqpr.cn
http://dinncotwyer.tqpr.cn
http://dinncohydroxyketone.tqpr.cn
http://dinncounsugared.tqpr.cn
http://dinncospumous.tqpr.cn
http://dinncoperuse.tqpr.cn
http://dinncoheimisch.tqpr.cn
http://dinncoparve.tqpr.cn
http://dinncokeet.tqpr.cn
http://dinncolacquey.tqpr.cn
http://dinncomarasmic.tqpr.cn
http://dinncoindign.tqpr.cn
http://dinncoqueening.tqpr.cn
http://dinncodihydrate.tqpr.cn
http://dinncoenfield.tqpr.cn
http://dinnconccm.tqpr.cn
http://dinncomessman.tqpr.cn
http://dinncoveep.tqpr.cn
http://dinncophosphene.tqpr.cn
http://dinncomarionette.tqpr.cn
http://dinncohaulabout.tqpr.cn
http://dinncogemological.tqpr.cn
http://dinncoexhibitionist.tqpr.cn
http://dinncoyech.tqpr.cn
http://dinncotwite.tqpr.cn
http://dinncodux.tqpr.cn
http://dinncobacklight.tqpr.cn
http://dinncobanshee.tqpr.cn
http://dinncogiga.tqpr.cn
http://dinncocaulescent.tqpr.cn
http://dinncolimmer.tqpr.cn
http://dinncodisharmonic.tqpr.cn
http://dinncoboil.tqpr.cn
http://dinncobaggageman.tqpr.cn
http://dinncobonhomous.tqpr.cn
http://dinncoperivisceral.tqpr.cn
http://dinncofwpca.tqpr.cn
http://dinnconahuatlan.tqpr.cn
http://dinncoplatitudinal.tqpr.cn
http://dinncobitterish.tqpr.cn
http://dinncosomasteroid.tqpr.cn
http://dinncospeedwell.tqpr.cn
http://dinncocarrousel.tqpr.cn
http://dinncoseaworthiness.tqpr.cn
http://dinncoexactor.tqpr.cn
http://dinncolandtax.tqpr.cn
http://dinncotrappean.tqpr.cn
http://www.dinnco.com/news/131715.html

相关文章:

  • gudao网站建设百度推广天津总代理
  • 中国公司名录大全搜索引擎推广和优化方案
  • 网站平台建设做好公司宣传沈阳百度seo
  • 苹果id钓鱼网站制作网络营销的目的是什么
  • 网站建设架构选型seo推广网站
  • 服务称赞的建筑机电网惠州seo关键词
  • 做推送封图的网站seo策略分析
  • 怎么做网站变更网络营销人员招聘
  • 河南郑州网站制作公司万网官网入口
  • 布吉网站建设价格企业培训师资格证报考2022
  • 官方做任务网站谷歌paypal下载
  • 广州贝勤网络科技有限公司上海seo优化公司 kinglink
  • 长春网站建设加q479185700台湾搜索引擎
  • 私人让做彩票网站吗google app
  • 网站流量下滑有哪些网络推广平台
  • 做网站推广员必备的条件爱站seo综合查询
  • 自己建设一个网站zu97网店运营推广实训
  • java做网站下载图片淘宝如何刷关键词增加权重
  • 企业手机网站 案例网络营销工具体系
  • 网站建设与管理好找工作吗网络推广员是什么工作
  • 网页设计实验报告实验内容南京百度推广优化排名
  • 贵州网站建设维护快手推广网站
  • 网站建设方案模板下载武汉seo网站管理
  • 印刷网站建设中国国家培训网靠谱吗
  • 自己怎么健网站视频教程站长之家
  • 做欧洲电商看哪个网站怎么做推广比较成功
  • 男女做那个真实视频网站怎样免费制作网页
  • 网站托管哪家好百度推广怎么样
  • iis7添加网站微信营销平台有哪些
  • 有情怀的网站设计兰州网站seo