summaryrefslogtreecommitdiff
path: root/java/sdk.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/sdk.go')
-rw-r--r--java/sdk.go31
1 files changed, 27 insertions, 4 deletions
diff --git a/java/sdk.go b/java/sdk.go
index 90b8fac28..6ffe399fb 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -38,17 +38,20 @@ var sdkFrameworkAidlPathKey = android.NewOnceKey("sdkFrameworkAidlPathKey")
var apiFingerprintPathKey = android.NewOnceKey("apiFingerprintPathKey")
type sdkContext interface {
- // sdkVersion eturns the sdk_version property of the current module, or an empty string if it is not set.
+ // sdkVersion returns the sdk_version property of the current module, or an empty string if it is not set.
sdkVersion() string
// minSdkVersion returns the min_sdk_version property of the current module, or sdkVersion() if it is not set.
minSdkVersion() string
// targetSdkVersion returns the target_sdk_version property of the current module, or sdkVersion() if it is not set.
targetSdkVersion() string
+
+ // Temporarily provide access to the no_frameworks_libs property (where present).
+ noFrameworkLibs() bool
}
func sdkVersionOrDefault(ctx android.BaseModuleContext, v string) string {
switch v {
- case "", "current", "system_current", "test_current", "core_current":
+ case "", "none", "current", "test_current", "system_current", "core_current", "core_platform":
return ctx.Config().DefaultAppTargetSdk()
default:
return v
@@ -59,7 +62,7 @@ func sdkVersionOrDefault(ctx android.BaseModuleContext, v string) string {
// it returns android.FutureApiLevel (10000).
func sdkVersionToNumber(ctx android.BaseModuleContext, v string) (int, error) {
switch v {
- case "", "current", "test_current", "system_current", "core_current":
+ case "", "none", "current", "test_current", "system_current", "core_current", "core_platform":
return ctx.Config().DefaultAppTargetSdkInt(), nil
default:
n := android.GetNumericSdkVersion(v)
@@ -138,6 +141,9 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
useFiles: true,
jars: android.Paths{jarPath.Path(), lambdaStubsPath},
aidl: android.OptionalPathForPath(aidlPath.Path()),
+
+ // Pass value straight through for now to match previous behavior.
+ noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
}
@@ -148,6 +154,9 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
systemModules: m + "_system_modules",
frameworkResModule: r,
aidl: android.OptionalPathForPath(aidl),
+
+ // Pass value straight through for now to match previous behavior.
+ noFrameworksLibs: sdkContext.noFrameworkLibs(),
}
if m == "core.current.stubs" {
@@ -173,7 +182,8 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
}
}
- if ctx.Config().UnbundledBuildUsePrebuiltSdks() && v != "" {
+ if ctx.Config().UnbundledBuildUsePrebuiltSdks() &&
+ v != "" && v != "none" && v != "core_platform" {
return toPrebuilt(v)
}
@@ -182,6 +192,19 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
return sdkDep{
useDefaultLibs: true,
frameworkResModule: "framework-res",
+
+ // Pass value straight through for now to match previous behavior.
+ noFrameworksLibs: sdkContext.noFrameworkLibs(),
+ }
+ case "none":
+ return sdkDep{
+ noStandardLibs: true,
+ }
+ case "core_platform":
+ return sdkDep{
+ useDefaultLibs: true,
+ frameworkResModule: "framework-res",
+ noFrameworksLibs: true,
}
case "current":
return toModule("android_stubs_current", "framework-res", sdkFrameworkAidlPath(ctx))