Skip to content

Commit d866b75

Browse files
committed
add properties for target sdk wear
1 parent 8af3d11 commit d866b75

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

mode/src/processing/mode/android/AVD.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ public class AVD {
3838
final static private int WEAR = 1;
3939

4040
final static public String DEFAULT_ABI = "x86";
41-
42-
public static final String TARGET_SDK_ARM = "24";
43-
public static final String TARGET_SDK_WEAR = "30";
4441

4542
public final static String DEFAULT_PHONE_PORT = "5566";
4643
public final static String DEFAULT_WEAR_PORT = "5576";
@@ -102,11 +99,11 @@ static public String getTargetSDK(boolean wear, String abi) {
10299
// The ARM images using Google APIs are too slow, so use the
103100
// older Android (AOSP) images.
104101
// TODO check if we can move to the regular ARM images...
105-
return TARGET_SDK_ARM;
102+
return AndroidBuild.TARGET_WEAR_SDK_ARM;
106103
} else if (abi.equals("arm64-v8a")) {
107-
return wear ? TARGET_SDK_WEAR : AndroidBuild.TARGET_PLATFORM;
104+
return wear ? AndroidBuild.TARGET_WEAR_SDK : AndroidBuild.TARGET_SDK;
108105
} else { // x86
109-
return wear ? TARGET_SDK_WEAR : AndroidBuild.TARGET_PLATFORM;
106+
return wear ? AndroidBuild.TARGET_WEAR_SDK : AndroidBuild.TARGET_SDK;
110107
}
111108
}
112109

mode/src/processing/mode/android/AndroidBuild.java

+18-4
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ class AndroidBuild extends JavaBuild {
6767
static public String MIN_SDK_WATCHFACE;
6868

6969
// Versions of all required dependencies
70-
static public String TARGET_SDK;
71-
static public String TARGET_PLATFORM;
70+
static public String TARGET_SDK;
71+
static public String TARGET_WEAR_SDK_ARM;
72+
static public String TARGET_WEAR_SDK;
7273
static public String GRADLE_PLUGIN_VER;
7374
static public String APPCOMPAT_VER;
7475
static public String V4LEGACY_VER;
@@ -1024,8 +1025,21 @@ static public void initVersions(File file) {
10241025
TARGET_SDK = defTargetSDK;
10251026
Preferences.set("android.sdk.target", TARGET_SDK);
10261027
}
1027-
TARGET_PLATFORM = "android-" + TARGET_SDK;
1028-
1028+
1029+
TARGET_WEAR_SDK_ARM = Preferences.get("android.sdk.target.wear_arm");
1030+
String defTargetWearSDKArm = props.getProperty("android-platform-wear-arm");
1031+
if (TARGET_WEAR_SDK_ARM == null || PApplet.parseInt(TARGET_WEAR_SDK_ARM) != PApplet.parseInt(defTargetWearSDKArm)) {
1032+
TARGET_WEAR_SDK_ARM = defTargetWearSDKArm;
1033+
Preferences.set("android.sdk.target.wear_arm", TARGET_WEAR_SDK_ARM);
1034+
}
1035+
1036+
TARGET_WEAR_SDK = Preferences.get("android.sdk.target.wear");
1037+
String defTargetWearSDK = props.getProperty("android-platform-wear");
1038+
if (TARGET_WEAR_SDK == null || PApplet.parseInt(TARGET_WEAR_SDK) != PApplet.parseInt(defTargetWearSDK)) {
1039+
TARGET_WEAR_SDK = defTargetWearSDK;
1040+
Preferences.set("android.sdk.target.wear", TARGET_WEAR_SDK);
1041+
}
1042+
10291043
APPCOMPAT_VER = Preferences.get("android.sdk.appcompat");
10301044
String defAppCompatVer = props.getProperty("androidx.appcompat%appcompat");
10311045
if (APPCOMPAT_VER == null || !versionCheck(APPCOMPAT_VER, defAppCompatVer)) {

mode/version.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Basics
22
android-platform = 33
3+
android-platform-wear = 30
4+
android-platform-wear-arm = 24
35
android-toolslib = 30.3.0
46
android-gradle-plugin = 7.1.0
57
gradle-wrapper = 7.4.2

0 commit comments

Comments
 (0)