简体   繁体   中英

Add an application as trusted app store when building AOSP

I am building AOSP for myself to build a custom ROM. Can I specify a system application as trusted app store (like google play on regular phones) so that app will be able to install apps silently? (without showing confirmation dialog to user)

Where in the AOSP code could this happen?

If you're a system app, built within AOSP tree, just call installPackage directly:
http://androidxref.com/7.1.2_r36/xref/frameworks/base/core/java/android/content/pm/PackageManager.java#4790

Your app must request this permission:

 <uses-permission
        android:name="android.permission.INSTALL_PACKAGES"
        tools:ignore="ProtectedPermissions" />

Though based on the comment in code, this method is deprecated, might have gone away in newer versions of AOSP. Use the new implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM