Accessing Androids UpdateEngine (or other SystemApi classes) from application code

Viewed 2027

I'm trying to write a system-updater application, which uses the UpdateEngine of Android 7+. However, I can't seem to get access to it from my java code, since the class and its methods are marked with @SystemApi.

I integrated my application into the AOSP tree, but I can't start a successful compile from my application directory: When i run mm in the app dir, I directly get the following error:

The import android.os.UpdateEngine cannot be resolved

This also happens if I just add the import statement to an already existing aosp system-app, e.g.

What is the correct way to use UpdateEngine (or actually any other @SystemApi) from an application? I don't want to change the android api by removing all the SystemApi and break compatibility.

1 Answers
Related