@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; } }
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); } }; }
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); }
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); }
@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); } }
@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); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, new RemindersServiceImpl(), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) { // TODO }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, clearcutService.asBinder(), null); }
@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); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { Log.d(TAG, "unimplemented Method: handleServiceRequest"); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, new SafetyNetClientServiceImpl(this, request.packageName), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, impl.asBinder(), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, reportingService.asBinder(), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, playLogService.asBinder(), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, appDataSearch.asBinder(), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, new PlacesServiceImpl().asBinder(), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, new PlaceDetectionServiceImpl().asBinder(), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { callback.onPostInitComplete(0, new OwServiceImpl(this), null); }
@Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) { // TODO Log.d(TAG, "handleServiceRequest"); }
public abstract void a(eiw parameiw, GetServiceRequest paramGetServiceRequest);
public abstract void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException;