-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
supplement the num 153 <ACCOUNT_DATA> service
- Loading branch information
1 parent
e7db794
commit f81571a
Showing
6 changed files
with
145 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...aidl/com/google/android/gms/auth/firstparty/dataservice/DeviceManagementInfoResponse.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.auth.firstparty.dataservice; | ||
|
||
parcelable DeviceManagementInfoResponse; |
45 changes: 45 additions & 0 deletions
45
...java/com/google/android/gms/auth/firstparty/dataservice/DeviceManagementInfoResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.auth.firstparty.dataservice; | ||
|
||
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 DeviceManagementInfoResponse extends AbstractSafeParcelable { | ||
@Field(1) | ||
public int code; | ||
@Field(2) | ||
public String info; | ||
@Field(3) | ||
public boolean status; | ||
|
||
public DeviceManagementInfoResponse() { | ||
} | ||
|
||
public DeviceManagementInfoResponse(int code, String info, boolean status) { | ||
this.code = code; | ||
this.info = info; | ||
this.status = status; | ||
} | ||
|
||
public DeviceManagementInfoResponse(String info, boolean status) { | ||
this(1, info, status); | ||
} | ||
|
||
@Override | ||
public void writeToParcel(@NonNull Parcel dest, int flags) { | ||
CREATOR.writeToParcel(this, dest, flags); | ||
} | ||
|
||
public static final SafeParcelableCreatorAndWriter<DeviceManagementInfoResponse> CREATOR = findCreator(DeviceManagementInfoResponse.class); | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
...ices-auth/src/main/aidl/com/google/android/gms/auth/account/data/IAccountDataService.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.auth.account.data; | ||
|
||
import com.google.android.gms.auth.account.data.IDeviceManagementInfoCallback; | ||
import android.accounts.Account; | ||
import com.google.android.gms.common.api.internal.IStatusCallback; | ||
|
||
interface IAccountDataService { | ||
void requestDeviceManagementInfo(in IDeviceManagementInfoCallback callback, in Account account) = 0; | ||
void requestAccountInfo(in IStatusCallback callback, in Account account, boolean isPrimary) = 1; | ||
void requestProfileInfo(in IStatusCallback callback, String profile) = 2; | ||
} |
13 changes: 13 additions & 0 deletions
13
...src/main/aidl/com/google/android/gms/auth/account/data/IDeviceManagementInfoCallback.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.auth.account.data; | ||
|
||
import com.google.android.gms.auth.firstparty.dataservice.DeviceManagementInfoResponse; | ||
import com.google.android.gms.common.api.Status; | ||
|
||
interface IDeviceManagementInfoCallback { | ||
void onResult(in Status status, in DeviceManagementInfoResponse response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...vices-core/src/main/kotlin/com/google/android/gms/auth/account/data/AccountDataService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.google.android.gms.auth.account.data | ||
|
||
import android.accounts.Account | ||
import android.util.Log | ||
import com.google.android.gms.auth.firstparty.dataservice.DeviceManagementInfoResponse | ||
import com.google.android.gms.common.ConnectionResult | ||
import com.google.android.gms.common.Feature | ||
import com.google.android.gms.common.api.Status | ||
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 org.microg.gms.BaseService | ||
import org.microg.gms.common.GmsService | ||
|
||
private const val TAG = "AccountDataService" | ||
|
||
class AccountDataService : BaseService(TAG, GmsService.ACCOUNT_DATA) { | ||
|
||
override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { | ||
Log.d(TAG, "handleServiceRequest start ") | ||
val connectionInfo = ConnectionInfo() | ||
connectionInfo.features = arrayOf( | ||
Feature("account_data_service", 6L), | ||
Feature("account_data_service_legacy", 1L), | ||
Feature("account_data_service_token", 7L), | ||
Feature("account_data_service_visibility", 1L), | ||
Feature("gaiaid_primary_email_api", 1L)) | ||
callback.onPostInitCompleteWithConnectionInfo(ConnectionResult.SUCCESS, | ||
AccountDataServiceImpl().asBinder(), | ||
connectionInfo) | ||
} | ||
|
||
} | ||
|
||
class AccountDataServiceImpl : IAccountDataService.Stub() { | ||
override fun requestDeviceManagementInfo(callback: IDeviceManagementInfoCallback, account: Account?) { | ||
Log.d(TAG, "requestDeviceManagementInfo is called ") | ||
callback.onResult(Status.SUCCESS, DeviceManagementInfoResponse(null, false)) | ||
} | ||
|
||
override fun requestAccountInfo(callback: IStatusCallback, account: Account?, isPrimary: Boolean) { | ||
Log.d(TAG, "requestAccountInfo is called ") | ||
callback.onResult(Status.SUCCESS) | ||
} | ||
|
||
override fun requestProfileInfo(callback: IStatusCallback, profile: String?) { | ||
Log.d(TAG, "requestProfileInfo is called ") | ||
callback.onResult(Status.SUCCESS) | ||
} | ||
} |