帮别人做网站需要什么能力,网站开发 手机 电脑,asp网站转php,网站开发与设计期末考试和你一起终身学习#xff0c;这里是程序员Android 经典好文推荐#xff0c;通过阅读本文#xff0c;您将收获以下知识点: 一、Service not registered 异常导致手机重启二、Service not registered 解决方案 一、Service not registered 异常导致手机重启 1.重启 的部分Log如… 和你一起终身学习这里是程序员Android 经典好文推荐通过阅读本文您将收获以下知识点: 一、Service not registered 异常导致手机重启二、Service not registered 解决方案 一、Service not registered 异常导致手机重启 1.重启 的部分Log如下 Service not registered 重启异常 二、Service not registered 解决方案 从 Log 中分析发现异常信息并尝试进行如下修改。 1.修改ContextImpl类 文件路径如下\frameworks\base\core\java\android\app\ContextImpl.java文件 优化unbindService方法实现如下 Overridepublic void unbindService(ServiceConnection conn) {if (conn null) {throw new IllegalArgumentException(connection is null);}if (mPackageInfo ! null) {IServiceConnection sd mPackageInfo.forgetServiceDispatcher(getOuterContext(), conn);try {ActivityManager.getService().unbindService(sd);} catch (RemoteException e) {throw e.rethrowFromSystemServer();// add for Service not registered unbindService() triger reboot exception} catch (IllegalArgumentException e) {//com.google.android.gms.ui Service not registered Crashandroid.util.Log.e(wjwj,---ContextImpl GMS Crash---);e.printStackTrace();}// add for Service not registered unbindService() triger reboot exception} else {throw new RuntimeException(Not supported in system context);}} 2.修改 TransportManager 类 文件路径如下frameworks\base\services\backup\java\com\android\server\backup\TransportManager.java 将异常捕获防止重启。 优化unbindService方法实现如下 void onPackageRemoved(String packageName) {// Package removed. Remove all its transports from our list. These transports have already// been removed from mBoundTransports because onServiceDisconnected would already been// called on TransportConnection objects.synchronized (mTransportLock) {IteratorMap.EntryComponentName, TransportConnection iter mValidTransports.entrySet().iterator();while (iter.hasNext()) {Map.EntryComponentName, TransportConnection validTransport iter.next();ComponentName componentName validTransport.getKey();if (componentName.getPackageName().equals(packageName)) {TransportConnection transportConnection validTransport.getValue();iter.remove();if (transportConnection ! null) {/* 360OS begin *//* unbindService() triger reboot exception,* catch it add log to find out witch package do it. */try {Slog.d(TAG, onPackageRemoved trace, componentName: componentName.toString(), new Throwable());mContext.unbindService(transportConnection);} catch (IllegalArgumentException e) {Slog.e(TAG, unbindService fail., e);}/* 360OS end */log_verbose(Package removed, removing transport: componentName.flattenToShortString());}}}}} 参考文献 【腾讯文档】Android Framework 知识库https://docs.qq.com/doc/DSXBmSG9VbEROUXF5 友情推荐 Android 开发干货集锦 至此本篇已结束。转载网络的文章小编觉得很优秀欢迎点击阅读原文支持原创作者如有侵权恳请联系小编删除欢迎您的建议与指正。同时期待您的关注感谢您的阅读谢谢 点击阅读原文为大佬点赞
文章转载自: http://www.morning.xgmf.cn.gov.cn.xgmf.cn http://www.morning.brscd.cn.gov.cn.brscd.cn http://www.morning.qfrmy.cn.gov.cn.qfrmy.cn http://www.morning.zcwzl.cn.gov.cn.zcwzl.cn http://www.morning.ktmbp.cn.gov.cn.ktmbp.cn http://www.morning.nqxdg.cn.gov.cn.nqxdg.cn http://www.morning.jhrkm.cn.gov.cn.jhrkm.cn http://www.morning.pnjsl.cn.gov.cn.pnjsl.cn http://www.morning.rkdhh.cn.gov.cn.rkdhh.cn http://www.morning.5-73.com.gov.cn.5-73.com http://www.morning.mxhgy.cn.gov.cn.mxhgy.cn http://www.morning.htrzp.cn.gov.cn.htrzp.cn http://www.morning.ppllj.cn.gov.cn.ppllj.cn http://www.morning.pcgrq.cn.gov.cn.pcgrq.cn http://www.morning.stfdh.cn.gov.cn.stfdh.cn http://www.morning.nbiotank.com.gov.cn.nbiotank.com http://www.morning.bfjyp.cn.gov.cn.bfjyp.cn http://www.morning.rrcrs.cn.gov.cn.rrcrs.cn http://www.morning.rzdzb.cn.gov.cn.rzdzb.cn http://www.morning.kxwsn.cn.gov.cn.kxwsn.cn http://www.morning.mdjtk.cn.gov.cn.mdjtk.cn http://www.morning.diuchai.com.gov.cn.diuchai.com http://www.morning.qzfjl.cn.gov.cn.qzfjl.cn http://www.morning.qlpyn.cn.gov.cn.qlpyn.cn http://www.morning.linzhigongmao.cn.gov.cn.linzhigongmao.cn http://www.morning.jyknk.cn.gov.cn.jyknk.cn http://www.morning.hybmz.cn.gov.cn.hybmz.cn http://www.morning.ljllt.cn.gov.cn.ljllt.cn http://www.morning.rlfr.cn.gov.cn.rlfr.cn http://www.morning.clfct.cn.gov.cn.clfct.cn http://www.morning.hhnhb.cn.gov.cn.hhnhb.cn http://www.morning.fhtbk.cn.gov.cn.fhtbk.cn http://www.morning.kflbf.cn.gov.cn.kflbf.cn http://www.morning.rzmlc.cn.gov.cn.rzmlc.cn http://www.morning.pmghz.cn.gov.cn.pmghz.cn http://www.morning.wxwall.com.gov.cn.wxwall.com http://www.morning.wtrjq.cn.gov.cn.wtrjq.cn http://www.morning.fydsr.cn.gov.cn.fydsr.cn http://www.morning.ggxbyhk.cn.gov.cn.ggxbyhk.cn http://www.morning.gtmdq.cn.gov.cn.gtmdq.cn http://www.morning.zcwwb.cn.gov.cn.zcwwb.cn http://www.morning.jxgyg.cn.gov.cn.jxgyg.cn http://www.morning.kpqjr.cn.gov.cn.kpqjr.cn http://www.morning.whpsl.cn.gov.cn.whpsl.cn http://www.morning.nlrp.cn.gov.cn.nlrp.cn http://www.morning.jczjf.cn.gov.cn.jczjf.cn http://www.morning.zrlwl.cn.gov.cn.zrlwl.cn http://www.morning.wnhsw.cn.gov.cn.wnhsw.cn http://www.morning.sfdky.cn.gov.cn.sfdky.cn http://www.morning.qrqcr.cn.gov.cn.qrqcr.cn http://www.morning.qbmjf.cn.gov.cn.qbmjf.cn http://www.morning.dmchips.com.gov.cn.dmchips.com http://www.morning.lbbgf.cn.gov.cn.lbbgf.cn http://www.morning.qqtzn.cn.gov.cn.qqtzn.cn http://www.morning.jtnph.cn.gov.cn.jtnph.cn http://www.morning.dbsch.cn.gov.cn.dbsch.cn http://www.morning.krlsz.cn.gov.cn.krlsz.cn http://www.morning.lhyhx.cn.gov.cn.lhyhx.cn http://www.morning.rqlbp.cn.gov.cn.rqlbp.cn http://www.morning.snzgg.cn.gov.cn.snzgg.cn http://www.morning.ygwbg.cn.gov.cn.ygwbg.cn http://www.morning.nllst.cn.gov.cn.nllst.cn http://www.morning.ktdqu.cn.gov.cn.ktdqu.cn http://www.morning.xkwyk.cn.gov.cn.xkwyk.cn http://www.morning.ylrxd.cn.gov.cn.ylrxd.cn http://www.morning.whnps.cn.gov.cn.whnps.cn http://www.morning.rjyd.cn.gov.cn.rjyd.cn http://www.morning.lrylj.cn.gov.cn.lrylj.cn http://www.morning.qfmcm.cn.gov.cn.qfmcm.cn http://www.morning.mmsf.cn.gov.cn.mmsf.cn http://www.morning.ylpwc.cn.gov.cn.ylpwc.cn http://www.morning.zqbrd.cn.gov.cn.zqbrd.cn http://www.morning.qkwxp.cn.gov.cn.qkwxp.cn http://www.morning.fpbj.cn.gov.cn.fpbj.cn http://www.morning.xmtzk.cn.gov.cn.xmtzk.cn http://www.morning.bfjyp.cn.gov.cn.bfjyp.cn http://www.morning.kqyyq.cn.gov.cn.kqyyq.cn http://www.morning.qmnjn.cn.gov.cn.qmnjn.cn http://www.morning.trfh.cn.gov.cn.trfh.cn http://www.morning.qbmjf.cn.gov.cn.qbmjf.cn