0

I am writing an application/service for a product that DOES NOT meet the requirements for PackageInstaller.SessionParams.setRequireUserAction, namely it's written specifically for a piece of hardware that only supports Android 7.1 (Nougat), which is API level 25. The intent is to allow the application to poll a web server, download and subsequently install an updated APK when necessary.

https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams#setRequireUserAction(int)

For installers that have been granted the REQUEST_INSTALL_PACKAGES permission, user action will not be required when all of the following conditions are met:

requireUserAction is set to USER_ACTION_NOT_REQUIRED. The app being installed targets:

API 29 or higher on Android S (API 31)

API 30 or higher on Android T (API 33)

API 31 or higher on Android U (API 34)

API 33 or higher on Android V (API 35)

The installer is:

  • The update owner of an existing version of the app (in other words, this install session is an app update) if the update ownership enforcement is enabled.

  • The installer of record of an existing version of the app (in other words, this install session is an app update) if the update ownership enforcement isn't enabled.

  • Updating itself.

The installer declares the UPDATE_PACKAGES_WITHOUT_USER_ACTION permission.

However, I'm wondering if I give this application elevated privileges, will it not require user action anymore?

I'm also tagging this with android-source since making this change requires us to allow-list the application, I believe. I could be mistaken, though.

Thanks for your help!

4
  • I would search for any admin documents for your specific device (assuming not consumer) for such a feature. You should clarify if you can build a custom ROM for the device and getting more specific about what you are looking for. If custom device, try it as device manufacturers change things. Commented Feb 12 at 1:09
  • I could be incorrect, but I believe assigning the package privilege/system level permissions does require us to build a custom ROM for the device. Commented Feb 12 at 6:00
  • Correct but manufacturer may have some SDK / adb setting but they would have to document it. Otherwise if MDM/EMM not available, you'll have to build custom ROM. Commented Feb 12 at 6:12
  • It depends on what you mean by "elevated privileges". A system app can install apps silently in the background. If you can give it system app permissions you can do this. That requires the hardware vendor to support you. Commented Apr 8 at 13:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.