Add CredentialsService dummy

This commit is contained in:
Marvin W 2021-06-23 22:15:40 +02:00
parent 9ccb2073e0
commit 2e64427734
No known key found for this signature in database
GPG Key ID: 072E9235DB996F2A
4 changed files with 63 additions and 3 deletions

View File

@ -29,6 +29,8 @@ public class CredentialRequest extends AutoSafeParcelable {
@Field(4)
private CredentialPickerConfig credentialHintPickerConfig;
private CredentialRequest() { }
public CredentialRequest(boolean passwordLoginSupported, String[] accountTypes, CredentialPickerConfig credentialPickerConfig, CredentialPickerConfig credentialHintPickerConfig) {
this.passwordLoginSupported = passwordLoginSupported;
this.accountTypes = accountTypes;

View File

@ -423,7 +423,7 @@
android:exported="true" />
<activity
android:name="org.microg.gms.ui.CredentialPickerActivity"
android:name="org.microg.gms.auth.CredentialPickerActivity"
android:process=":ui">
<intent-filter>
<action android:name="com.google.android.gms.auth.api.credentials.PICKER" />
@ -431,6 +431,12 @@
</intent-filter>
</activity>
<service android:name="org.microg.gms.auth.CredentialsService">
<intent-filter>
<action android:name="com.google.android.gms.auth.api.credentials.service.START" />
</intent-filter>
</service>
<!-- Games -->
<service android:name="org.microg.gms.games.GamesStubService">
@ -740,7 +746,6 @@
<action android:name="com.google.android.gms.audiomodem.service.AudioModemService.START" />
<action android:name="com.google.android.gms.nearby.sharing.service.NearbySharingService.START" />
<action android:name="com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START" />
<action android:name="com.google.android.gms.auth.api.credentials.service.START" />
<action android:name="com.google.android.gms.gass.START" />
<action android:name="com.google.android.gms.audit.service.START" />
</intent-filter>

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.ui
package org.microg.gms.auth
import android.app.Activity
import android.os.Bundle

View File

@ -0,0 +1,53 @@
/*
* SPDX-FileCopyrightText: 2021, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.auth
import android.os.Bundle
import android.util.Log
import com.google.android.gms.auth.api.credentials.CredentialRequest
import com.google.android.gms.auth.api.credentials.internal.*
import com.google.android.gms.common.api.CommonStatusCodes
import com.google.android.gms.common.api.Status
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
const val TAG = "GmsCredentials"
class CredentialsService : BaseService(TAG, GmsService.CREDENTIALS) {
override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {
callback.onPostInitComplete(CommonStatusCodes.SUCCESS, CredentialsServiceImpl(), Bundle())
}
}
class CredentialsServiceImpl : ICredentialsService.Stub() {
override fun request(callbacks: ICredentialsCallbacks, request: CredentialRequest) {
Log.d(TAG, "request($request)")
callbacks.onStatus(Status.CANCELED)
}
override fun save(callbacks: ICredentialsCallbacks, request: SaveRequest) {
Log.d(TAG, "save($request)")
callbacks.onStatus(Status.CANCELED)
}
override fun delete(callbacks: ICredentialsCallbacks, request: DeleteRequest) {
Log.d(TAG, "delete($request)")
callbacks.onStatus(Status.CANCELED)
}
override fun disableAutoSignIn(callbacks: ICredentialsCallbacks) {
Log.d(TAG, "disableAutoSignIn()")
callbacks.onStatus(Status.SUCCESS)
}
override fun generatePassword(callbacks: ICredentialsCallbacks, request: GeneratePasswordRequest) {
Log.d(TAG, "generatePassword($request)")
callbacks.onStatus(Status.SUCCESS)
}
}