zzaat.java 25.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932
package com.google.android.gms.internal;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.common.api.Api;
import com.google.android.gms.common.api.Api.zza;
import com.google.android.gms.common.api.Api.zzb;
import com.google.android.gms.common.api.Api.zzc;
import com.google.android.gms.common.api.Api.zze;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.Builder;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.Result;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.internal.zzac;
import com.google.android.gms.common.internal.zzg;
import com.google.android.gms.common.internal.zzm;
import com.google.android.gms.common.internal.zzm.zza;
import hq;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;

public final class zzaat
  extends GoogleApiClient
  implements zzabc.zza
{
  final Queue<zzaad.zza<?, ?>> a = new LinkedList();
  zzaaz b;
  final Map<Api.zzc<?>, Api.zze> c;
  Set<Scope> d = new HashSet();
  final zzg e;
  final Map<Api<?>, Boolean> f;
  final Api.zza<? extends zzbai, zzbaj> g;
  Set<zzabx> h = null;
  final zzaby i;
  private final Lock j;
  private boolean k;
  private final zzm l;
  private zzabc m = null;
  private final int n;
  private final Context o;
  private final Looper p;
  private volatile boolean q;
  private long r = 120000L;
  private long s = 5000L;
  private final a t;
  private final GoogleApiAvailability u;
  private final zzabi v = new zzabi();
  private final ArrayList<zzaag> w;
  private Integer x = null;
  private final zzm.zza y = new zzm.zza()
  {
    public final boolean isConnected()
    {
      return zzaat.this.isConnected();
    }
    
    public final Bundle zzuC()
    {
      return null;
    }
  };
  
  public zzaat(Context paramContext, Lock paramLock, Looper paramLooper, zzg paramzzg, GoogleApiAvailability paramGoogleApiAvailability, Api.zza<? extends zzbai, zzbaj> paramzza, Map<Api<?>, Boolean> paramMap, List<GoogleApiClient.ConnectionCallbacks> paramList, List<GoogleApiClient.OnConnectionFailedListener> paramList1, Map<Api.zzc<?>, Api.zze> paramMap1, int paramInt1, int paramInt2, ArrayList<zzaag> paramArrayList, boolean paramBoolean)
  {
    this.o = paramContext;
    this.j = paramLock;
    this.k = paramBoolean;
    this.l = new zzm(paramLooper, this.y);
    this.p = paramLooper;
    this.t = new a(paramLooper);
    this.u = paramGoogleApiAvailability;
    this.n = paramInt1;
    if (this.n >= 0) {
      this.x = Integer.valueOf(paramInt2);
    }
    this.f = paramMap;
    this.c = paramMap1;
    this.w = paramArrayList;
    this.i = new zzaby(this.c);
    paramContext = paramList.iterator();
    while (paramContext.hasNext())
    {
      paramLock = (GoogleApiClient.ConnectionCallbacks)paramContext.next();
      this.l.registerConnectionCallbacks(paramLock);
    }
    paramContext = paramList1.iterator();
    while (paramContext.hasNext())
    {
      paramLock = (GoogleApiClient.OnConnectionFailedListener)paramContext.next();
      this.l.registerConnectionFailedListener(paramLock);
    }
    this.e = paramzzg;
    this.g = paramzza;
  }
  
  private void a(int paramInt)
  {
    if (this.x == null) {
      this.x = Integer.valueOf(paramInt);
    }
    Object localObject2;
    while (this.m != null)
    {
      return;
      if (this.x.intValue() != paramInt)
      {
        localObject1 = String.valueOf(b(paramInt));
        localObject2 = String.valueOf(b(this.x.intValue()));
        throw new IllegalStateException(String.valueOf(localObject1).length() + 51 + String.valueOf(localObject2).length() + "Cannot use sign-in mode: " + (String)localObject1 + ". Mode was already set to " + (String)localObject2);
      }
    }
    Object localObject1 = this.c.values().iterator();
    paramInt = 0;
    int i1 = 0;
    if (((Iterator)localObject1).hasNext())
    {
      localObject2 = (Api.zze)((Iterator)localObject1).next();
      if (((Api.zze)localObject2).zzrd()) {
        i1 = 1;
      }
      if (!((Api.zze)localObject2).zzrr()) {
        break label457;
      }
      paramInt = 1;
    }
    label457:
    for (;;)
    {
      break;
      switch (this.x.intValue())
      {
      }
      while ((this.k) && (paramInt == 0))
      {
        this.m = new zzaak(this.o, this.j, this.p, this.u, this.c, this.e, this.f, this.g, this.w, this, false);
        return;
        if (i1 == 0) {
          throw new IllegalStateException("SIGN_IN_MODE_REQUIRED cannot be used on a GoogleApiClient that does not contain any authenticated APIs. Use connect() instead.");
        }
        if (paramInt != 0)
        {
          throw new IllegalStateException("Cannot use SIGN_IN_MODE_REQUIRED with GOOGLE_SIGN_IN_API. Use connect(SIGN_IN_MODE_OPTIONAL) instead.");
          if (i1 != 0)
          {
            if (this.k)
            {
              this.m = new zzaak(this.o, this.j, this.p, this.u, this.c, this.e, this.f, this.g, this.w, this, true);
              return;
            }
            this.m = hq.a(this.o, this, this.j, this.p, this.u, this.c, this.e, this.f, this.g, this.w);
            return;
          }
        }
      }
      this.m = new zzaav(this.o, this, this.j, this.p, this.u, this.c, this.e, this.f, this.g, this.w, this);
      return;
    }
  }
  
  private void a(final GoogleApiClient paramGoogleApiClient, final zzabt paramzzabt, final boolean paramBoolean)
  {
    zzacf.zzaGM.zzg(paramGoogleApiClient).setResultCallback(new ResultCallback() {});
  }
  
  private static String b(int paramInt)
  {
    switch (paramInt)
    {
    default: 
      return "UNKNOWN";
    case 3: 
      return "SIGN_IN_MODE_NONE";
    case 1: 
      return "SIGN_IN_MODE_REQUIRED";
    }
    return "SIGN_IN_MODE_OPTIONAL";
  }
  
  private void e()
  {
    this.l.zzxY();
    this.m.connect();
  }
  
  public static int zza(Iterable<Api.zze> paramIterable, boolean paramBoolean)
  {
    int i3 = 1;
    paramIterable = paramIterable.iterator();
    int i1 = 0;
    int i2 = 0;
    if (paramIterable.hasNext())
    {
      Api.zze localzze = (Api.zze)paramIterable.next();
      if (localzze.zzrd()) {
        i2 = 1;
      }
      if (!localzze.zzrr()) {
        break label85;
      }
      i1 = 1;
    }
    label85:
    for (;;)
    {
      break;
      if (i2 != 0)
      {
        i2 = i3;
        if (i1 != 0)
        {
          i2 = i3;
          if (paramBoolean) {
            i2 = 2;
          }
        }
        return i2;
      }
      return 3;
    }
  }
  
  final boolean b()
  {
    if (!this.q) {
      return false;
    }
    this.q = false;
    this.t.removeMessages(2);
    this.t.removeMessages(1);
    if (this.b != null)
    {
      this.b.unregister();
      this.b = null;
    }
    return true;
  }
  
  public final ConnectionResult blockingConnect()
  {
    boolean bool2 = true;
    boolean bool1;
    if (Looper.myLooper() != Looper.getMainLooper()) {
      bool1 = true;
    }
    for (;;)
    {
      zzac.zza(bool1, "blockingConnect must not be called on the UI thread");
      this.j.lock();
      try
      {
        if (this.n >= 0) {
          if (this.x != null)
          {
            bool1 = bool2;
            label45:
            zzac.zza(bool1, "Sign-in mode should have been set explicitly by auto-manage.");
          }
        }
        do
        {
          for (;;)
          {
            a(this.x.intValue());
            this.l.zzxY();
            ConnectionResult localConnectionResult = this.m.blockingConnect();
            return localConnectionResult;
            bool1 = false;
            break;
            bool1 = false;
            break label45;
            if (this.x != null) {
              break label143;
            }
            this.x = Integer.valueOf(zza(this.c.values(), false));
          }
        } while (this.x.intValue() != 2);
      }
      finally
      {
        this.j.unlock();
      }
    }
    label143:
    throw new IllegalStateException("Cannot call blockingConnect() when sign-in mode is set to SIGN_IN_MODE_OPTIONAL. Call connect(SIGN_IN_MODE_OPTIONAL) instead.");
  }
  
  public final ConnectionResult blockingConnect(long paramLong, @NonNull TimeUnit paramTimeUnit)
  {
    boolean bool = false;
    if (Looper.myLooper() != Looper.getMainLooper()) {
      bool = true;
    }
    zzac.zza(bool, "blockingConnect must not be called on the UI thread");
    zzac.zzb(paramTimeUnit, "TimeUnit must not be null");
    this.j.lock();
    try
    {
      if (this.x == null) {
        this.x = Integer.valueOf(zza(this.c.values(), false));
      }
      while (this.x.intValue() != 2)
      {
        a(this.x.intValue());
        this.l.zzxY();
        paramTimeUnit = this.m.blockingConnect(paramLong, paramTimeUnit);
        return paramTimeUnit;
      }
      throw new IllegalStateException("Cannot call blockingConnect() when sign-in mode is set to SIGN_IN_MODE_OPTIONAL. Call connect(SIGN_IN_MODE_OPTIONAL) instead.");
    }
    finally
    {
      this.j.unlock();
    }
  }
  
  final boolean c()
  {
    boolean bool1 = false;
    this.j.lock();
    try
    {
      Set localSet = this.h;
      if (localSet == null) {
        return false;
      }
      boolean bool2 = this.h.isEmpty();
      if (!bool2) {
        bool1 = true;
      }
      return bool1;
    }
    finally
    {
      this.j.unlock();
    }
  }
  
  public final PendingResult<Status> clearDefaultAccountAndReconnect()
  {
    zzac.zza(isConnected(), "GoogleApiClient is not connected yet.");
    if (this.x.intValue() != 2) {}
    final zzabt localzzabt;
    for (boolean bool = true;; bool = false)
    {
      zzac.zza(bool, "Cannot use clearDefaultAccountAndReconnect with GOOGLE_SIGN_IN_API");
      localzzabt = new zzabt(this);
      if (!this.c.containsKey(zzacf.zzaid)) {
        break;
      }
      a(this, localzzabt, false);
      return localzzabt;
    }
    final AtomicReference localAtomicReference = new AtomicReference();
    Object localObject = new GoogleApiClient.ConnectionCallbacks()
    {
      public final void onConnected(Bundle paramAnonymousBundle)
      {
        zzaat.a(zzaat.this, (GoogleApiClient)localAtomicReference.get(), localzzabt);
      }
      
      public final void onConnectionSuspended(int paramAnonymousInt) {}
    };
    GoogleApiClient.OnConnectionFailedListener local3 = new GoogleApiClient.OnConnectionFailedListener()
    {
      public final void onConnectionFailed(@NonNull ConnectionResult paramAnonymousConnectionResult)
      {
        zzaat.this.zzb(new Status(8));
      }
    };
    localObject = new GoogleApiClient.Builder(this.o).addApi(zzacf.API).addConnectionCallbacks((GoogleApiClient.ConnectionCallbacks)localObject).addOnConnectionFailedListener(local3).setHandler(this.t).build();
    localAtomicReference.set(localObject);
    ((GoogleApiClient)localObject).connect();
    return localzzabt;
  }
  
  public final void connect()
  {
    boolean bool = false;
    this.j.lock();
    try
    {
      if (this.n >= 0)
      {
        if (this.x != null) {
          bool = true;
        }
        zzac.zza(bool, "Sign-in mode should have been set explicitly by auto-manage.");
      }
      do
      {
        for (;;)
        {
          connect(this.x.intValue());
          return;
          if (this.x != null) {
            break;
          }
          this.x = Integer.valueOf(zza(this.c.values(), false));
        }
      } while (this.x.intValue() != 2);
    }
    finally
    {
      this.j.unlock();
    }
    throw new IllegalStateException("Cannot call connect() when SignInMode is set to SIGN_IN_MODE_OPTIONAL. Call connect(SIGN_IN_MODE_OPTIONAL) instead.");
  }
  
  /* Error */
  public final void connect(int paramInt)
  {
    // Byte code:
    //   0: iconst_1
    //   1: istore_3
    //   2: aload_0
    //   3: getfield 114	com/google/android/gms/internal/zzaat:j	Ljava/util/concurrent/locks/Lock;
    //   6: invokeinterface 288 1 0
    //   11: iload_3
    //   12: istore_2
    //   13: iload_1
    //   14: iconst_3
    //   15: if_icmpeq +17 -> 32
    //   18: iload_3
    //   19: istore_2
    //   20: iload_1
    //   21: iconst_1
    //   22: if_icmpeq +10 -> 32
    //   25: iload_1
    //   26: iconst_2
    //   27: if_icmpne +50 -> 77
    //   30: iload_3
    //   31: istore_2
    //   32: iload_2
    //   33: new 205	java/lang/StringBuilder
    //   36: dup
    //   37: bipush 33
    //   39: invokespecial 210	java/lang/StringBuilder:<init>	(I)V
    //   42: ldc_w 449
    //   45: invokevirtual 216	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   48: iload_1
    //   49: invokevirtual 452	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   52: invokevirtual 222	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   55: invokestatic 454	com/google/android/gms/common/internal/zzac:zzb	(ZLjava/lang/Object;)V
    //   58: aload_0
    //   59: iload_1
    //   60: invokespecial 355	com/google/android/gms/internal/zzaat:a	(I)V
    //   63: aload_0
    //   64: invokespecial 292	com/google/android/gms/internal/zzaat:e	()V
    //   67: aload_0
    //   68: getfield 114	com/google/android/gms/internal/zzaat:j	Ljava/util/concurrent/locks/Lock;
    //   71: invokeinterface 295 1 0
    //   76: return
    //   77: iconst_0
    //   78: istore_2
    //   79: goto -47 -> 32
    //   82: astore 4
    //   84: aload_0
    //   85: getfield 114	com/google/android/gms/internal/zzaat:j	Ljava/util/concurrent/locks/Lock;
    //   88: invokeinterface 295 1 0
    //   93: aload 4
    //   95: athrow
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	96	0	this	zzaat
    //   0	96	1	paramInt	int
    //   12	67	2	bool1	boolean
    //   1	30	3	bool2	boolean
    //   82	12	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   32	67	82	finally
  }
  
  final String d()
  {
    StringWriter localStringWriter = new StringWriter();
    dump("", null, new PrintWriter(localStringWriter), null);
    return localStringWriter.toString();
  }
  
  public final void disconnect()
  {
    this.j.lock();
    try
    {
      this.i.release();
      if (this.m != null) {
        this.m.disconnect();
      }
      this.v.release();
      Iterator localIterator = this.a.iterator();
      while (localIterator.hasNext())
      {
        zzaad.zza localzza = (zzaad.zza)localIterator.next();
        localzza.zza(null);
        localzza.cancel();
      }
      this.a.clear();
    }
    finally
    {
      this.j.unlock();
    }
    zzabc localzzabc = this.m;
    if (localzzabc == null)
    {
      this.j.unlock();
      return;
    }
    b();
    this.l.zzxX();
    this.j.unlock();
  }
  
  public final void dump(String paramString, FileDescriptor paramFileDescriptor, PrintWriter paramPrintWriter, String[] paramArrayOfString)
  {
    paramPrintWriter.append(paramString).append("mContext=").println(this.o);
    paramPrintWriter.append(paramString).append("mResuming=").print(this.q);
    paramPrintWriter.append(" mWorkQueue.size()=").print(this.a.size());
    this.i.dump(paramPrintWriter);
    if (this.m != null) {
      this.m.dump(paramString, paramFileDescriptor, paramPrintWriter, paramArrayOfString);
    }
  }
  
  @NonNull
  public final ConnectionResult getConnectionResult(@NonNull Api<?> paramApi)
  {
    this.j.lock();
    try
    {
      if ((!isConnected()) && (!this.q)) {
        throw new IllegalStateException("Cannot invoke getConnectionResult unless GoogleApiClient is connected");
      }
    }
    finally
    {
      this.j.unlock();
    }
    if (this.c.containsKey(paramApi.zzvg()))
    {
      ConnectionResult localConnectionResult = this.m.getConnectionResult(paramApi);
      if (localConnectionResult == null)
      {
        if (this.q)
        {
          paramApi = ConnectionResult.zzayj;
          this.j.unlock();
          return paramApi;
        }
        Log.w("GoogleApiClientImpl", d());
        Log.wtf("GoogleApiClientImpl", String.valueOf(paramApi.getName()).concat(" requested in getConnectionResult is not connected but is not present in the failed  connections map"), new Exception());
        paramApi = new ConnectionResult(8, null);
        this.j.unlock();
        return paramApi;
      }
      this.j.unlock();
      return localConnectionResult;
    }
    throw new IllegalArgumentException(String.valueOf(paramApi.getName()).concat(" was never registered with GoogleApiClient"));
  }
  
  public final Context getContext()
  {
    return this.o;
  }
  
  public final Looper getLooper()
  {
    return this.p;
  }
  
  public final int getSessionId()
  {
    return System.identityHashCode(this);
  }
  
  public final boolean hasConnectedApi(@NonNull Api<?> paramApi)
  {
    if (!isConnected()) {
      return false;
    }
    paramApi = (Api.zze)this.c.get(paramApi.zzvg());
    return (paramApi != null) && (paramApi.isConnected());
  }
  
  public final boolean isConnected()
  {
    return (this.m != null) && (this.m.isConnected());
  }
  
  public final boolean isConnecting()
  {
    return (this.m != null) && (this.m.isConnecting());
  }
  
  public final boolean isConnectionCallbacksRegistered(@NonNull GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
  {
    return this.l.isConnectionCallbacksRegistered(paramConnectionCallbacks);
  }
  
  public final boolean isConnectionFailedListenerRegistered(@NonNull GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
  {
    return this.l.isConnectionFailedListenerRegistered(paramOnConnectionFailedListener);
  }
  
  public final void reconnect()
  {
    disconnect();
    connect();
  }
  
  public final void registerConnectionCallbacks(@NonNull GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
  {
    this.l.registerConnectionCallbacks(paramConnectionCallbacks);
  }
  
  public final void registerConnectionFailedListener(@NonNull GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
  {
    this.l.registerConnectionFailedListener(paramOnConnectionFailedListener);
  }
  
  public final void stopAutoManage(@NonNull FragmentActivity paramFragmentActivity)
  {
    paramFragmentActivity = new zzabd(paramFragmentActivity);
    if (this.n >= 0)
    {
      zzaaa.zza(paramFragmentActivity).zzcA(this.n);
      return;
    }
    throw new IllegalStateException("Called stopAutoManage but automatic lifecycle management is not enabled.");
  }
  
  public final void unregisterConnectionCallbacks(@NonNull GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
  {
    this.l.unregisterConnectionCallbacks(paramConnectionCallbacks);
  }
  
  public final void unregisterConnectionFailedListener(@NonNull GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
  {
    this.l.unregisterConnectionFailedListener(paramOnConnectionFailedListener);
  }
  
  @NonNull
  public final <C extends Api.zze> C zza(@NonNull Api.zzc<C> paramzzc)
  {
    paramzzc = (Api.zze)this.c.get(paramzzc);
    zzac.zzb(paramzzc, "Appropriate Api was not requested.");
    return paramzzc;
  }
  
  public final <A extends Api.zzb, R extends Result, T extends zzaad.zza<R, A>> T zza(@NonNull T paramT)
  {
    boolean bool;
    if (paramT.zzvg() != null) {
      bool = true;
    }
    for (;;)
    {
      zzac.zzb(bool, "This task can not be enqueued (it's probably a Batch or malformed)");
      bool = this.c.containsKey(paramT.zzvg());
      String str;
      if (paramT.getApi() != null)
      {
        str = paramT.getApi().getName();
        label45:
        zzac.zzb(bool, String.valueOf(str).length() + 65 + "GoogleApiClient is not configured to use " + str + " required for this call.");
        this.j.lock();
      }
      try
      {
        if (this.m == null)
        {
          this.a.add(paramT);
          return paramT;
          bool = false;
          continue;
          str = "the API";
          break label45;
        }
        paramT = this.m.zza(paramT);
        return paramT;
      }
      finally
      {
        this.j.unlock();
      }
    }
  }
  
  public final void zza(zzabx paramzzabx)
  {
    this.j.lock();
    try
    {
      if (this.h == null) {
        this.h = new HashSet();
      }
      this.h.add(paramzzabx);
      return;
    }
    finally
    {
      this.j.unlock();
    }
  }
  
  public final boolean zza(@NonNull Api<?> paramApi)
  {
    return this.c.containsKey(paramApi.zzvg());
  }
  
  public final boolean zza(zzabq paramzzabq)
  {
    return (this.m != null) && (this.m.zza(paramzzabq));
  }
  
  public final <A extends Api.zzb, T extends zzaad.zza<? extends Result, A>> T zzb(@NonNull T paramT)
  {
    boolean bool;
    if (paramT.zzvg() != null)
    {
      bool = true;
      zzac.zzb(bool, "This task can not be executed (it's probably a Batch or malformed)");
      bool = this.c.containsKey(paramT.zzvg());
      if (paramT.getApi() == null) {
        break label129;
      }
    }
    label129:
    for (Object localObject = paramT.getApi().getName();; localObject = "the API")
    {
      zzac.zzb(bool, String.valueOf(localObject).length() + 65 + "GoogleApiClient is not configured to use " + (String)localObject + " required for this call.");
      this.j.lock();
      try
      {
        if (this.m != null) {
          break label136;
        }
        throw new IllegalStateException("GoogleApiClient is not connected yet.");
      }
      finally
      {
        this.j.unlock();
      }
      bool = false;
      break;
    }
    label136:
    if (this.q)
    {
      this.a.add(paramT);
      while (!this.a.isEmpty())
      {
        localObject = (zzaad.zza)this.a.remove();
        this.i.a((zzaaf)localObject);
        ((zzaad.zza)localObject).zzB(Status.zzazz);
      }
      this.j.unlock();
      return paramT;
    }
    paramT = this.m.zzb(paramT);
    this.j.unlock();
    return paramT;
  }
  
  public final void zzb(zzabx paramzzabx)
  {
    this.j.lock();
    for (;;)
    {
      try
      {
        if (this.h == null)
        {
          Log.wtf("GoogleApiClientImpl", "Attempted to remove pending transform when no transforms are registered.", new Exception());
          return;
        }
        if (!this.h.remove(paramzzabx))
        {
          Log.wtf("GoogleApiClientImpl", "Failed to remove pending transform - this may lead to memory leaks!", new Exception());
          continue;
        }
        if (c()) {
          continue;
        }
      }
      finally
      {
        this.j.unlock();
      }
      this.m.zzvM();
    }
  }
  
  public final void zzc(int paramInt, boolean paramBoolean)
  {
    if ((paramInt == 1) && (!paramBoolean) && (!this.q))
    {
      this.q = true;
      if (this.b == null) {
        this.b = this.u.zza(this.o.getApplicationContext(), new b(this));
      }
      this.t.sendMessageDelayed(this.t.obtainMessage(1), this.r);
      this.t.sendMessageDelayed(this.t.obtainMessage(2), this.s);
    }
    this.i.zzxd();
    this.l.zzcV(paramInt);
    this.l.zzxX();
    if (paramInt == 2) {
      e();
    }
  }
  
  public final void zzc(ConnectionResult paramConnectionResult)
  {
    if (!this.u.zzd(this.o, paramConnectionResult.getErrorCode())) {
      b();
    }
    if (!this.q)
    {
      this.l.zzn(paramConnectionResult);
      this.l.zzxX();
    }
  }
  
  public final void zzo(Bundle paramBundle)
  {
    while (!this.a.isEmpty()) {
      zzb((zzaad.zza)this.a.remove());
    }
    this.l.zzq(paramBundle);
  }
  
  public final <L> zzabh<L> zzr(@NonNull L paramL)
  {
    this.j.lock();
    try
    {
      paramL = this.v.zzb(paramL, this.p);
      return paramL;
    }
    finally
    {
      this.j.unlock();
    }
  }
  
  public final void zzvn()
  {
    if (this.m != null) {
      this.m.zzvn();
    }
  }
  
  final class a
    extends Handler
  {
    a(Looper paramLooper)
    {
      super();
    }
    
    public final void handleMessage(Message paramMessage)
    {
      switch (paramMessage.what)
      {
      default: 
        int i = paramMessage.what;
        Log.w("GoogleApiClientImpl", 31 + "Unknown message id: " + i);
        return;
      case 1: 
        zzaat.b(zzaat.this);
        return;
      }
      zzaat.a(zzaat.this);
    }
  }
  
  static final class b
    extends zzaaz.zza
  {
    private WeakReference<zzaat> a;
    
    b(zzaat paramzzaat)
    {
      this.a = new WeakReference(paramzzaat);
    }
    
    public final void zzvE()
    {
      zzaat localzzaat = (zzaat)this.a.get();
      if (localzzaat == null) {
        return;
      }
      zzaat.a(localzzaat);
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/google/android/gms/internal/zzaat.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */