fix early launch of services before car service launch
- Both launched earler before car servcie launch and doing nothing useful.
- set boot.car_service_created after service is registered: Otherwise
initial check can just fail.
Bug: 124535282
Test: Check launch of both services
Change-Id: I822485c5f97b0c521d7d6968d163cfff9d340729
diff --git a/procfs-inspector/server/com.android.car.procfsinspector.rc b/procfs-inspector/server/com.android.car.procfsinspector.rc
index 7faaf69..f069ee1 100644
--- a/procfs-inspector/server/com.android.car.procfsinspector.rc
+++ b/procfs-inspector/server/com.android.car.procfsinspector.rc
@@ -2,6 +2,7 @@
class core
user nobody
group readproc
+ disabled
-on boot && property:boot.car_service_created=1
+on property:boot.car_service_created=1
start com.android.car.procfsinspector
diff --git a/service/src/com/android/car/CarService.java b/service/src/com/android/car/CarService.java
index 47d3137..509ecdd 100644
--- a/service/src/com/android/car/CarService.java
+++ b/service/src/com/android/car/CarService.java
@@ -21,9 +21,7 @@
import android.annotation.Nullable;
import android.app.Service;
import android.content.Intent;
-import android.content.pm.PackageManager;
import android.hardware.automotive.vehicle.V2_0.IVehicle;
-import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import android.os.IHwBinder.DeathRecipient;
@@ -34,7 +32,6 @@
import android.util.Log;
import com.android.car.systeminterface.SystemInterface;
-
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.RingBufferIndices;
@@ -95,11 +92,11 @@
mCanBusErrorNotifier,
mVehicleInterfaceName);
mICarImpl.init();
- SystemProperties.set("boot.car_service_created", "1");
linkToDeath(mVehicle, mVehicleDeathRecipient);
ServiceManager.addService("car_service", mICarImpl);
+ SystemProperties.set("boot.car_service_created", "1");
super.onCreate();
}
diff --git a/tests/PowerTestService/com.android.car.powertestservice.rc b/tests/PowerTestService/com.android.car.powertestservice.rc
index db27237..117da7e 100644
--- a/tests/PowerTestService/com.android.car.powertestservice.rc
+++ b/tests/PowerTestService/com.android.car.powertestservice.rc
@@ -16,6 +16,7 @@
class core
user system
group system
+ disabled
-on boot && property:boot.car_service_created=1
+on property:boot.car_service_created=1
start com.android.car.powertestservice