本文整理汇总了Java中com.google.android.gms.common.internal.GetServiceRequest类的典型用法代码示例。如果您正苦于以下问题:Java GetServiceRequest类的具体用法?Java GetServiceRequest怎么用?Java GetServiceRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GetServiceRequest类属于com.google.android.gms.common.internal包,在下文中一共展示了GetServiceRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的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;
}
}
示例2: BaseService
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的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);
}
};
}
示例3: onConnectedToBroker
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
protected void onConnectedToBroker(IGmsServiceBroker broker, GmsCallbacks callbacks) throws RemoteException {
if (serviceId == -1) {
throw new IllegalStateException("Service ID not set in constructor and onConnectedToBroker not implemented");
}
GetServiceRequest request = new GetServiceRequest(serviceId);
request.extras = new Bundle();
request.packageName = context.getPackageName();
request.account = account;
request.extras = extras;
broker.getService(callbacks, request);
}
示例4: callGetService
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的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);
}
示例5: getService
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的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);
}
}
示例6: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的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);
}
示例7: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
callback.onPostInitComplete(0, new RemindersServiceImpl(), null);
}
示例8: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null);
}
示例9: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) {
// TODO
}
示例10: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
callback.onPostInitComplete(0, clearcutService.asBinder(), null);
}
示例11: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
PackageUtils.checkPackageUid(this, request.packageName, Binder.getCallingUid());
callback.onPostInitComplete(0, new WearableServiceImpl(this, getWearable(getApplicationContext()), request.packageName), null);
}
示例12: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
Log.d(TAG, "unimplemented Method: handleServiceRequest");
}
示例13: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
callback.onPostInitComplete(0, new SafetyNetClientServiceImpl(this, request.packageName), null);
}
示例14: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
callback.onPostInitComplete(0, impl.asBinder(), null);
}
示例15: handleServiceRequest
import com.google.android.gms.common.internal.GetServiceRequest; //导入依赖的package包/类
@Override
public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException {
callback.onPostInitComplete(0, reportingService.asBinder(), null);
}