1 I/CarAudioManager( 1599): reconnect service 1 E/AndroidRuntime( 2632): FATAL EXCEPTION: main 1 E/AndroidRuntime( 2632): Process: com.android.car, PID: 2632 1 E/AndroidRuntime( 2632): java.lang.RuntimeException: Unable to create service com.android.car.CarService: java.lang.IllegalStateException: Vehicle HAL service is not available. 1 E/AndroidRuntime( 2632): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3582) 1 E/AndroidRuntime( 2632): at android.app.ActivityThread.access$1300(ActivityThread.java:200) 1 E/AndroidRuntime( 2632): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1672) 1 E/AndroidRuntime( 2632): at android.os.Handler.dispatchMessage(Handler.java:106) 1 E/AndroidRuntime( 2632): at android.os.Looper.loop(Looper.java:193) 1 E/AndroidRuntime( 2632): at android.app.ActivityThread.main(ActivityThread.java:6718) 1 E/AndroidRuntime( 2632): at java.lang.reflect.Method.invoke(Native Method) 1 E/AndroidRuntime( 2632): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 1 E/AndroidRuntime( 2632): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 1 E/AndroidRuntime( 2632): Caused by: java.lang.IllegalStateException: Vehicle HAL service is not available. 1 E/AndroidRuntime( 2632): at com.android.car.CarService.onCreate(CarService.java:82) 1 E/AndroidRuntime( 2632): at android.app.ActivityThread.handleCreateService(ActivityThread.java:3570) 1 E/AndroidRuntime( 2632): ... 8 more
1 W/RescueParty( 765): Noticed 1 events for UID 0 in last 7 sec 1 W/RescueParty( 765): Noticed 1 events for UID 1000 in last 12 sec 1 W/RescueParty( 765): Noticed 2 events for UID 1000 in last 13 sec 1 W/RescueParty( 765): Noticed 3 events for UID 1000 in last 13 sec 1 W/RescueParty( 765): Noticed 4 events for UID 1000 in last 13 sec 1 W/RescueParty( 765): Noticed 5 events for UID 1000 in last 14 sec 1 W/RescueParty( 765): Attempting rescue level RESET_SETTINGS_UNTRUSTED_DEFAULTS 1 W/RescueParty( 765): Noticed 1 events for UID 1000 in last 14 sec 1 W/RescueParty( 765): Noticed 2 events for UID 1000 in last 14 sec 1 W/RescueParty( 765): Noticed 3 events for UID 1000 in last 14 sec 1 W/RescueParty( 765): Noticed 4 events for UID 1000 in last 14 sec 1 W/RescueParty( 765): Noticed 5 events for UID 1000 in last 14 sec 1 W/RescueParty( 765): Attempting rescue level RESET_SETTINGS_UNTRUSTED_CHANGES 1 W/RescueParty( 765): Noticed 1 events for UID 1000 in last 15 sec 1 W/RescueParty( 765): Noticed 2 events for UID 1000 in last 15 sec 1 W/RescueParty( 765): Noticed 3 events for UID 1000 in last 15 sec 1 W/RescueParty( 765): Noticed 4 events for UID 1000 in last 15 sec 1 W/RescueParty( 765): Noticed 5 events for UID 1000 in last 15 sec 1 W/RescueParty( 765): Attempting rescue level RESET_SETTINGS_TRUSTED_DEFAULTS 1 W/RescueParty( 765): Noticed 1 events for UID 1000 in last 15 sec 1 W/RescueParty( 765): Noticed 2 events for UID 1000 in last 16 sec 1 W/RescueParty( 765): Noticed 3 events for UID 1000 in last 16 sec 1 W/RescueParty( 765): Noticed 4 events for UID 1000 in last 16 sec 1 W/RescueParty( 765): Noticed 5 events for UID 1000 in last 16 sec 1 W/RescueParty( 765): Attempting rescue level FACTORY_RESET 1 I//system/bin/uncrypt( 2649): --reason=RescueParty
publicBootThreshold(){ // We're interested in 5 events in any 300 second period; this // window is super relaxed because booting can take a long time if // forced to dexopt things. // 5代表5次,300代表300s super(android.os.Process.ROOT_UID, 5, 300 * DateUtils.SECOND_IN_MILLIS); }
publicAppThreshold(int uid){ // We're interested in 5 events in any 30 second period; apps crash // pretty quickly so we can keep a tight leash on them. // 5代表5次,30代表30s super(uid, 5, 30 * DateUtils.SECOND_IN_MILLIS); }
// If a persistent app is stuck in a crash loop, the device isn't very // usable, so we want to consider sending out a rescue party. if (r != null && r.persistent) { RescueParty.notePersistentAppCrash(mContext, r.uid); }
1 2 3 4 5 6 7 8 9
// SystemServer.java // 当SystemServer启动的时候,调用救援服务做一个标记 privatevoidstartBootstrapServices(){ ..... // Now that we have the bare essentials of the OS up and running, take // note that we just booted, which might send out a rescue party if // we're stuck in a runtime restart loop. RescueParty.noteBoot(mSystemContext); }
publicstaticvoidnoteBoot(Context context){ if (isDisabled()) return; // incrementAndTest()判断是否需要提升救援级别。如果在上诉的时间内启动达到5次就提升救援级别 if (sBoot.incrementAndTest()) { sBoot.reset(); //提升救援级别 incrementRescueLevel(sBoot.uid); // 执行救援级别,当达到4级就恢复出厂设置 executeRescueLevel(context); } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14
publicstaticvoidnotePersistentAppCrash(Context context, int uid){ if (isDisabled()) return; Threshold t = sApps.get(uid); if (t == null) { t = new AppThreshold(uid); sApps.put(uid, t); } // 无论app还是systemserver都会调到这里面去。 if (t.incrementAndTest()) { t.reset(); incrementRescueLevel(t.uid); executeRescueLevel(context); } }