Java 类com.google.android.gms.common.api.GoogleApiClient.Builder 实例源码

项目:FMTech    文件:PackageVerificationLoggingService.java   
private GoogleApiClient createConnectedGoogleApiClient()
{
  try
  {
    GoogleApiClient localGoogleApiClient = new GoogleApiClient.Builder(this).addApi(ClearcutLogger.API).build();
    ConnectionResult localConnectionResult = localGoogleApiClient.blockingConnect(10000L, TimeUnit.MILLISECONDS);
    if (!localConnectionResult.isSuccess())
    {
      FinskyLog.w("Could not connect to Clearcut: %s", new Object[] { localConnectionResult });
      localGoogleApiClient = null;
    }
    return localGoogleApiClient;
  }
  catch (RuntimeException localRuntimeException)
  {
    FinskyLog.e("Could not connect to Clearcut: %s", new Object[] { localRuntimeException });
  }
  return null;
}
项目:FMTech    文件:NetworkQualityUploader.java   
public static void logNetworkStats$5480c1b1(Context paramContext, Long paramLong, Bundle paramBundle)
{
  if (!zzbkB) {
    return;
  }
  GoogleApiClient localGoogleApiClient = new GoogleApiClient.Builder(paramContext).addOnConnectionFailedListener(zzbkC).addApi(zzrr.API).build();
  localGoogleApiClient.connect();
  try
  {
    zzrr.zzbby.zza(localGoogleApiClient, null, paramLong, null, null, paramBundle).setResultCallback(new ResultCallback() {});
    return;
  }
  catch (RuntimeException localRuntimeException)
  {
    Log.w("Herrevad", "Exception in logNetworkStats.  This call should always fail silently, so we will swallow this: " + localRuntimeException);
  }
}
项目:FMTech    文件:SafetyNetFirstPartyClient.java   
public static String getId(Context paramContext)
{
  GoogleApiClient localGoogleApiClient = new GoogleApiClient.Builder(paramContext).addApi(SafetyNet.API).build();
  String str;
  if (!localGoogleApiClient.blockingConnect(15000L, TimeUnit.MILLISECONDS).isSuccess()) {
    str = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa";
  }
  for (;;)
  {
    return str;
    try
    {
      SafetyNetFirstPartyApi.IdResult localIdResult = (SafetyNetFirstPartyApi.IdResult)SafetyNet.SafetyNetFirstPartyApi.getId(localGoogleApiClient).await(15000L, TimeUnit.MILLISECONDS);
      localGoogleApiClient.disconnect();
      str = localIdResult.getId();
      if (str != null) {
        continue;
      }
      return "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa";
    }
    finally
    {
      localGoogleApiClient.disconnect();
    }
  }
}
项目:FirebaseUI-Android    文件:SaveSmartLock.java   
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == RC_SAVE) {
        if (resultCode != Activity.RESULT_OK) {
            Log.e(TAG, "SAVE: Canceled by user");
        }
        finish();
    } else if (requestCode == RC_UPDATE_SERVICE) {
        if (resultCode == Activity.RESULT_OK) {
            Credential credential = new Credential.Builder(mEmail).setPassword(mPassword)
                    .build();

            getAuthHelper().getCredentialsApi()
                    .save(mGoogleApiClient, credential)
                    .setResultCallback(this);
        } else {
            Log.e(TAG, "SAVE: Canceled by user");
            finish();
        }
    }
}
项目:FirebaseUI-Android    文件:SaveSmartLock.java   
/**
 * If SmartLock is enabled and Google Play Services is available, save the credentials.
 * Otherwise, finish the calling Activity with {@link Activity#RESULT_OK}.
 * <p>
 * Note: saveCredentialsOrFinish cannot be called immediately after getInstance because onCreate
 * has not yet been called.
 *
 * @param firebaseUser Firebase user to save in Credential.
 * @param password     (optional) password for email credential.
 * @param response     (optional) an {@link IdpResponse} representing the result of signing in.
 */
public void saveCredentialsOrFinish(FirebaseUser firebaseUser,
                                    @Nullable String password,
                                    @Nullable IdpResponse response) {
    mResponse = response;

    if (!getFlowParams().enableCredentials) {
        finish();
        return;
    }

    mName = firebaseUser.getDisplayName();
    mEmail = firebaseUser.getEmail();
    mPassword = password;
    mProfilePictureUri = firebaseUser.getPhotoUrl() != null ? firebaseUser.getPhotoUrl()
            .toString() : null;

    mGoogleApiClient = new Builder(mAppContext)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Auth.CREDENTIALS_API)
            .enableAutoManage(getActivity(), GoogleApiHelper.getSafeAutoManageId(), this)
            .build();
    mGoogleApiClient.connect();
}
项目:QuizUpWinner    文件:LoginActivity.java   
public void onCreate(Bundle paramBundle)
{
  super.onCreate(paramBundle);
  setContentView(2130903060);
  ς.ˊ(this);
  if (paramBundle != null)
    this.mShouldConnectPlusClient = paramBundle.getBoolean("plus_client_connection_state");
  this.uiHelper = new UiLifecycleHelper(this, this.callback);
  this.uiHelper.onCreate(paramBundle);
  Plus.PlusOptions localPlusOptions = new Plus.PlusOptions.Builder().addActivityTypes(new String[] { "http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity" }).build();
  this.mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API, localPlusOptions).addScope(Plus.SCOPE_PLUS_LOGIN).build();
  this.animationHelper = new LoginActivityAnimationHelper();
  this.animationHelper.onCreate(this, paramBundle);
  if (paramBundle == null)
    hideLoadingLayer();
}
项目:QuizUpWinner    文件:Ô¨ª.java   
private GoogleApiClient.Builder ˏ()
{
  if (this.)
    throw new IllegalStateException("GameHelper: you called GameHelper.createApiClientBuilder() after calling setup. You can only get a client builder BEFORE performing setup.");
  GoogleApiClient.Builder localBuilder = new GoogleApiClient.Builder(this.ˋ, this, this);
  if ((0x1 & this.ˏ) != 0)
  {
    localBuilder.addApi(Games.API, null);
    localBuilder.addScope(Games.SCOPE_GAMES);
  }
  if ((0x2 & this.ˏ) != 0)
  {
    localBuilder.addApi(Plus.API, null);
    localBuilder.addScope(Plus.SCOPE_PLUS_LOGIN);
  }
  if ((0x4 & this.ˏ) != 0)
  {
    localBuilder.addApi(AppStateManager.API, null);
    localBuilder.addScope(AppStateManager.SCOPE_APP_STATE);
  }
  this.ˉ = localBuilder;
  return localBuilder;
}
项目:assistance-platform-client-sdk-android    文件:MotionActivitySensor.java   
@NonNull
public GoogleApiClient getGoogleApiClient() {

    return new Builder(context)
            .addApi(ActivityRecognition.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
}
项目:assistance-platform-client-sdk-android    文件:LocationSensor.java   
@NonNull
private GoogleApiClient getGoogleApiClient() {

    if (mGoogleApiClient != null) {
        return mGoogleApiClient;
    }

    return new Builder(context)
            .addApi(LocationServices.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
}
项目:FMTech    文件:MainActivity.java   
private boolean showErrorDialogForCode(String paramString1, String paramString2, int paramInt, String paramString3)
{
  PackageStateRepository.PackageState localPackageState = FinskyApp.get().mPackageStateRepository.get(paramString3);
  switch (paramInt)
  {
  }
  for (;;)
  {
    showErrorDialog(paramString1, paramString2, false);
    return true;
    if (FinskyApp.get().getExperiments().isEnabled(12603367L))
    {
      startActivity(UninstallManagerActivity.createIntent(this.mNavigationManager.getCurrentDocument()));
      return true;
      if ((localPackageState != null) && (localPackageState.isSystemApp)) {}
      for (int i = 1; i == 0; i = 0)
      {
        SimpleAlertDialog.Builder localBuilder = new SimpleAlertDialog.Builder();
        localBuilder.setMessageId(2131362246).setPositiveId(2131362418).setNegativeId(2131362807);
        Bundle localBundle = new Bundle();
        localBundle.putString("error_package_name", paramString3);
        localBuilder.setCallback(null, 32, localBundle);
        localBuilder.build().show(getSupportFragmentManager(), "mismatched_certificates");
        return true;
      }
    }
  }
}
项目:sprockets-android    文件:GoogleLocationProvider.java   
@Override
public Maybe<LocationSettingsResult> checkLocationSettings(int priority) {
    return Maybe.create(emitter -> {
        GoogleApiClient client = mBuilder.build();
        GoogleApiClients.connect(client, hint -> SettingsApi.checkLocationSettings(client,
                new LocationSettingsRequest.Builder()
                        .addLocationRequest(LocationRequest.create().setPriority(priority))
                        .setAlwaysShow(true).build()).setResultCallback(result -> {
            client.disconnect();
            emitter.onSuccess(result);
        }), result -> emitter.onComplete());
    });
}
项目:FirebaseUI-Android    文件:SaveSmartLock.java   
@Override
public void onConnected(Bundle bundle) {
    if (TextUtils.isEmpty(mEmail)) {
        Log.e(TAG, "Unable to save null credential!");
        finish();
        return;
    }

    Credential.Builder builder = new Credential.Builder(mEmail);
    builder.setPassword(mPassword);
    if (mPassword == null && mResponse != null) {
        String translatedProvider =
                ProviderUtils.providerIdToAccountType(mResponse.getProviderType());
        if (translatedProvider != null) {
            builder.setAccountType(translatedProvider);
        } else {
            Log.e(TAG, "Unable to save null credential!");
            finish();
            return;
        }
    }

    if (mName != null) {
        builder.setName(mName);
    }

    if (mProfilePictureUri != null) {
        builder.setProfilePictureUri(Uri.parse(mProfilePictureUri));
    }

    getAuthHelper().getCredentialsApi()
            .save(mGoogleApiClient, builder.build())
            .setResultCallback(this);
}
项目:QuizUpWinner    文件:SettingsFragment.java   
private static AlertDialog createMatchDialog(View paramView, Context paramContext)
{
  AlertDialog localAlertDialog = new AlertDialog.Builder(paramContext).create();
  localAlertDialog.setCanceledOnTouchOutside(true);
  localAlertDialog.setView(paramView, 0, 0, 0, 0);
  return localAlertDialog;
}
项目:QuizUpWinner    文件:GooglePlusFriendsFragment.java   
public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
{
  View localView = LayoutInflater.from(getActivity()).inflate(2130903121, paramViewGroup, false);
  this.refreshLoader = ((LoaderAnimationWidget)localView.findViewById(2131296657));
  initEmptyView(localView);
  boolean bool;
  if (!TextUtils.isEmpty(QuizApplication.ˊ.ˋ.ʹ))
    bool = true;
  else
    bool = false;
  this.shouldConnectPlusClient = bool;
  Plus.PlusOptions localPlusOptions = new Plus.PlusOptions.Builder().addActivityTypes(new String[] { "http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity" }).build();
  this.mGoogleApiClient = new GoogleApiClient.Builder(getActivity()).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API, localPlusOptions).addScope(Plus.SCOPE_PLUS_LOGIN).build();
  return localView;
}
项目:QuizUpWinner    文件:GooglePlusFriendsFragment.java   
protected void sendRequestDialog( paramℴ)
{
  this.invitedFriend = paramℴ;
  ArrayList localArrayList = new ArrayList();
  localArrayList.add(PlusShare.createPerson(paramℴ.ˊ, paramℴ.ˋ));
  startActivityForResult(new PlusShare.Builder(getActivity()).setType("text/plain").setText(ċ.ˊ(2131165775)).setContentUrl(Uri.parse("https://www.quizup.com/")).setRecipients(Plus.PeopleApi.getCurrentPerson(this.mGoogleApiClient), localArrayList).getIntent(), 9002);
  .ˊ("Viral", new HashMap()
  {
  });
}
项目:FMTech    文件:Car.java   
public static GoogleApiClient buildGoogleApiClientForCar(Context paramContext, GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener, CarConnectionListener paramCarConnectionListener)
{
  return new GoogleApiClient.Builder(paramContext).addApi(API, new CarOptions(new Car.CarOptions.Builder(paramCarConnectionListener, (byte)0), (byte)0)).addConnectionCallbacks(paramConnectionCallbacks).addOnConnectionFailedListener(paramOnConnectionFailedListener).build();
}
项目:FMTech    文件:Car.java   
private CarOptions(Builder paramBuilder)
{
  this.zzabE = paramBuilder.zzabF;
}
项目:FMTech    文件:Car.java   
private Builder(Car.CarConnectionListener paramCarConnectionListener)
{
  this.zzabF = paramCarConnectionListener;
}
项目:FMTech    文件:GoogleHelpLauncher.java   
public GoogleHelpLauncher(Activity paramActivity)
{
  this(paramActivity, new GoogleApiClient.Builder(paramActivity).addApi(zzc.API).build());
}
项目:FMTech    文件:zzi.java   
public zzi(Context paramContext)
{
  this.mApiClient = new GoogleApiClient.Builder(paramContext).addApi(zzc.API).build();
}
项目:FMTech    文件:MainActivity.java   
private void showRestartRequiredDialog()
{
  SimpleAlertDialog.Builder localBuilder = new SimpleAlertDialog.Builder();
  localBuilder.setCallback(null, 41, null).setMessageId(2131362661).setPositiveId(2131362418).setCanceledOnTouchOutside(false);
  localBuilder.build().show(getSupportFragmentManager(), "restart_required");
}
项目:sprockets-android    文件:GoogleLocationProvider.java   
@Inject
public GoogleLocationProvider(Context context) {
    mBuilder = new Builder(context.getApplicationContext()).addApi(LocationServices.API);
}
项目:QuizUpWinner    文件:QuizApplication.java   
public final void ͺ()
{
  if (this.ـ != null)
  {
     localフ = this.ـ;
    localフ.ˎ.ˊ();
    localフ.ˋ.unregisterActivityLifecycleCallbacks(localフ);
    localフ.ˎ = null;
    this.ـ = null;
  }
  if (Session.getActiveSession() != null)
    Session.getActiveSession().closeAndClearTokenInformation();
  Session.setActiveSession(null);
  int i;
  if (!TextUtils.isEmpty(this.ˋ.ʹ))
    i = 1;
  else
    i = 0;
  if (i != 0)
  {
    this.ʹ = new GoogleApiClient.Builder(this).addConnectionCallbacks(this.ՙ).addOnConnectionFailedListener(this.י).addApi(Plus.API).build();
    if (this.ʹ.isConnected())
    {
      Plus.AccountApi.clearDefaultAccount(this.ʹ);
      this.ʹ.disconnect();
    }
    else
    {
      this.ʹ.connect();
    }
  }
  ċ.ˊ.ˊ(ċ.ˋ());
  boolean bool1 = .ˋ(ϛ.ˊ.toString());
  boolean bool2 = .ˏ("fb_permission_requested").isEmpty();
  int j = 0;
  if (!bool2)
  {
    String str = .ˏ("fb_permission_requested");
    j = 0;
    if (str != null)
      j = 1;
  }
  .ˋ();
  .ˊ("is_not_fresh", "notfresh");
  if (j != 0)
    .ˊ("fb_permission_requested", "fb_requested");
  .ˊ(ϛ.ˊ.toString(), bool1);
  ˊ.ˊ(null);
  .ˎ();
  .ˊ.removeAllCacheFiles();
  DBCacheManager.getInstance().flushTopicWidgetCache();
  this..ˊ();
  this.ʻ.ˊ();
}
项目:QuizUpWinner    文件:Ô¨ª.java   
public static AlertDialog ˊ(Activity paramActivity, String paramString)
{
  return new AlertDialog.Builder(paramActivity).setMessage(paramString).setNeutralButton(17039370, null).create();
}
项目:QuizUpWinner    文件:Ô¨ª.java   
public static AlertDialog ˊ(Activity paramActivity, String paramString1, String paramString2)
{
  return new AlertDialog.Builder(paramActivity).setMessage(paramString2).setTitle(paramString1).setNeutralButton(17039370, null).create();
}