Skip to content

Commit

Permalink
supplement the num 116 <GASS> service
Browse files Browse the repository at this point in the history
  • Loading branch information
DaVinci9196 committed Feb 7, 2024
1 parent 42468ba commit e7db794
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.gass.internal;

parcelable GassRequestParcel;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.gass.internal;

parcelable GassResponseParcel;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.gass.internal;

import android.os.Bundle;
import android.os.IInterface;
import com.google.android.gms.gass.internal.GassRequestParcel;
import com.google.android.gms.gass.internal.GassResponseParcel;

interface IGassService {
Bundle getGassBundle(in Bundle bundle, int code);
GassResponseParcel getGassResponse(in GassRequestParcel gassRequestParcel);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.gass.internal;

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 GassRequestParcel extends AbstractSafeParcelable {

@Field(1)
public int versionCode;
@Field(2)
public String status;
@Field(3)
public String desc;

@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<GassRequestParcel> CREATOR = findCreator(GassRequestParcel.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.gass.internal;

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;
import com.google.android.gms.feedback.ErrorReport;

import org.microg.safeparcel.AutoSafeParcelable;

@SafeParcelable.Class
public class GassResponseParcel extends AbstractSafeParcelable {

@Field(1)
public int versionCode;

@Field(2)
public byte[] data;

public ErrorReport report;

public GassResponseParcel() {
}

public GassResponseParcel(int i, byte[] bArr) {
this.versionCode = i;
this.report = null;
this.data = bArr;
}

public GassResponseParcel(ErrorReport report) {
this.versionCode = 1;
this.report = report;
this.data = null;
}

@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
CREATOR.writeToParcel(this, dest, flags);
}

public static final SafeParcelableCreatorAndWriter<GassResponseParcel> CREATOR = findCreator(GassResponseParcel.class);
}
8 changes: 7 additions & 1 deletion play-services-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,13 @@
</intent-filter>
</service>

<!-- gass -->
<service android:name="com.google.android.gms.gass.internal.GassService">
<intent-filter>
<action android:name="com.google.android.gms.gass.START" />
</intent-filter>
</service>

<service android:name="org.microg.gms.DummyService">
<intent-filter>
<action android:name="com.google.android.contextmanager.service.ContextManagerService.START" />
Expand Down Expand Up @@ -906,7 +913,6 @@
<action android:name="com.google.android.gms.fitness.SessionsApi" />
<action android:name="com.google.android.gms.fonts.service.START" />
<action android:name="com.google.android.gms.freighter.service.START" />
<action android:name="com.google.android.gms.gass.START" />
<action android:name="com.google.android.gms.growth.service.START" />
<action android:name="com.google.android.gms.googlehelp.service.GoogleHelpService.START" />
<action android:name="com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package com.google.android.gms.gass.internal

import android.os.Bundle
import android.util.Log
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.internal.GetServiceRequest
import com.google.android.gms.common.internal.IGmsCallbacks
import org.microg.gms.BaseService
import org.microg.gms.common.GmsService

private const val TAG = "GassService"

class GassService : BaseService(TAG, GmsService.GASS) {

override fun handleServiceRequest(callback: IGmsCallbacks?, request: GetServiceRequest?, service: GmsService?) {
callback?.onPostInitComplete(ConnectionResult.SUCCESS, GassServiceImpl().asBinder(), null)
}

}

class GassServiceImpl : IGassService.Stub() {
override fun getGassBundle(bundle: Bundle?, code: Int): Bundle? {
Log.d(TAG, "GassServiceImpl getGassBundle is Called")
return null
}

override fun getGassResponse(gassRequestParcel: GassRequestParcel?): GassResponseParcel? {
Log.d(TAG, "GassServiceImpl getGassResponse is Called")
return null
}

}

0 comments on commit e7db794

Please sign in to comment.