In Android 4.x, it was enough to add the APK file to / system / priv-app, and the package manager found out that the new file and (not) installed the corresponding application or service.
With Android L, it seems not enough to just put the file in this directory - a system reboot is required to make Android recognize this change.
Does anyone have an idea how to get around this? Maybe with any setprop ctl.restart xxx or by killing a dedicated service?
EDIT:
Here are some logs from logcat:
1. Transfer the APK from / to the system / to the system / priv-app (= installation)
su mount -o remount rw /system cd /system/priv-app mv ../AARSCService.apk . // move from /system to /system/priv-app W/mv ( 3268): type=1400 audit(0.0:53): avc: denied { rename } for name="AARSCService.apk" dev="mmcblk0p22" ino=23041 scontext=u:r:init:s0 tcontext=u:object_r:system_file:s0 tclass=file
(but the HAS file was moved as the current root implementation for the Nexus 7 Android Android L P2 disables SELinux for root commands!)
-> APK NOT downloaded and not listed in the application list β NOT as expected, the APK will be automatically installed after installation in the priv-app folder on Android 4.4.
2. Reboot the device using the APK inside / system / priv -app
reboot I/PackageManager( 567): /system/priv-app/AARSCService.apk changed; collecting certs
-> APK IS loaded and listed in the application list β as expected
3. Move the APK from / system / priv -app to / system (= deinstallation)
su mount -o remount rw /system cd /system/priv-app mv AARSCService.apk .. // move from /system/priv-app to /system W/mv ( 3189): type=1400 audit(0.0:31): avc: denied { rename } for name="AARSCService.apk" dev="mmcblk0p22" ino=23041 scontext=u:r:init:s0 tcontext=u:object_r:system_file:s0 tclass=file
(but the HAS file was moved as the current root implementation for the Nexus 7 Android Android L P2 disables SELinux for root commands!)
-> The APK is still loading and displayed inside the list of applications, the service inside the application can still be associated with another application β NOT, as expected, the APK will be automatically deleted after removal from the priv-app folder on Android 4.4.
4. Reboot the device with APK NOT inside / system / priv-app
reboot W/PackageManager( 570): System package eu.airaudio.aarscservice no longer exists; wiping its data
-> APK no longer loads and no longer appears in the application list β as expected
EDIT 2:
There is also behavior on the incorrect Android L (21) emulator - of course, without SELinux warning. But the APK is also just (un-) installed after a reboot (= kill zygote).