Expose SdkExtension in the system SDK

Also tweak the javadoc a little bit.

Bug: 137191822
Bug: 143937447
Test: treehugger
Change-Id: Iae1b025685344c2ffe4ed1089850b447c82a6b83
Merged-In: Iae1b025685344c2ffe4ed1089850b447c82a6b83
This commit is contained in:
Anton Hansson 2019-12-06 17:07:28 +00:00
parent 0b51af2540
commit b52bd1cbbe
3 changed files with 26 additions and 2 deletions

View File

@ -563,6 +563,7 @@ filegroup {
"core/java/android/annotation/Nullable.java",
"core/java/android/annotation/IntDef.java",
"core/java/android/annotation/IntRange.java",
"core/java/android/annotation/SystemApi.java",
"core/java/android/annotation/UnsupportedAppUsage.java",
"core/java/com/android/internal/annotations/GuardedBy.java",
"core/java/com/android/internal/annotations/VisibleForTesting.java",

View File

@ -17,13 +17,23 @@
package android.os.ext;
import android.annotation.IntDef;
import android.annotation.SystemApi;
import android.os.Build.VERSION_CODES;
import android.os.SystemProperties;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/** @hide */
/**
* Methods for interacting with the extension SDK.
*
* This class provides information about the extension SDK version present
* on this device. Use the {@link #getExtensionVersion(int) getExtension} to
* query for the extension version for the given SDK version.
* @hide
*/
@SystemApi
public class SdkExtensions {
private static final int R_EXTENSION_INT;
@ -31,11 +41,16 @@ public class SdkExtensions {
R_EXTENSION_INT = SystemProperties.getInt("persist.com.android.sdkext.sdk_info", 0);
}
/** Values suitable as parameters for {@link #getExtensionVersion(int)}. */
/**
* Values suitable as parameters for {@link #getExtensionVersion(int)}.
* @hide
*/
@IntDef(value = { VERSION_CODES.R })
@Retention(RetentionPolicy.SOURCE)
public @interface SdkVersion {}
private SdkExtensions() { }
/**
* Return the version of the extension to the given SDK.
*

View File

@ -6019,6 +6019,14 @@ package android.os {
}
package android.os.ext {
public class SdkExtensions {
method public static int getExtensionVersion(int);
}
}
package android.os.image {
public class DynamicSystemClient {