本文整理汇总了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;
}
}
示例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);
}
};
}
示例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)) +
'}';
}
示例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>");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例11: RemindersService
import org.microg.gms.common.GmsService; //导入依赖的package包/类
public RemindersService() {
super("GmsRemindSvc", GmsService.REMINDERS);
}
示例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);
}
示例13: DummyService
import org.microg.gms.common.GmsService; //导入依赖的package包/类
public DummyService() {
super("GmsDummySvc", GmsService.ANY);
}
示例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);
}
示例15: FeedbackService
import org.microg.gms.common.GmsService; //导入依赖的package包/类
public FeedbackService() {
super("GmsFeedbackSvc", GmsService.FEEDBACK);
}