Skip to content

Commit 59825d9

Browse files
authored
Add Wallet Service getClientToken dummy method (#2925)
* Fix missing methods that cause application ANR * Add missing features of TapAndPay * cleanCode
1 parent b1329a2 commit 59825d9

8 files changed

Lines changed: 99 additions & 7 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.gms.wallet;
7+
8+
parcelable GetClientTokenRequest;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.gms.wallet;
7+
8+
parcelable GetClientTokenResponse;

play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IOwService.aidl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package com.google.android.gms.wallet.internal;
22

33
import com.google.android.gms.wallet.internal.IWalletServiceCallbacks;
44
import com.google.android.gms.wallet.IsReadyToPayRequest;
5+
import com.google.android.gms.wallet.GetClientTokenRequest;
56

67
interface IOwService {
78
void isReadyToPay(in IsReadyToPayRequest request, in Bundle args, IWalletServiceCallbacks callbacks) = 13;
9+
void getClientToken(in GetClientTokenRequest getClientTokenRequest, in Bundle options, IWalletServiceCallbacks callbacks) = 14;
810
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.google.android.gms.wallet.internal;
22

33
import com.google.android.gms.common.api.Status;
4+
import com.google.android.gms.wallet.GetClientTokenResponse;
45

56
interface IWalletServiceCallbacks {
67
void onIsReadyToPayResponse(in Status status, boolean result, in Bundle args) = 8;
8+
void onClientTokenReceived(in Status status, in GetClientTokenResponse response, in Bundle extras) = 9;
79
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.gms.wallet;
7+
8+
import android.os.Parcel;
9+
10+
import androidx.annotation.NonNull;
11+
12+
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
13+
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
14+
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
15+
16+
@SafeParcelable.Class
17+
public class GetClientTokenRequest extends AbstractSafeParcelable {
18+
19+
@Override
20+
public void writeToParcel(@NonNull Parcel dest, int flags) {
21+
CREATOR.writeToParcel(this, dest, flags);
22+
}
23+
24+
public static final SafeParcelableCreatorAndWriter<GetClientTokenRequest> CREATOR = findCreator(GetClientTokenRequest.class);
25+
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.gms.wallet;
7+
8+
import android.os.Parcel;
9+
10+
import androidx.annotation.NonNull;
11+
12+
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
13+
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
14+
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
15+
16+
@SafeParcelable.Class
17+
public class GetClientTokenResponse extends AbstractSafeParcelable {
18+
19+
@Override
20+
public void writeToParcel(@NonNull Parcel dest, int flags) {
21+
CREATOR.writeToParcel(this, dest, flags);
22+
}
23+
24+
public static final SafeParcelableCreatorAndWriter<GetClientTokenResponse> CREATOR = findCreator(GetClientTokenResponse.class);
25+
26+
}

play-services-core/src/main/java/org/microg/gms/wallet/OwServiceImpl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import android.util.Log;
2424

2525
import com.google.android.gms.common.api.Status;
26+
import com.google.android.gms.wallet.GetClientTokenRequest;
27+
import com.google.android.gms.wallet.GetClientTokenResponse;
2628
import com.google.android.gms.wallet.IsReadyToPayRequest;
2729
import com.google.android.gms.wallet.internal.IOwService;
2830
import com.google.android.gms.wallet.internal.IWalletServiceCallbacks;
@@ -45,6 +47,16 @@ public void isReadyToPay(IsReadyToPayRequest request, Bundle args, IWalletServic
4547
}
4648
}
4749

50+
@Override
51+
public void getClientToken(GetClientTokenRequest getClientTokenRequest, Bundle options, IWalletServiceCallbacks callbacks) throws RemoteException {
52+
Log.d(TAG, "getClientToken: " + options);
53+
try {
54+
callbacks.onClientTokenReceived(Status.INTERNAL_ERROR, new GetClientTokenResponse(), Bundle.EMPTY);
55+
} catch (Exception e) {
56+
Log.w(TAG, e);
57+
}
58+
}
59+
4860
@Override
4961
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
5062
if (super.onTransact(code, data, reply, flags)) return true;

play-services-tapandpay/core/src/main/kotlin/org/microg/gms/tapandpay/TapAndPayService.kt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,48 +36,56 @@ class TapAndPayService : BaseService(TAG, GmsService.TAP_AND_PAY) {
3636
Feature("tapandpay", 1),
3737
Feature("tapandpay_account_linking", 1),
3838
Feature("tapandpay_add_service_listener", 1),
39+
Feature("tapandpay_backup_and_restore_tokenize", 1),
3940
Feature("tapandpay_block_payment_cards", 1),
4041
Feature("tapandpay_check_contactless_eligibility", 1),
42+
Feature("tapandpay_check_notification_governance", 1),
4143
Feature("tapandpay_dismiss_quick_access_wallet", 1),
4244
Feature("tapandpay_enable_secure_keyguard", 1),
4345
Feature("tapandpay_felica_tos", 1),
4446
Feature("tapandpay_get_active_wallet_infos", 1L),
4547
Feature("tapandpay_get_all_cards_for_account", 1),
4648
Feature("tapandpay_get_contactless_setup_configuration", 1),
49+
Feature("tapandpay_get_data_for_backup", 1),
4750
Feature("tapandpay_get_environment", 1L),
4851
Feature("tapandpay_get_last_attestation_result", 1),
52+
Feature("tapandpay_get_quick_access_tile_status", 1),
4953
Feature("tapandpay_get_stable_hardware_id", 1L),
5054
Feature("tapandpay_get_token_details", 1L),
5155
Feature("tapandpay_get_token_status", 1L),
5256
Feature("tapandpay_global_actions", 1),
5357
Feature("tapandpay_has_eligible_tokenization_target", 1L),
5458
Feature("tapandpay_issuer_api", 2),
55-
Feature("tapandpay_perform_tokenization_operation", 1),
56-
Feature("tapandpay_push_tokenize", 1),
59+
Feature("tapandpay_issuer_tokenize", 1),
5760
Feature("tapandpay_override_payment_network", 3L),
5861
Feature("tapandpay_get_parental_consent_intent", 1L),
62+
Feature("tapandpay_set_supervised_child_account_type_and_reset_onboarding_info", 1L),
63+
Feature("tapandpay_get_is_supervised_child_wallet_user", 1L),
5964
Feature("tapandpay_perform_secure_element_management_operation", 1L),
6065
Feature("tapandpay_perform_tokenization_operation", 1L),
66+
Feature("tapandpay_polling_frame_handler", 1L),
6167
Feature("tapandpay_push_tokenize_session", 6),
6268
Feature("tapandpay_push_tokenize", 1L),
6369
Feature("tapandpay_quick_access_wallet", 1),
6470
Feature("tapandpay_report_unlock", 1L),
6571
Feature("tapandpay_request_delete_token", 1L),
6672
Feature("tapandpay_request_select_token", 1L),
6773
Feature("tapandpay_secureelement", 1),
74+
Feature("tapandpay_send_wear_request_to_phone", 1),
6875
Feature("tapandpay_settings", 2L),
69-
Feature("tapandpay_token_listing_with_request", 1L),
76+
Feature("tapandpay_screen_logging", 1L),
7077
Feature("tapandpay_show_wear_card_management_view", 1),
71-
Feature("tapandpay_send_wear_request_to_phone", 1),
7278
Feature("tapandpay_sync_device_info", 1),
79+
Feature("tapandpay_token_listing", 3),
80+
Feature("tapandpay_token_listing_with_request", 1),
7381
Feature("tapandpay_tokenize_account", 1),
7482
Feature("tapandpay_tokenize_cache", 1),
7583
Feature("tapandpay_tokenize_pan", 1),
7684
Feature("tapandpay_transmission_event", 1),
77-
Feature("tapandpay_token_listing", 3),
78-
Feature("tapandpay_wallet_ui_shown_status", 1L),
85+
Feature("tapandpay_wallet_feedback_psd", 1),
7986
Feature("tapandpay_wallet_set_tap_doodle_enabled", 1L),
80-
Feature("tapandpay_wallet_feedback_psd", 1)
87+
Feature("tapandpay_wallet_ui_shown_status", 1L),
88+
Feature("tapandpay_set_receives_ineligible_card_notification", 1L)
8189
)
8290
})
8391
}

0 commit comments

Comments
 (0)