add CarUserNoticeService
- The Service launches UserNoticeUI Service for following conditions:
cold boot, user switching, wake up from sleep.
- UI is set from config_userNoticeUiService CarService resource.
- The feature is disabled if CarService's resource string is empty.
- UI launching can be disabled by setting
CarSettings.Secure.KEY_ENABLE_INITIAL_NOTICE_SCREEN_TO_USER to 0.
- UI Service should implement IUserNoticeUI binder.
- Added dummy UI to Kitchensink for manual testing. It is intentionally
handling binder messages without classes generated from aidl so that it can
be implemented without adding public API.
- The dummy UI uses AlertDialog with TYPE_APPLICATION_OVERLAY window type to
show it above normal Activities.
- Target package specified will be auto-granted TYPE_SYSTEM_ALERT permission
through appops. Permission granting only works for TYPE_APPLICATION_OVERLAY.
UI using any higher priority window should resolve necessary permission by
itself.
Bug: 140875332
Bug: 140032243
Test: Test with added dummy UI and confirm that it shows up for mentioned
events.
adb reboot
user switching
suspend to ram and wakeup:
call once: adb shell setprop android.car.garagemodeduration 1
adb shell dumpsys car_service suspend
adb shell dumpsys car_service resume
Change-Id: I544d2c7fe2e821ee9794e49d00d35c5977912632
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index 475eeba..17d3e83 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -46,6 +46,7 @@
import com.android.car.pm.CarPackageManagerService;
import com.android.car.systeminterface.SystemInterface;
import com.android.car.trust.CarTrustedDeviceService;
+import com.android.car.user.CarUserNoticeService;
import com.android.car.user.CarUserService;
import com.android.car.vms.VmsBrokerService;
import com.android.car.vms.VmsClientManager;
@@ -95,6 +96,7 @@
private final CarUserManagerHelper mUserManagerHelper;
private final CarUserService mCarUserService;
private final CarOccupantZoneService mCarOccupantZoneService;
+ private final CarUserNoticeService mCarUserNoticeService;
private final VmsClientManager mVmsClientManager;
private final VmsBrokerService mVmsBrokerService;
private final VmsSubscriberService mVmsSubscriberService;
@@ -135,6 +137,7 @@
mSystemActivityMonitoringService = new SystemActivityMonitoringService(serviceContext);
mCarPowerManagementService = new CarPowerManagementService(mContext, mHal.getPowerHal(),
systemInterface, mUserManagerHelper);
+ mCarUserNoticeService = new CarUserNoticeService(serviceContext);
mCarPropertyService = new CarPropertyService(serviceContext, mHal.getPropertyHal());
mCarDrivingStateService = new CarDrivingStateService(serviceContext, mCarPropertyService);
mCarUXRestrictionsService = new CarUxRestrictionsManagerService(serviceContext,
@@ -194,6 +197,7 @@
allServices.add(mCarPackageManagerService);
allServices.add(mCarInputService);
allServices.add(mGarageModeService);
+ allServices.add(mCarUserNoticeService);
allServices.add(mAppFocusService);
allServices.add(mCarAudioService);
allServices.add(mCarNightService);