Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 2e644277 authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Add CredentialsService dummy

parent 9ccb2073
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
+7 −2
Original line number Diff line number Diff line
@@ -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>
+1 −1
Original line number Diff line number Diff line
@@ -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
+53 −0
Original line number Diff line number Diff line
/*
 * 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)
    }

}