From 4d5f6bd9044e0e72bdc6a0eaab72af88e0f5e3be Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 2 Sep 2023 23:15:09 +0200 Subject: [PATCH] Move phenotype in own module --- play-services-api/build.gradle | 1 + .../gms/phenotype/ExperimentToken.java | 12 ----- play-services-clearcut/build.gradle | 4 +- play-services-phenotype/build.gradle | 44 +++++++++++++++++++ .../src/main/AndroidManifest.xml | 8 ++++ .../android/gms/phenotype/Configuration.java | 5 ++- .../gms/phenotype/ExperimentTokens.java | 5 ++- .../google/android/gms/phenotype/Flag.java | 7 ++- .../gms/phenotype/GenericDimension.java | 6 ++- play-services-vision-common/build.gradle | 4 +- settings.gradle | 1 + 11 files changed, 72 insertions(+), 25 deletions(-) delete mode 100644 play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentToken.java create mode 100644 play-services-phenotype/build.gradle create mode 100644 play-services-phenotype/src/main/AndroidManifest.xml rename {play-services-api => play-services-phenotype}/src/main/java/com/google/android/gms/phenotype/Configuration.java (67%) rename {play-services-api => play-services-phenotype}/src/main/java/com/google/android/gms/phenotype/ExperimentTokens.java (78%) rename {play-services-api => play-services-phenotype}/src/main/java/com/google/android/gms/phenotype/Flag.java (94%) rename {play-services-api => play-services-phenotype}/src/main/java/com/google/android/gms/phenotype/GenericDimension.java (58%) diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 6512e6204c..08fa064398 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -40,4 +40,5 @@ android { dependencies { api project(':play-services-base') + api project(':play-services-phenotype') } diff --git a/play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentToken.java b/play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentToken.java deleted file mode 100644 index 0d618f2f96..0000000000 --- a/play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentToken.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class ExperimentToken extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(ExperimentToken.class); -} diff --git a/play-services-clearcut/build.gradle b/play-services-clearcut/build.gradle index 282c0105de..1b2e7d8dcd 100644 --- a/play-services-clearcut/build.gradle +++ b/play-services-clearcut/build.gradle @@ -34,12 +34,10 @@ apply from: '../gradle/publish-android.gradle' description = 'microG implementation of play-services-clearcut' dependencies { - implementation project(':play-services-api') - // Dependencies from play-services-clearcut:17.0.0 api "androidx.core:core:1.0.0" api project(':play-services-base') api project(':play-services-basement') -// api project(':play-services-phenotype') + api project(':play-services-phenotype') api project(':play-services-tasks') } diff --git a/play-services-phenotype/build.gradle b/play-services-phenotype/build.gradle new file mode 100644 index 0000000000..c2dab9a8e2 --- /dev/null +++ b/play-services-phenotype/build.gradle @@ -0,0 +1,44 @@ +/* + * SPDX-FileCopyrightText: 2023 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.android.library' +apply plugin: 'maven-publish' +apply plugin: 'signing' + +dependencies { + // Dependencies from play-services-phenotype:17.0.0 + api "androidx.core:core:1.0.0" + api project(':play-services-base') + api project(':play-services-basement') + api project(':play-services-tasks') + + annotationProcessor project(':safe-parcel-processor') +} + +android { + namespace "com.google.android.gms.phenotype" + + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + buildFeatures { + aidl = true + } + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +apply from: '../gradle/publish-android.gradle' + +description = 'microG implementation of play-services-phenotype' diff --git a/play-services-phenotype/src/main/AndroidManifest.xml b/play-services-phenotype/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..3408ac9209 --- /dev/null +++ b/play-services-phenotype/src/main/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/play-services-api/src/main/java/com/google/android/gms/phenotype/Configuration.java b/play-services-phenotype/src/main/java/com/google/android/gms/phenotype/Configuration.java similarity index 67% rename from play-services-api/src/main/java/com/google/android/gms/phenotype/Configuration.java rename to play-services-phenotype/src/main/java/com/google/android/gms/phenotype/Configuration.java index 70b4d286e1..a9591500f8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/phenotype/Configuration.java +++ b/play-services-phenotype/src/main/java/com/google/android/gms/phenotype/Configuration.java @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-FileCopyrightText: 2020 microG Project Team * SPDX-License-Identifier: Apache-2.0 */ @@ -14,5 +14,6 @@ public class Configuration extends AutoSafeParcelable { public Flag[] flags; @Field(4) public String[] removeNames; - public static final Creator CREATOR = new AutoCreator<>(Configuration.class); + + public static final Creator CREATOR = findCreator(Configuration.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentTokens.java b/play-services-phenotype/src/main/java/com/google/android/gms/phenotype/ExperimentTokens.java similarity index 78% rename from play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentTokens.java rename to play-services-phenotype/src/main/java/com/google/android/gms/phenotype/ExperimentTokens.java index d3f858fec8..8cc08eea31 100644 --- a/play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentTokens.java +++ b/play-services-phenotype/src/main/java/com/google/android/gms/phenotype/ExperimentTokens.java @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-FileCopyrightText: 2020 microG Project Team * SPDX-License-Identifier: Apache-2.0 */ @@ -26,5 +26,6 @@ public class ExperimentTokens extends AutoSafeParcelable { public byte[][] directs; @Field(10) public int[] genericDimensions; - public static final Creator CREATOR = new AutoCreator<>(ExperimentTokens.class); + + public static final Creator CREATOR = findCreator(ExperimentTokens.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/phenotype/Flag.java b/play-services-phenotype/src/main/java/com/google/android/gms/phenotype/Flag.java similarity index 94% rename from play-services-api/src/main/java/com/google/android/gms/phenotype/Flag.java rename to play-services-phenotype/src/main/java/com/google/android/gms/phenotype/Flag.java index 4d0a03af7b..12aa845758 100644 --- a/play-services-api/src/main/java/com/google/android/gms/phenotype/Flag.java +++ b/play-services-phenotype/src/main/java/com/google/android/gms/phenotype/Flag.java @@ -1,12 +1,14 @@ /* - * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-FileCopyrightText: 2020 microG Project Team * SPDX-License-Identifier: Apache-2.0 */ package com.google.android.gms.phenotype; +import org.microg.gms.common.Hide; import org.microg.safeparcel.AutoSafeParcelable; +@Hide public class Flag extends AutoSafeParcelable { @Field(2) public String name; @@ -98,5 +100,6 @@ public byte[] getBytes() { public static final int DATA_TYPE_DOUBLE = 3; public static final int DATA_TYPE_STRING = 4; public static final int DATA_TYPE_BYTES = 5; - public static final Creator CREATOR = new AutoCreator<>(Flag.class); + + public static final Creator CREATOR = findCreator(Flag.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/phenotype/GenericDimension.java b/play-services-phenotype/src/main/java/com/google/android/gms/phenotype/GenericDimension.java similarity index 58% rename from play-services-api/src/main/java/com/google/android/gms/phenotype/GenericDimension.java rename to play-services-phenotype/src/main/java/com/google/android/gms/phenotype/GenericDimension.java index f10f83c0c0..f2aa1764bf 100644 --- a/play-services-api/src/main/java/com/google/android/gms/phenotype/GenericDimension.java +++ b/play-services-phenotype/src/main/java/com/google/android/gms/phenotype/GenericDimension.java @@ -1,17 +1,19 @@ /* - * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-FileCopyrightText: 2020 microG Project Team * SPDX-License-Identifier: Apache-2.0 */ package com.google.android.gms.phenotype; +import org.microg.gms.common.Hide; import org.microg.safeparcel.AutoSafeParcelable; +@Hide public class GenericDimension extends AutoSafeParcelable { @Field(1) public int a; @Field(2) public int b; - public static final Creator CREATOR = new AutoCreator<>(GenericDimension.class); + public static final Creator CREATOR = findCreator(GenericDimension.class); } diff --git a/play-services-vision-common/build.gradle b/play-services-vision-common/build.gradle index d9b3ffe725..0f80125f35 100644 --- a/play-services-vision-common/build.gradle +++ b/play-services-vision-common/build.gradle @@ -37,7 +37,7 @@ dependencies { // Dependencies from play-services-vision-common:19.1.3 api project(':play-services-base') api project(':play-services-basement') - //api project(':play-services-clearcut') + api project(':play-services-clearcut') //api project(':play-services-flags') - //api project(':play-services-phenotype') + api project(':play-services-phenotype') } diff --git a/settings.gradle b/settings.gradle index 392116057e..cdf4df4813 100644 --- a/settings.gradle +++ b/settings.gradle @@ -31,6 +31,7 @@ include ':play-services-measurement-base' include ':play-services-nearby' include ':play-services-oss-licenses' include ':play-services-pay' +include ':play-services-phenotype' include ':play-services-places' include ':play-services-places-placereport' include ':play-services-recaptcha'