当前位置: 首页>>代码示例>>Java>>正文


Java GmsService类代码示例

本文整理汇总了Java中org.microg.gms.common.GmsService的典型用法代码示例。如果您正苦于以下问题:Java GmsService类的具体用法?Java GmsService怎么用?Java GmsService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GmsService类属于org.microg.gms.common包,在下文中一共展示了GmsService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleServiceRequest

import org.microg.gms.common.GmsService; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
    switch (service) {
        case INDEX:
            callback.onPostInitComplete(0, appDataSearch.asBinder(), null);
            break;
        case SEARCH_ADMINISTRATION:
            Log.w(TAG, "Service not yet implemented: " + service);
            callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null);
            break;
        case SEARCH_QUERIES:
            callback.onPostInitComplete(0, searchQueries.asBinder(), null);
            break;
        case SEARCH_GLOBAL:
            callback.onPostInitComplete(0, globalSearchAdmin.asBinder(), null);
            break;
        case SEARCH_CORPORA:
            callback.onPostInitComplete(0, searchCorpora.asBinder(), null);
            break;
        case SEARCH_IME:
            Log.w(TAG, "Service not yet implemented: " + service);
            callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null);
            break;
    }
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:26,代码来源:IndexService.java

示例2: BaseService

import org.microg.gms.common.GmsService; //导入依赖的package包/类
public BaseService(String tag, GmsService supportedService, GmsService... supportedServices) {
    this.TAG = tag;
    EnumSet<GmsService> services = EnumSet.of(supportedService);
    services.addAll(Arrays.asList(supportedServices));
    broker = new AbstractGmsServiceBroker(services) {
        @Override
        public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
            try {
                request.extras.keySet(); // call to unparcel()
            } catch (Exception e) {
                // Sometimes we need to define the correct ClassLoader before unparcel(). Ignore those.
            }
            Log.d(TAG, "bound by: " + request);
            BaseService.this.handleServiceRequest(callback, request, service);
        }
    };
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:18,代码来源:BaseService.java

示例3: toString

import org.microg.gms.common.GmsService; //导入依赖的package包/类
@Override
public String toString() {
    return "GetServiceRequest{" +
            "serviceId=" + GmsService.nameFromServiceId(serviceId) +
            ", gmsVersion=" + gmsVersion +
            ", packageName='" + packageName + '\'' +
            (scopes == null || scopes.length == 0 ? "" : (", scopes=" + Arrays.toString(scopes))) +
            (extras == null ? "" : (", extras=" + extras)) +
            (account == null ? "" : (", account=" + account)) +
            '}';
}
 
开发者ID:microg,项目名称:android_external_GmsApi,代码行数:12,代码来源:GetServiceRequest.java

示例4: WearableClientImpl

import org.microg.gms.common.GmsService; //导入依赖的package包/类
public WearableClientImpl(Context context, Wearable.WearableOptions options, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) {
    super(context, callbacks, connectionFailedListener, GmsService.WEARABLE.ACTION);
    serviceId = GmsService.WEARABLE.SERVICE_ID;
    if (options != null && options.firstPartyMode)
        extras.putBoolean("firstPartyMode", true);
    Log.d(TAG, "<init>");
}
 
开发者ID:microg,项目名称:android_external_GmsLib,代码行数:8,代码来源:WearableClientImpl.java

示例5: getPlusService

import org.microg.gms.common.GmsService; //导入依赖的package包/类
@Deprecated
@Override
public void getPlusService(IGmsCallbacks callback, int versionCode, String packageName,
                           String authPackage, String[] scopes, String accountName, Bundle params)
        throws RemoteException {
    Bundle extras = params == null ? new Bundle() : params;
    extras.putString("auth_package", authPackage);
    callGetService(GmsService.PLUS, callback, versionCode, packageName, extras, accountName, scopes);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:10,代码来源:AbstractGmsServiceBroker.java

示例6: getGamesService

import org.microg.gms.common.GmsService; //导入依赖的package包/类
@Deprecated
@Override
public void getGamesService(IGmsCallbacks callback, int versionCode, String packageName,
                            String accountName, String[] scopes, String gamePackageName,
                            IBinder popupWindowToken, String desiredLocale, Bundle params)
        throws RemoteException {
    Bundle extras = params == null ? new Bundle() : params;
    extras.putString("com.google.android.gms.games.key.gamePackageName", gamePackageName);
    extras.putString("com.google.android.gms.games.key.desiredLocale", desiredLocale);
    //extras.putParcelable("com.google.android.gms.games.key.popupWindowToken", popupWindowToken);
    callGetService(GmsService.GAMES, callback, versionCode, packageName, extras, accountName, scopes);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:13,代码来源:AbstractGmsServiceBroker.java

示例7: callGetService

import org.microg.gms.common.GmsService; //导入依赖的package包/类
private void callGetService(GmsService service, IGmsCallbacks callback, int gmsVersion, String packageName, Bundle extras, String accountName, String[] scopes) throws RemoteException {
    GetServiceRequest request = new GetServiceRequest(service.SERVICE_ID);
    request.gmsVersion = gmsVersion;
    request.packageName = packageName;
    request.extras = extras;
    request.account = accountName == null ? null : new Account(accountName, "com.google");
    request.scopes = scopes == null ? null : scopesFromStringArray(scopes);
    getService(callback, request);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:10,代码来源:AbstractGmsServiceBroker.java

示例8: getService

import org.microg.gms.common.GmsService; //导入依赖的package包/类
@Override
public void getService(IGmsCallbacks callback, GetServiceRequest request) throws RemoteException {
    GmsService gmsService = GmsService.byServiceId(request.serviceId);
    if ((supportedServices.contains(gmsService)) || supportedServices.contains(GmsService.ANY)) {
        handleServiceRequest(callback, request, gmsService);
    } else {
        Log.d(TAG, "Service not supported: " + request);
        throw new IllegalArgumentException("Service not supported: " + request.serviceId);
    }
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:11,代码来源:AbstractGmsServiceBroker.java

示例9: handleServiceRequest

import org.microg.gms.common.GmsService; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
    String packageName = null;
    if (request.extras != null) {
        packageName = request.extras.getString(PARAM_GAME_PACKAGE_NAME);
    }
    if (packageName == null) packageName = GMS_PACKAGE_NAME;
    Intent intent = new Intent(ACTION_PLAY_GAMES_UPGRADE);
    intent.setPackage(GMS_PACKAGE_NAME);
    intent.putExtra(EXTRA_GAME_PACACKE_NAME, packageName);
    Bundle bundle = new Bundle();
    bundle.putParcelable("pendingIntent", PendingIntent.getActivity(this, packageName.hashCode(), intent, FLAG_UPDATE_CURRENT));
    callback.onPostInitComplete(CommonStatusCodes.RESOLUTION_REQUIRED, null, bundle);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:15,代码来源:GamesStubService.java

示例10: GoogleLocationManagerClient

import org.microg.gms.common.GmsService; //导入依赖的package包/类
public GoogleLocationManagerClient(Context context, GoogleApiClient.ConnectionCallbacks
        callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) {
    super(context, callbacks, connectionFailedListener, GmsService.LOCATION_MANAGER.ACTION);
}
 
开发者ID:microg,项目名称:android_external_GmsLib,代码行数:5,代码来源:GoogleLocationManagerClient.java

示例11: RemindersService

import org.microg.gms.common.GmsService; //导入依赖的package包/类
public RemindersService() {
    super("GmsRemindSvc", GmsService.REMINDERS);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:4,代码来源:RemindersService.java

示例12: handleServiceRequest

import org.microg.gms.common.GmsService; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
    callback.onPostInitComplete(0, new RemindersServiceImpl(), null);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:5,代码来源:RemindersService.java

示例13: DummyService

import org.microg.gms.common.GmsService; //导入依赖的package包/类
public DummyService() {
    super("GmsDummySvc", GmsService.ANY);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:4,代码来源:DummyService.java

示例14: handleServiceRequest

import org.microg.gms.common.GmsService; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
    callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:5,代码来源:DummyService.java

示例15: FeedbackService

import org.microg.gms.common.GmsService; //导入依赖的package包/类
public FeedbackService() {
    super("GmsFeedbackSvc", GmsService.FEEDBACK);
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:4,代码来源:FeedbackService.java


注:本文中的org.microg.gms.common.GmsService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。