AMS-启动 persistent ACTION_PROBOOT_COMPLETED procsTokill

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/b1480521874/article/details/84108780
SystemServerAMSgoingCallbackstartBootstrapService()start()setSystemProcess()//install framework-res.apkstartOtherServices()installSystemProvider()//SettingsProvidersystemReady()deliverPreBootCompleted()removeProcessLocked//kill掉不为FLAG_SYSTEM的进程run()//goingCallback是Runnable类型startSystemUi()addAppLocked()//启动persistent进程startHomeActivityLocked()SystemServerAMSgoingCallback

persistent进程只要在tag Application增加一个android:persistent="true"即可。如果想在应用进程启动的同时想启动什么组件,在自定义Application中启动就可以了。

想接收PREBOOT_COMPLETED广播,需要appInfo.flags包含FLAG_SYSTEM,需要apk在System image中,即在apk在/system文件夹下。

startProcessLocked()过程对于非persistent进程必须等待mProcessesReady = true才会真正创建进程,否则进程放入mProcessesOnHold队列。

展开阅读全文

Persistent Bits

08-08

WhatNext Software creates sequence generators that they hope will produce fairly random sequences of 16-bit unsigned integers in the range 0-65535. In general a sequence is specified by integers A, B, C, and S, where 1 <= A < 32768, 0 <= B < 65536, 2 <= C < 65536, and 0 <= S < C. S is the first element (the seed) of the sequence, and each later element is generated from the previous element. If X is an element of the sequence, then the next element isnn(A * X + B) % Cnwhere '%' is the remainder or modulus operation. Although every element of the sequence will be a 16-bit unsigned integer less than 65536, the intermediate result A*X + B may be larger, so calculations should be done with a 32-bit int rather than a 16-bit short to ensure accurate results.nnSome values of the parameters produce better sequences than others. The most embarrassing sequences to WhatNext Software are ones that never change one or more bits. A bit that never changes throughout the sequence is persistent. Ideally, a sequence will have no persistent bits. Your job is to test a sequence and determine which bits are persistent.nnFor example, a particularly bad choice is A = 2, B = 5, C = 18, and S = 3. It produces the sequence 3, (2*3+5)%18 = 11, (2*11+5)%18 = 9, (2*9+5)%18 = 5, (2*5+5)%18 = 15, (2*15+5)%18 = 17, then (2*17+5)%18 = 3 again, and we're back at the beginning. So the sequence repeats the the same six values over and over:nnDecimal 16-Bit Binaryn3 0000000000000011n11 0000000000001011n9 0000000000001001n5 0000000000000101n15 0000000000001111n17 0000000000010001noverall 00000000000????1nThe last line of the table indicates which bit positions are always 0, always 1, or take on both values in the sequence. Note that 12 of the 16 bits are persistent. (Good random sequences will have no persistent bits, but the converse is not necessarily true. For example, the sequence defined by A = 1, B = 1, C = 64000, and S = 0 has no persistent bits, but it's also not random: it just counts from 0 to 63999 before repeating.) Note that a sequence does not need to return to the seed: with A = 2, B = 0, C = 16, and S = 2, the sequence goes 2, 4, 8, 0, 0, 0, ....nnInputnnThere are from one to sixteen datasets followed by a line containing only 0. Each dataset is a line containing decimal integer values for A, B, C, and S, separated by single blanks.nnOutputnnThere is one line of output for each data set, each containing 16 characters, either '1', '0', or '?' for each of the 16 bits in order, with the most significant bit first, with '1' indicating the corresponding bit is always 1, '0' meaning the corresponding bit is always 0, and '?' indicating the bit takes on values of both 0 and 1 in the sequence.nnSample Inputnn2 5 18 3n1 1 64000 0n2 0 16 2n256 85 32768 21845n1 4097 32776 248n0nSample Outputnn00000000000????1n????????????????n000000000000???0n0101010101010101n0???000011111???n 问答

启动persistent name server 的时候出现了如下的错误

01-08

com.ibm.ivj.control.node.ServerModelException: The specified Database driver cannot be found.rnThe Persistent Name Server cannot be started.rncom.ibm.ivj.control.node.ServerModelException: The specified Database driver cannot be found.rnThe Persistent Name Server cannot be started.rncom.ibm.ivj.control.node.ModelException: com.ibm.ejs.EJSException: ; nested exception is: rn java.lang.Throwable(java.lang.String)rn java.lang.Exception(java.lang.String)rn com.ibm.ivj.control.node.ModelException(java.lang.String)rn void com.ibm.ivj.control.node.CommonServerModel.cannotStartServer()rn void com.ibm.ivj.control.node.CommonServerModel$Communicator.run()rnrncom.ibm.ivj.control.node.ModelException: com.ibm.ejs.EJSException: ; nested exception is: rn java.lang.Throwable(java.lang.String)rn java.lang.Exception(java.lang.String)rn com.ibm.ivj.control.node.ModelException(java.lang.String)rn void com.ibm.ivj.control.node.CommonServerModel.cannotStartServer()rn void com.ibm.ivj.control.node.CommonServerModel$Communicator.run()rnrncom.ibm.ivj.control.node.ModelException: com.ibm.ejs.EJSException: ; nested exception is: rn java.lang.Throwable(java.lang.String)rn java.lang.Exception(java.lang.String)rn com.ibm.ivj.control.node.ModelException(java.lang.String)rn void com.ibm.ivj.control.node.CommonServerModel.cannotStartServer()rn void com.ibm.ivj.control.node.CommonServerModel$Communicator.run()rnrncom.ibm.ivj.control.node.ModelException: com.ibm.ejs.EJSException: ; nested exception is: rn java.lang.Throwable(java.lang.String)rn java.lang.Exception(java.lang.String)rn com.ibm.ivj.control.node.ModelException(java.lang.String)rn void com.ibm.ivj.control.node.CommonServerModel.cannotStartServer()rn void com.ibm.ivj.control.node.CommonServerModel$Communicator.run()rnrn 论坛

没有更多推荐了,返回首页