当前位置: 首页 > 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://www.yayakq.cn/news/492017/

相关文章:

  • 丽江古城区建设局网站wordpress超链接无下划线
  • 某某公司电子商务网站建设与维护wordpress模板下载失败
  • 做企业网站通常哪找素材精准大数据营销公司
  • 福州做网站价格淮北论坛最新招聘
  • 衡水网站建设电话花西子网络营销案例分析
  • 欧美网站源码外国永久网站
  • 千图网网站怎么做seo关键词排名优化价格
  • 郑州门户网站建设哪家好石家庄的电商网站建设
  • 网站开发与设计实训wordpress工作室模版
  • app 与网站贵金属如何用网站开发客户
  • 七牛做网站网站怎么做分类聚合
  • 网站建设需要收集资料吗style wordpress
  • 网站域名申请费用现在网站一般都是什么语言做的
  • 江门网站建设运营团队WordPress用户发表插件
  • wordpress ie6 内核贴心的网站优化公司
  • seo排名网站 优帮云免费发布产品信息网站
  • 怎样看一个网站的信息吗app官网网站建设
  • 网站建设与管理题库福州网站建设效果
  • 网站图片等比缩小十堰做网站的有哪些
  • 网站开发技术报告模板网站建设毅文科技
  • 网站设计规划报告在别人网站挂黑链
  • 潍坊网站建设教程做一个网站和手机软件多少钱
  • 哪些网站适合推广郑州厉害的seo顾问
  • 网站怎么做seo关键词天津和平做网站哪家好
  • 重庆整站seo襄阳seo优化排名
  • 绑定网站一个网站有几个域名
  • 如何建自己的网站网页搜索图片
  • 网站建设站点标题在什么位置关键词优化排名工具
  • 深圳公司注销流程seo智能优化系统
  • 哈尔滨自助建站平台网页开发需要多少钱