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

坪山网站建设效果网页与网站设计

坪山网站建设效果,网页与网站设计,婚纱摄影网站模版整站源码,利辛做网站1、讲在最前面 系统rom定制开发中#xff0c;其中在低电量时#xff0c;系统会自动关机#xff0c;这个和不同的平台和底层驱动和硬件都有关系#xff0c;需要结合这些来实际调整这个值#xff0c;我们可以通过分析源码中电池服务的代码#xff0c;然后进行修改如何实现…1、讲在最前面 系统rom定制开发中其中在低电量时系统会自动关机这个和不同的平台和底层驱动和硬件都有关系需要结合这些来实际调整这个值我们可以通过分析源码中电池服务的代码然后进行修改如何实现这个功能。 2、系统中framework修改低电量关机值的核心类 frameworks\base\services\core\java\com\android\server\BatteryService.javaprivate 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.w-s-a.com/news/835288/

相关文章:

  • 用手机建网站微信手机网站流程
  • 专注软件优化分享的网站梧州网页设计
  • 长春火车站和高铁站是一个站吗公司名称注册查询系统
  • 便利的集团网站建设网页的依托网站
  • 茶叶网站建设题库制作助手app
  • 网站建设栏目层级北京网站搭建公司电话
  • 网站开发运营经理打开百度竞价页面是网站是什么
  • 国内最专业的设计网站建设现在用什么语言做网站
  • 湖南网站开发 岚鸿象山县建设工程招投标网站
  • 长沙免费网站排名wordpress 教学
  • 专门做app的网站html代码是什么
  • 临沂网站制作建设欧米茄表官网
  • 北京模板网站开发全包网站建设的第三方平台
  • 在凡科做的网站怎么推广网页模板下载 免费 html
  • 有关网站建设的标题仿亿欧网wordpress
  • 网站建设公司销售招聘常用的搜索引擎有哪些?
  • wordpress中.htaccess新上线的网站怎么做优化
  • 家教网站怎么做网站建设品牌推荐
  • 青岛做外贸网站建设茶叶公司网站建设策划书
  • 个人电脑做网站主机三合一网站
  • 用html框架做网站怎么在.Net中做团购网站
  • 怎样建一个自己公司的网站制作网站需要钱吗
  • 联盟网站制作wap网站制作公司
  • 美丽乡村建设发展论坛网站wordpress 仿站 教程网
  • 浙江省建设注册管理中心网站首页优设设计网站导航
  • 台州小型网站建设国内免费的建网站平台
  • 自己做网站不推广网站建设工作室发展
  • 有女人和马做网站吗宁波seo优势
  • 网站做用户记录表电商运营推广计划方案
  • 网站备案认领杭州网页设计公司招聘