Skip to content

Commit

Permalink
LanguageProfile: Claim supported features (#2461)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaVinci9196 authored Aug 4, 2024
1 parent dbbee72 commit ad6d93b
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ package org.microg.gms.languageprofile

import android.os.Bundle
import android.util.Log
import com.google.android.gms.common.Feature
import com.google.android.gms.common.api.CommonStatusCodes
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 com.google.android.gms.languageprofile.ClientLanguageSettings
Expand All @@ -21,10 +23,17 @@ import org.microg.gms.BaseService
import org.microg.gms.common.GmsService

private const val TAG = "LanguageProfileService"
private val FEATURES = arrayOf(
Feature("get_application_locale_suggestions_api", 1L),
Feature("get_language_preferences_for_product_id_api", 1L),
Feature("set_language_settings_api", 1L),
)

class LanguageProfileService : BaseService(TAG, GmsService.LANGUAGE_PROFILE) {
override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {
callback.onPostInitComplete(CommonStatusCodes.SUCCESS, LanguageProfileServiceImpl(), Bundle())
callback.onPostInitCompleteWithConnectionInfo(CommonStatusCodes.SUCCESS, LanguageProfileServiceImpl(), ConnectionInfo().apply {
features = FEATURES
})
}
}

Expand Down

0 comments on commit ad6d93b

Please sign in to comment.