Skip to content

Commit bb00114

Browse files
authored
Wearable: Add ConnectionInfo features to WearableService (#3427)
1 parent b1adbe3 commit bb00114

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

play-services-wearable/core/src/main/java/org/microg/gms/wearable/WearableService.java

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
import android.os.RemoteException;
2020

21+
import com.google.android.gms.common.Feature;
22+
import com.google.android.gms.common.api.CommonStatusCodes;
23+
import com.google.android.gms.common.internal.ConnectionInfo;
2124
import com.google.android.gms.common.internal.GetServiceRequest;
2225
import com.google.android.gms.common.internal.IGmsCallbacks;
2326

@@ -27,6 +30,42 @@
2730

2831
public class WearableService extends BaseService {
2932

33+
public static final Feature[] FEATURES = new Feature[]{
34+
new Feature("app_client", 4L),
35+
new Feature("carrier_auth", 1L),
36+
new Feature("wear3_oem_companion", 1L),
37+
new Feature("wear_await_data_sync_complete", 1L),
38+
new Feature("wear_backup_restore", 8L),
39+
new Feature("wear_consent", 2L),
40+
new Feature("wear_consent_recordoptin", 1L),
41+
new Feature("wear_consent_recordoptin_swaadl", 1L),
42+
new Feature("wear_consent_supervised", 2L),
43+
new Feature("wear_get_phone_switching_feature_status", 1L),
44+
new Feature("wear_fast_pair_account_key_sync", 1L),
45+
new Feature("wear_fast_pair_get_account_keys", 1L),
46+
new Feature("wear_fast_pair_get_account_key_by_account", 1L),
47+
new Feature("wear_flush_batched_data", 1L),
48+
new Feature("wear_get_related_configs", 1L),
49+
new Feature("wear_get_node_id", 1L),
50+
new Feature("wear_logging_service", 2L),
51+
new Feature("wear_retry_connection", 1L),
52+
new Feature("wear_set_cloud_sync_setting_by_node", 1L),
53+
new Feature("wear_first_party_consents", 2L),
54+
new Feature("wear_update_config", 1L),
55+
new Feature("wear_update_connection_retry_strategy", 1L),
56+
new Feature("wear_update_delay_config", 1L),
57+
new Feature("wearable_services", 1L),
58+
new Feature("wear_cancel_migration", 1L),
59+
new Feature("wear_customizable_screens", 2L),
60+
new Feature("wear_wifi_immediate_connect", 1L),
61+
new Feature("wear_get_node_active_network_metered", 1L),
62+
new Feature("wear_consents_per_watch", 3L),
63+
new Feature("wear_material3_experience", 1L),
64+
new Feature("wear_offload_connection", 1L),
65+
new Feature("wear_get_local_capabilities", 1L),
66+
new Feature("wear_notify_channel_flushed", 1L)
67+
};
68+
3069
private WearableImpl wearable;
3170

3271
public WearableService() {
@@ -50,6 +89,8 @@ public void onDestroy() {
5089
@Override
5190
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
5291
PackageUtils.getAndCheckCallingPackage(this, request.packageName);
53-
callback.onPostInitComplete(0, new WearableServiceImpl(this, wearable, request.packageName), null);
92+
ConnectionInfo connectionInfo = new ConnectionInfo();
93+
connectionInfo.features = FEATURES;
94+
callback.onPostInitCompleteWithConnectionInfo(CommonStatusCodes.SUCCESS, new WearableServiceImpl(this, wearable, request.packageName), connectionInfo);
5495
}
5596
}

0 commit comments

Comments
 (0)