Add dummy service for SEMANTIC_LOCATION(173) (#2174)

Co-authored-by: Marvin W <git@larma.de>
This commit is contained in:
DaVinci9196 2024-02-17 22:23:56 +08:00 • committed by Cuynu
commit e288ba2554
8 changed files with 333 additions and 1 deletions

View file

@ -0,0 +1,7 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package com.google.android.gms.semanticlocation;
parcelable SemanticLocationEventRequest;

View file

@ -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;
}

View file

@ -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;

View file

@ -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<SemanticLocationEventRequest> CREATOR = findCreator(SemanticLocationEventRequest.class);
}

View file

@ -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<SemanticLocationParameters> CREATOR = findCreator(SemanticLocationParameters.class);
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}
}

View file

@ -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"),
;

View file

@ -528,6 +528,118 @@
<service android:name="org.microg.gms.DummyService"
android:exported="true">
<intent-filter>
<<<<<<< HEAD
=======
<action android:name="com.google.android.gms.languageprofile.service.START" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<service android:name="org.microg.gms.mdm.NetworkQualityService">
<intent-filter>
<action android:name="com.google.android.gms.mdm.services.START" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<service android:name="org.microg.gms.icing.LightweightIndexService">
<intent-filter>
<action android:name="com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE" />
</intent-filter>
</service>
<service android:name="org.microg.gms.icing.IndexService">
<intent-filter>
<action android:name="com.google.android.gms.icing.INDEX_SERVICE" />
</intent-filter>
</service>
<service
android:name=".analytics.service.AnalyticsService"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.analytics.service.START" />
</intent-filter>
</service>
<service android:name="org.microg.gms.playlog.PlayLogService">
<intent-filter>
<action android:name="com.google.android.gms.playlog.service.START" />
</intent-filter>
</service>
<service
android:name=".gcm.http.GoogleHttpService"
android:exported="true" />
<service android:name="org.microg.gms.ads.GService">
<intent-filter>
<action android:name="com.google.android.gms.ads.gservice.START" />
</intent-filter>
</service>
<service android:name="org.microg.gms.feedback.FeedbackService">
<intent-filter>
<action android:name="com.google.android.gms.feedback.internal.IFeedbackService" />
</intent-filter>
</service>
<service android:name="org.microg.gms.clearcut.ClearcutLoggerService">
<intent-filter>
<action android:name="com.google.android.gms.clearcut.service.START" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<service android:name="org.microg.gms.drive.api.DriveApiService">
<intent-filter>
<action android:name="com.google.android.gms.drive.ApiService.START" />
<action android:name="com.google.android.gms.drive.ApiService.STOP" />
<action android:name="com.google.android.gms.drive.ApiService.RESET_AFTER_BOOT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<service android:name="org.microg.gms.reminders.RemindersService">
<intent-filter>
<action android:name="com.google.android.gms.reminders.service.START" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
<service android:name="org.microg.gms.wallet.PaymentService">
<intent-filter>
<action android:name="com.google.android.gms.wallet.service.BIND" />
</intent-filter>
</service>
<service android:name="org.microg.gms.firebase.dynamiclinks.DynamicLinksService">
<intent-filter>
<action android:name="com.google.firebase.dynamiclinks.service.START" />
</intent-filter>
</service>
<service android:name="org.microg.gms.udc.FacsCacheService">
<intent-filter>
<action android:name="com.google.android.gms.facs.cache.service.START" />
</intent-filter>
</service>
<service android:name="org.microg.gms.usagereporting.UsageReportingService">
<intent-filter>
<action android:name="com.google.android.gms.usagereporting.service.START" />
</intent-filter>
</service>
<service android:name=".semanticlocation.SemanticLocationService" android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.semanticlocation.service.START_ODLH" />
</intent-filter>
</service>
<service android:name="com.google.android.gms.audit.internal.AuditApiService">
<intent-filter>
<action android:name="com.google.android.gms.audit.service.START" />
</intent-filter>
</service>
<service android:name="org.microg.gms.DummyService">
<intent-filter>
<action android:name="com.google.android.contextmanager.service.ContextManagerService.START" />
>>>>>>> 37dd2b59 (Add dummy service for SEMANTIC_LOCATION(173) (#2174))
<action android:name="com.google.android.gms.accounts.ACCOUNT_SERVICE" />
<<<<<<< HEAD
=======
@ -639,7 +751,6 @@
<action android:name="com.google.android.gms.romanesco.MODULE_BACKUP_AGENT" />
<action android:name="com.google.android.gms.romanesco.service.START" />
<action android:name="com.google.android.gms.search.service.SEARCH_AUTH_START" />
<action android:name="com.google.android.gms.semanticlocation.service.START_ODLH" />
<action android:name="com.google.android.gms.sesame.service.BIND" />
<action android:name="com.google.android.gms.telephonyspam.service.START" />
<action android:name="com.google.android.gms.testsupport.service.START" />

View file

@ -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")
}
}