diff --git a/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/SemanticLocationEventRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/SemanticLocationEventRequest.aidl new file mode 100644 index 00000000..715a75c0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/SemanticLocationEventRequest.aidl @@ -0,0 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2023 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package com.google.android.gms.semanticlocation; + +parcelable SemanticLocationEventRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/internal/ISemanticLocationService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/internal/ISemanticLocationService.aidl new file mode 100644 index 00000000..de75deff --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/internal/ISemanticLocationService.aidl @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: 2023 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package com.google.android.gms.semanticlocation.internal; + +import android.app.PendingIntent; +import android.os.IInterface; +import com.google.android.gms.semanticlocation.SemanticLocationEventRequest; +import com.google.android.gms.semanticlocation.internal.SemanticLocationParameters; +import com.google.android.gms.common.api.internal.IStatusCallback; + +interface ISemanticLocationService { + void registerSemanticLocationEvents(in SemanticLocationParameters params, IStatusCallback callback, in SemanticLocationEventRequest request, in PendingIntent pendingIntent) = 0; + void unregisterSemanticLocationEvents(in SemanticLocationParameters params, IStatusCallback callback, in PendingIntent pendingIntent) = 1; + + void setIncognitoMode(in SemanticLocationParameters params, IStatusCallback callback, boolean mode) = 4; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/internal/SemanticLocationParameters.aidl b/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/internal/SemanticLocationParameters.aidl new file mode 100644 index 00000000..1ac959eb --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/semanticlocation/internal/SemanticLocationParameters.aidl @@ -0,0 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2023 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package com.google.android.gms.semanticlocation.internal; + +parcelable SemanticLocationParameters; diff --git a/play-services-api/src/main/java/com/google/android/gms/semanticlocation/SemanticLocationEventRequest.java b/play-services-api/src/main/java/com/google/android/gms/semanticlocation/SemanticLocationEventRequest.java new file mode 100644 index 00000000..65ee1379 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/semanticlocation/SemanticLocationEventRequest.java @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2023 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package com.google.android.gms.semanticlocation; + + +import android.os.Parcel; + +import androidx.annotation.NonNull; + +import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; +import com.google.android.gms.common.internal.safeparcel.SafeParcelable; +import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter; + +@SafeParcelable.Class +public class SemanticLocationEventRequest extends AbstractSafeParcelable { + @Field(1) + public final float position; + + @Constructor + public SemanticLocationEventRequest(@Param(1) float position) { + this.position = position; + } + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + CREATOR.writeToParcel(this, dest, flags); + } + + public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(SemanticLocationEventRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/semanticlocation/internal/SemanticLocationParameters.java b/play-services-api/src/main/java/com/google/android/gms/semanticlocation/internal/SemanticLocationParameters.java new file mode 100644 index 00000000..3dc753eb --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/semanticlocation/internal/SemanticLocationParameters.java @@ -0,0 +1,38 @@ +/* + * SPDX-FileCopyrightText: 2023 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package com.google.android.gms.semanticlocation.internal; + +import android.accounts.Account; +import android.os.Parcel; + +import androidx.annotation.NonNull; + +import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; +import com.google.android.gms.common.internal.safeparcel.SafeParcelable; +import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter; + +@SafeParcelable.Class +public class SemanticLocationParameters extends AbstractSafeParcelable { + @Field(1) + public final Account account; + @Field(2) + public final String clientIdentifier; + @Field(3) + public final String packageName; + + @Constructor + public SemanticLocationParameters(@Param(1) Account account, @Param(2) String clientIdentifier, @Param(3) String packageName) { + this.account = account; + this.clientIdentifier = clientIdentifier; + this.packageName = packageName; + } + + public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(SemanticLocationParameters.class); + + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + CREATOR.writeToParcel(this, dest, flags); + } +} diff --git a/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java index 739bc259..2802e9eb 100644 --- a/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java +++ b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java @@ -27,6 +27,69 @@ public enum GmsService { COMMON(39, "com.google.android.gms.common.service.START"), SIGN_IN(44, "com.google.android.gms.signin.service.START"), CREDENTIALS(68, "com.google.android.gms.auth.api.credentials.service.START"), +<<<<<<< HEAD +======= + NEARBY_BOOTSTRAP(69, "com.google.android.gms.nearby.bootstrap.service.NearbyBootstrapService.START"), + PLUS_INTERNAL(70), + SOURCE_DEVICE(75, "com.google.android.gms.smartdevice.d2d.SourceDeviceService.START"), + TARGET_DEVICE(76, "com.google.android.gms.smartdevice.d2d.TargetDeviceService.START"), + APP_INVITE(77, "com.google.android.gms.appinvite.service.START"), + TAP_AND_PAY(79, "com.google.android.gms.tapandpay.service.BIND"), + CHROME_SYNC(80, "com.google.android.gms.chromesync.service.START"), + ACCOUNTS(81, "com.google.android.gms.smartdevice.setup.accounts.AccountsService.START"), + CAST_REMOTE_DISPLAY(83, "com.google.android.gms.cast.remote_display.service.START"), + TRUST_AGENT(85, "com.google.android.gms.trustagent.StateApi.START"), + AUTH_SIGN_IN(91, "com.google.android.gms.auth.api.signin.service.START"), + MEASUREMENT(93, "com.google.android.gms.measurement.START"), + FREIGHTER(98, "com.google.android.gms.freighter.service.START"), + GUNS(110, "com.google.android.gms.notifications.service.START"), + BLE(111, "com.google.android.gms.beacon.internal.IBleService.START"), + FIREBASE_AUTH(112, "com.google.firebase.auth.api.gms.service.START"), + APP_INDEXING(113), + GASS(116, "com.google.android.gms.gass.START"), + WORK_ACCOUNT(120), + INSTANT_APPS(121, "com.google.android.gms.instantapps.START"), + CAST_FIRSTPATY(122, "com.google.android.gms.cast.firstparty.START"), + AD_CACHE(123, "com.google.android.gms.ads.service.CACHE"), + SMS_RETRIEVER(126, "com.google.android.gms.auth.api.phone.service.SmsRetrieverApiService.START"), + CRYPT_AUTH(129, "com.google.android.gms.auth.cryptauth.cryptauthservice.START"), + DYNAMIC_LINKS(131, "com.google.firebase.dynamiclinks.service.START"), + FONTS(132, "com.google.android.gms.fonts.service.START"), + ROMANESCO(135, "com.google.android.gms.romanesco.service.START"), + TRAINER(139, "com.google.android.gms.learning.trainer.START"), + FIDO2_REGULAR(148, "com.google.android.gms.fido.fido2.regular.START"), + FIDO2_PRIVILEGED(149, "com.google.android.gms.fido.fido2.privileged.START"), + DATA_DOWNLOAD(152, "com.google.android.mdd.service.START"), + ACCOUNT_DATA(153, "com.google.android.gms.auth.account.data.service.START"), + CONSTELLATION(155, "com.google.android.gms.constellation.service.START"), + AUDIT(154, "com.google.android.gms.audit.service.START"), + SYSTEM_UPDATE(157, "com.google.android.gms.update.START_API_SERVICE"), + MOBSTORE(160, "com.google.android.mobstore.service.START"), + USER_LOCATION(163, "com.google.android.gms.userlocation.service.START"), + AD_HTTP(166, "com.google.android.gms.ads.service.HTTP"), + LANGUAGE_PROFILE(167, "com.google.android.gms.languageprofile.service.START"), + MDNS(168, "com.google.android.gms.mdns.service.START"), + SEMANTIC_LOCATION(173, "com.google.android.gms.semanticlocation.service.START_ODLH"), + FIDO2_ZEROPARTY(180, "com.google.android.gms.fido.fido2.zeroparty.START"), + G1_RESTORE(181, "com.google.android.gms.backup.G1_RESTORE"), + G1_BACKUP(182, "com.google.android.gms.backup.G1_BACKUP"), + OSS_LICENSES(185, "com.google.android.gms.oss.licenses.service.START"), + PAYSE(188, "com.google.android.gms.payse.service.BIND"), + RCS(189, "com.google.android.gms.rcs.START"), + CARRIER_AUTH(191, "com.google.android.gms.carrierauth.service.START"), + SYSTEM_UPDATE_SINGLE_UESR(192, "com.google.android.gms.update.START_SINGLE_USER_API_SERVICE"), + APP_USAGE(193, "com.google.android.gms.appusage.service.START"), + NEARBY_SHARING_2(194, "com.google.android.gms.nearby.sharing.START_SERVICE"), + AD_CONSENT_LOOKUP(195, "com.google.android.gms.ads.service.CONSENT_LOOKUP"), + CREDENTIAL_MANAGER(196, "com.google.android.gms.credential.manager.service.firstparty.START"), + PHONE_INTERNAL(197, "com.google.android.gms.auth.api.phone.service.InternalService.START"), + PAY(198, "com.google.android.gms.pay.service.BIND"), + ASTERISM(199, "com.google.android.gms.asterism.service.START"), + MODULE_RESTORE(201, "com.google.android.gms.backup.GMS_MODULE_RESTORE"), + FACS_CACHE(202, "com.google.android.gms.facs.cache.service.START"), + RECAPTCHA(205, "com.google.android.gms.recaptcha.service.START"), + CONTACT_SYNC(208, "com.google.android.gms.people.contactssync.service.START"), +>>>>>>> 37dd2b59 (Add dummy service for SEMANTIC_LOCATION(173) (#2174)) IDENTITY_SIGN_IN(212, "com.google.android.gms.auth.api.identity.service.signin.START"), ; diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 80ceba01..47282490 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -528,6 +528,118 @@ +<<<<<<< HEAD +======= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>>>>>>> 37dd2b59 (Add dummy service for SEMANTIC_LOCATION(173) (#2174)) <<<<<<< HEAD ======= @@ -639,7 +751,6 @@ - diff --git a/play-services-core/src/main/java/com/google/android/gms/semanticlocation/SemanticLocationService.kt b/play-services-core/src/main/java/com/google/android/gms/semanticlocation/SemanticLocationService.kt new file mode 100644 index 00000000..70b36538 --- /dev/null +++ b/play-services-core/src/main/java/com/google/android/gms/semanticlocation/SemanticLocationService.kt @@ -0,0 +1,56 @@ +/* + * SPDX-FileCopyrightText: 2024 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package com.google.android.gms.semanticlocation + +import android.app.PendingIntent +import android.util.Log +import com.google.android.gms.common.ConnectionResult +import com.google.android.gms.common.Feature +import com.google.android.gms.common.api.internal.IStatusCallback +import com.google.android.gms.common.internal.ConnectionInfo +import com.google.android.gms.common.internal.GetServiceRequest +import com.google.android.gms.common.internal.IGmsCallbacks +import com.google.android.gms.semanticlocation.internal.ISemanticLocationService +import com.google.android.gms.semanticlocation.internal.SemanticLocationParameters +import org.microg.gms.BaseService +import org.microg.gms.common.GmsService + +private const val TAG = "SemanticLocationService" + +private val FEATURES = arrayOf( + Feature("semanticlocation_events", 1L), +) + +class SemanticLocationService : BaseService(TAG, GmsService.SEMANTIC_LOCATION) { + override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { + val connectionInfo = ConnectionInfo().apply { + features = FEATURES + } + callback.onPostInitCompleteWithConnectionInfo( + ConnectionResult.SUCCESS, + SemanticLocationServiceImpl().asBinder(), + connectionInfo + ) + } +} + +class SemanticLocationServiceImpl : ISemanticLocationService.Stub() { + override fun registerSemanticLocationEvents( + params: SemanticLocationParameters, + callback: IStatusCallback, + request: SemanticLocationEventRequest, + pendingIntent: PendingIntent + ) { + Log.d(TAG, "registerSemanticLocationEvents: $params") + } + + override fun setIncognitoMode(params: SemanticLocationParameters, callback: IStatusCallback, mode: Boolean) { + Log.d(TAG, "setIncognitoMode: $params") + } + + override fun unregisterSemanticLocationEvents(params: SemanticLocationParameters, callback: IStatusCallback, pendingIntent: PendingIntent) { + Log.d(TAG, "unregisterSemanticLocationEvents: $params") + } +}