zzf.java 29.1 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 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026
package com.google.android.gms.common.internal;

import android.accounts.Account;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.DeadObjectException;
import android.os.Handler;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.support.annotation.BinderThread;
import android.support.annotation.CallSuper;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.zzc;
import com.google.android.gms.common.zze;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Locale;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

public abstract class zzf<T extends IInterface>
{
  public static final String[] zzaFs = { "service_esmobile", "service_googleme" };
  final Handler a;
  private int b;
  private long c;
  private long d;
  private int e;
  private long f;
  private final Context g;
  private final Looper h;
  private final zzn i;
  private final zze j;
  private final Object k = new Object();
  private final Object l = new Object();
  private zzv m;
  private T n;
  private final ArrayList<zze<?>> o = new ArrayList();
  private zzh p;
  private int q = 1;
  private final zzb r;
  private final zzc s;
  private final int t;
  private final String u;
  protected zzf zzaFi;
  protected AtomicInteger zzaFr = new AtomicInteger(0);
  
  protected zzf(Context paramContext, Looper paramLooper, int paramInt, zzb paramzzb, zzc paramzzc, String paramString)
  {
    this(paramContext, paramLooper, zzn.zzaU(paramContext), zze.zzuY(), paramInt, (zzb)zzac.zzw(paramzzb), (zzc)zzac.zzw(paramzzc), paramString);
  }
  
  protected zzf(Context paramContext, Looper paramLooper, zzn paramzzn, zze paramzze, int paramInt, zzb paramzzb, zzc paramzzc, String paramString)
  {
    this.g = ((Context)zzac.zzb(paramContext, "Context must not be null"));
    this.h = ((Looper)zzac.zzb(paramLooper, "Looper must not be null"));
    this.i = ((zzn)zzac.zzb(paramzzn, "Supervisor must not be null"));
    this.j = ((zze)zzac.zzb(paramzze, "API availability must not be null"));
    this.a = new b(paramLooper);
    this.t = paramInt;
    this.r = paramzzb;
    this.s = paramzzc;
    this.u = paramString;
  }
  
  private void a(int paramInt, T paramT)
  {
    boolean bool = true;
    int i1;
    int i2;
    if (paramInt == 3)
    {
      i1 = 1;
      if (paramT == null) {
        break label382;
      }
      i2 = 1;
      label17:
      if (i1 != i2) {
        break label388;
      }
    }
    for (;;)
    {
      zzac.zzax(bool);
      for (;;)
      {
        synchronized (this.k)
        {
          this.q = paramInt;
          this.n = paramT;
          switch (paramInt)
          {
          case 2: 
            return;
            if (this.p != null)
            {
              paramT = String.valueOf(zzez());
              str = String.valueOf(zzxv());
              Log.e("GmsClient", String.valueOf(paramT).length() + 70 + String.valueOf(str).length() + "Calling connect() while still connected, missing disconnect() for " + paramT + " on " + str);
              this.i.zzb(zzez(), zzxv(), this.p, zzxw());
              this.zzaFr.incrementAndGet();
            }
            this.p = new zzh(this.zzaFr.get());
            if (this.i.zza(zzez(), zzxv(), this.p, zzxw())) {
              continue;
            }
            paramT = String.valueOf(zzez());
            String str = String.valueOf(zzxv());
            Log.e("GmsClient", String.valueOf(paramT).length() + 34 + String.valueOf(str).length() + "unable to connect to service: " + paramT + " on " + str);
            zza(16, null, this.zzaFr.get());
          }
        }
        zza(paramT);
        continue;
        if (this.p != null)
        {
          this.i.zzb(zzez(), zzxv(), this.p, zzxw());
          this.p = null;
        }
      }
      i1 = 0;
      break;
      label382:
      i2 = 0;
      break label17;
      label388:
      bool = false;
    }
  }
  
  private boolean a(int paramInt1, int paramInt2, T paramT)
  {
    synchronized (this.k)
    {
      if (this.q != paramInt1) {
        return false;
      }
      a(paramInt2, paramT);
      return true;
    }
  }
  
  public void disconnect()
  {
    this.zzaFr.incrementAndGet();
    synchronized (this.o)
    {
      int i2 = this.o.size();
      int i1 = 0;
      while (i1 < i2)
      {
        ((zze)this.o.get(i1)).zzxI();
        i1 += 1;
      }
      this.o.clear();
    }
    synchronized (this.l)
    {
      this.m = null;
      a(1, null);
      return;
      localObject2 = finally;
      throw ((Throwable)localObject2);
    }
  }
  
  public void dump(String paramString, FileDescriptor paramFileDescriptor, PrintWriter paramPrintWriter, String[] arg4)
  {
    int i1;
    synchronized (this.k)
    {
      i1 = this.q;
      paramFileDescriptor = this.n;
    }
    for (;;)
    {
      Object localObject;
      synchronized (this.l)
      {
        localObject = this.m;
        paramPrintWriter.append(paramString).append("mConnectState=");
        switch (i1)
        {
        default: 
          paramPrintWriter.print("UNKNOWN");
          paramPrintWriter.append(" mService=");
          if (paramFileDescriptor != null) {
            break label529;
          }
          paramPrintWriter.append("null");
          paramPrintWriter.append(" mServiceBroker=");
          if (localObject != null) {
            break label562;
          }
          paramPrintWriter.println("null");
          paramFileDescriptor = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.US);
          long l1;
          if (this.d > 0L)
          {
            ??? = paramPrintWriter.append(paramString).append("lastConnectedTime=");
            l1 = this.d;
            localObject = String.valueOf(paramFileDescriptor.format(new Date(this.d)));
            ???.println(String.valueOf(localObject).length() + 21 + l1 + " " + (String)localObject);
          }
          if (this.c > 0L) {
            paramPrintWriter.append(paramString).append("lastSuspendedCause=");
          }
          switch (this.b)
          {
          default: 
            paramPrintWriter.append(String.valueOf(this.b));
            ??? = paramPrintWriter.append(" lastSuspendedTime=");
            l1 = this.c;
            localObject = String.valueOf(paramFileDescriptor.format(new Date(this.c)));
            ???.println(String.valueOf(localObject).length() + 21 + l1 + " " + (String)localObject);
            if (this.f > 0L)
            {
              paramPrintWriter.append(paramString).append("lastFailedStatus=").append(CommonStatusCodes.getStatusCodeString(this.e));
              paramString = paramPrintWriter.append(" lastFailedTime=");
              l1 = this.f;
              paramFileDescriptor = String.valueOf(paramFileDescriptor.format(new Date(this.f)));
              paramString.println(String.valueOf(paramFileDescriptor).length() + 21 + l1 + " " + paramFileDescriptor);
            }
            return;
            paramString = finally;
            throw paramString;
          }
          break;
        }
      }
      paramPrintWriter.print("CONNECTING");
      continue;
      paramPrintWriter.print("CONNECTED");
      continue;
      paramPrintWriter.print("DISCONNECTING");
      continue;
      paramPrintWriter.print("DISCONNECTED");
      continue;
      label529:
      paramPrintWriter.append(zzeA()).append("@").append(Integer.toHexString(System.identityHashCode(paramFileDescriptor.asBinder())));
      continue;
      label562:
      paramPrintWriter.append("IGmsServiceBroker@").println(Integer.toHexString(System.identityHashCode(((zzv)localObject).asBinder())));
      continue;
      paramPrintWriter.append("CAUSE_SERVICE_DISCONNECTED");
      continue;
      paramPrintWriter.append("CAUSE_NETWORK_LOST");
    }
  }
  
  public Account getAccount()
  {
    return null;
  }
  
  public final Context getContext()
  {
    return this.g;
  }
  
  public final Looper getLooper()
  {
    return this.h;
  }
  
  public boolean isConnected()
  {
    for (;;)
    {
      synchronized (this.k)
      {
        if (this.q == 3)
        {
          bool = true;
          return bool;
        }
      }
      boolean bool = false;
    }
  }
  
  public boolean isConnecting()
  {
    for (;;)
    {
      synchronized (this.k)
      {
        if (this.q == 2)
        {
          bool = true;
          return bool;
        }
      }
      boolean bool = false;
    }
  }
  
  @CallSuper
  protected void onConnectionFailed(ConnectionResult paramConnectionResult)
  {
    this.e = paramConnectionResult.getErrorCode();
    this.f = System.currentTimeMillis();
  }
  
  @CallSuper
  protected void onConnectionSuspended(int paramInt)
  {
    this.b = paramInt;
    this.c = System.currentTimeMillis();
  }
  
  protected void zza(int paramInt1, @Nullable Bundle paramBundle, int paramInt2)
  {
    this.a.sendMessage(this.a.obtainMessage(5, paramInt2, -1, new zzk(paramInt1, paramBundle)));
  }
  
  protected void zza(int paramInt1, IBinder paramIBinder, Bundle paramBundle, int paramInt2)
  {
    this.a.sendMessage(this.a.obtainMessage(1, paramInt2, -1, new zzj(paramInt1, paramIBinder, paramBundle)));
  }
  
  @CallSuper
  protected void zza(@NonNull T paramT)
  {
    this.d = System.currentTimeMillis();
  }
  
  public void zza(@NonNull zzf paramzzf)
  {
    this.zzaFi = ((zzf)zzac.zzb(paramzzf, "Connection progress callbacks cannot be null."));
    a(2, null);
  }
  
  public void zza(@NonNull zzf paramzzf, int paramInt, @Nullable PendingIntent paramPendingIntent)
  {
    this.zzaFi = ((zzf)zzac.zzb(paramzzf, "Connection progress callbacks cannot be null."));
    this.a.sendMessage(this.a.obtainMessage(3, this.zzaFr.get(), paramInt, paramPendingIntent));
  }
  
  /* Error */
  @android.support.annotation.WorkerThread
  public void zza(zzr arg1, Set<Scope> paramSet)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 453	com/google/android/gms/common/internal/zzf:zzqL	()Landroid/os/Bundle;
    //   4: astore_3
    //   5: new 455	com/google/android/gms/common/internal/zzj
    //   8: dup
    //   9: aload_0
    //   10: getfield 164	com/google/android/gms/common/internal/zzf:t	I
    //   13: invokespecial 456	com/google/android/gms/common/internal/zzj:<init>	(I)V
    //   16: aload_0
    //   17: getfield 143	com/google/android/gms/common/internal/zzf:g	Landroid/content/Context;
    //   20: invokevirtual 459	android/content/Context:getPackageName	()Ljava/lang/String;
    //   23: invokevirtual 463	com/google/android/gms/common/internal/zzj:zzdm	(Ljava/lang/String;)Lcom/google/android/gms/common/internal/zzj;
    //   26: aload_3
    //   27: invokevirtual 467	com/google/android/gms/common/internal/zzj:zzp	(Landroid/os/Bundle;)Lcom/google/android/gms/common/internal/zzj;
    //   30: astore_3
    //   31: aload_2
    //   32: ifnull +9 -> 41
    //   35: aload_3
    //   36: aload_2
    //   37: invokevirtual 470	com/google/android/gms/common/internal/zzj:zzf	(Ljava/util/Collection;)Lcom/google/android/gms/common/internal/zzj;
    //   40: pop
    //   41: aload_0
    //   42: invokevirtual 473	com/google/android/gms/common/internal/zzf:zzrd	()Z
    //   45: ifeq +67 -> 112
    //   48: aload_3
    //   49: aload_0
    //   50: invokevirtual 476	com/google/android/gms/common/internal/zzf:zzxB	()Landroid/accounts/Account;
    //   53: invokevirtual 479	com/google/android/gms/common/internal/zzj:zzf	(Landroid/accounts/Account;)Lcom/google/android/gms/common/internal/zzj;
    //   56: aload_1
    //   57: invokevirtual 482	com/google/android/gms/common/internal/zzj:zzb	(Lcom/google/android/gms/common/internal/zzr;)Lcom/google/android/gms/common/internal/zzj;
    //   60: pop
    //   61: aload_3
    //   62: aload_0
    //   63: invokevirtual 486	com/google/android/gms/common/internal/zzf:zzxA	()[Lcom/google/android/gms/common/zzc;
    //   66: invokevirtual 489	com/google/android/gms/common/internal/zzj:zza	([Lcom/google/android/gms/common/zzc;)Lcom/google/android/gms/common/internal/zzj;
    //   69: pop
    //   70: aload_0
    //   71: getfield 120	com/google/android/gms/common/internal/zzf:l	Ljava/lang/Object;
    //   74: astore_1
    //   75: aload_1
    //   76: monitorenter
    //   77: aload_0
    //   78: getfield 173	com/google/android/gms/common/internal/zzf:m	Lcom/google/android/gms/common/internal/zzv;
    //   81: ifnull +50 -> 131
    //   84: aload_0
    //   85: getfield 173	com/google/android/gms/common/internal/zzf:m	Lcom/google/android/gms/common/internal/zzv;
    //   88: new 25	com/google/android/gms/common/internal/zzf$zzg
    //   91: dup
    //   92: aload_0
    //   93: aload_0
    //   94: getfield 134	com/google/android/gms/common/internal/zzf:zzaFr	Ljava/util/concurrent/atomic/AtomicInteger;
    //   97: invokevirtual 231	java/util/concurrent/atomic/AtomicInteger:get	()I
    //   100: invokespecial 490	com/google/android/gms/common/internal/zzf$zzg:<init>	(Lcom/google/android/gms/common/internal/zzf;I)V
    //   103: aload_3
    //   104: invokeinterface 493 3 0
    //   109: aload_1
    //   110: monitorexit
    //   111: return
    //   112: aload_0
    //   113: invokevirtual 496	com/google/android/gms/common/internal/zzf:zzxE	()Z
    //   116: ifeq -55 -> 61
    //   119: aload_3
    //   120: aload_0
    //   121: invokevirtual 498	com/google/android/gms/common/internal/zzf:getAccount	()Landroid/accounts/Account;
    //   124: invokevirtual 479	com/google/android/gms/common/internal/zzj:zzf	(Landroid/accounts/Account;)Lcom/google/android/gms/common/internal/zzj;
    //   127: pop
    //   128: goto -67 -> 61
    //   131: ldc -60
    //   133: ldc_w 500
    //   136: invokestatic 503	android/util/Log:w	(Ljava/lang/String;Ljava/lang/String;)I
    //   139: pop
    //   140: goto -31 -> 109
    //   143: astore_2
    //   144: aload_1
    //   145: monitorexit
    //   146: aload_2
    //   147: athrow
    //   148: astore_1
    //   149: ldc -60
    //   151: ldc_w 505
    //   154: aload_1
    //   155: invokestatic 508	android/util/Log:w	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   158: pop
    //   159: aload_0
    //   160: iconst_1
    //   161: invokevirtual 511	com/google/android/gms/common/internal/zzf:zzcS	(I)V
    //   164: return
    //   165: astore_1
    //   166: aload_1
    //   167: athrow
    //   168: astore_1
    //   169: ldc -60
    //   171: ldc_w 505
    //   174: aload_1
    //   175: invokestatic 508	android/util/Log:w	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   178: pop
    //   179: aload_0
    //   180: bipush 8
    //   182: aconst_null
    //   183: aconst_null
    //   184: aload_0
    //   185: getfield 134	com/google/android/gms/common/internal/zzf:zzaFr	Ljava/util/concurrent/atomic/AtomicInteger;
    //   188: invokevirtual 231	java/util/concurrent/atomic/AtomicInteger:get	()I
    //   191: invokevirtual 513	com/google/android/gms/common/internal/zzf:zza	(ILandroid/os/IBinder;Landroid/os/Bundle;I)V
    //   194: return
    //   195: astore_1
    //   196: goto -27 -> 169
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	199	0	this	zzf
    //   0	199	2	paramSet	Set<Scope>
    //   4	116	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   77	109	143	finally
    //   109	111	143	finally
    //   131	140	143	finally
    //   144	146	143	finally
    //   70	77	148	android/os/DeadObjectException
    //   146	148	148	android/os/DeadObjectException
    //   70	77	165	java/lang/SecurityException
    //   146	148	165	java/lang/SecurityException
    //   70	77	168	android/os/RemoteException
    //   146	148	168	android/os/RemoteException
    //   70	77	195	java/lang/RuntimeException
    //   146	148	195	java/lang/RuntimeException
  }
  
  public void zzcS(int paramInt)
  {
    this.a.sendMessage(this.a.obtainMessage(4, this.zzaFr.get(), paramInt));
  }
  
  @NonNull
  public abstract String zzeA();
  
  @NonNull
  public abstract String zzez();
  
  @Nullable
  public abstract T zzh(IBinder paramIBinder);
  
  public Bundle zzqL()
  {
    return new Bundle();
  }
  
  public boolean zzrd()
  {
    return false;
  }
  
  public boolean zzrr()
  {
    return false;
  }
  
  public Intent zzrs()
  {
    throw new UnsupportedOperationException("Not a sign in API");
  }
  
  public Bundle zzuC()
  {
    return null;
  }
  
  public boolean zzvh()
  {
    return true;
  }
  
  @Nullable
  public IBinder zzvi()
  {
    synchronized (this.l)
    {
      if (this.m == null) {
        return null;
      }
      IBinder localIBinder = this.m.asBinder();
      return localIBinder;
    }
  }
  
  public zzc[] zzxA()
  {
    return new zzc[0];
  }
  
  public final Account zzxB()
  {
    if (getAccount() != null) {
      return getAccount();
    }
    return new Account("<<default account>>", "com.google");
  }
  
  protected final void zzxC()
  {
    if (!isConnected()) {
      throw new IllegalStateException("Not connected. Call connect() and wait for onConnected() to be called.");
    }
  }
  
  public final T zzxD()
    throws DeadObjectException
  {
    synchronized (this.k)
    {
      if (this.q == 4) {
        throw new DeadObjectException();
      }
    }
    zzxC();
    if (this.n != null) {}
    for (boolean bool = true;; bool = false)
    {
      zzac.zza(bool, "Client is connected but service is null");
      IInterface localIInterface = this.n;
      return localIInterface;
    }
  }
  
  public boolean zzxE()
  {
    return false;
  }
  
  protected Set<Scope> zzxF()
  {
    return Collections.EMPTY_SET;
  }
  
  protected String zzxv()
  {
    return "com.google.android.gms";
  }
  
  @Nullable
  protected final String zzxw()
  {
    if (this.u == null) {
      return this.g.getClass().getName();
    }
    return this.u;
  }
  
  public void zzxz()
  {
    int i1 = this.j.isGooglePlayServicesAvailable(this.g);
    if (i1 != 0)
    {
      a(1, null);
      zza(new zzi(), i1, null);
      return;
    }
    zza(new zzi());
  }
  
  abstract class a
    extends zzf.zze<Boolean>
  {
    public final int statusCode;
    public final Bundle zzaFt;
    
    @BinderThread
    protected a(int paramInt, Bundle paramBundle)
    {
      super(Boolean.valueOf(true));
      this.statusCode = paramInt;
      this.zzaFt = paramBundle;
    }
    
    protected void zzb(Boolean paramBoolean)
    {
      Object localObject = null;
      if (paramBoolean == null) {
        zzf.a(zzf.this, 1);
      }
      do
      {
        return;
        switch (this.statusCode)
        {
        default: 
          zzf.a(zzf.this, 1);
          paramBoolean = (Boolean)localObject;
          if (this.zzaFt != null) {
            paramBoolean = (PendingIntent)this.zzaFt.getParcelable("pendingIntent");
          }
          zzm(new ConnectionResult(this.statusCode, paramBoolean));
          return;
        }
      } while (zzxG());
      zzf.a(zzf.this, 1);
      zzm(new ConnectionResult(8, null));
      return;
      zzf.a(zzf.this, 1);
      throw new IllegalStateException("A fatal developer error has occurred. Check the logs for further information.");
    }
    
    protected abstract void zzm(ConnectionResult paramConnectionResult);
    
    protected abstract boolean zzxG();
  }
  
  final class b
    extends Handler
  {
    public b(Looper paramLooper)
    {
      super();
    }
    
    private static void a(Message paramMessage)
    {
      ((zzf.zze)paramMessage.obj).unregister();
    }
    
    private static boolean b(Message paramMessage)
    {
      return (paramMessage.what == 2) || (paramMessage.what == 1) || (paramMessage.what == 5);
    }
    
    public final void handleMessage(Message paramMessage)
    {
      PendingIntent localPendingIntent = null;
      if (zzf.this.zzaFr.get() != paramMessage.arg1)
      {
        if (b(paramMessage)) {
          a(paramMessage);
        }
        return;
      }
      if (((paramMessage.what == 1) || (paramMessage.what == 5)) && (!zzf.this.isConnecting()))
      {
        a(paramMessage);
        return;
      }
      if (paramMessage.what == 3)
      {
        if ((paramMessage.obj instanceof PendingIntent)) {
          localPendingIntent = (PendingIntent)paramMessage.obj;
        }
        paramMessage = new ConnectionResult(paramMessage.arg2, localPendingIntent);
        zzf.this.zzaFi.zzg(paramMessage);
        zzf.this.onConnectionFailed(paramMessage);
        return;
      }
      if (paramMessage.what == 4)
      {
        zzf.a(zzf.this, 4);
        if (zzf.b(zzf.this) != null) {
          zzf.b(zzf.this).onConnectionSuspended(paramMessage.arg2);
        }
        zzf.this.onConnectionSuspended(paramMessage.arg2);
        zzf.a(zzf.this, 4, 1, null);
        return;
      }
      if ((paramMessage.what == 2) && (!zzf.this.isConnected()))
      {
        a(paramMessage);
        return;
      }
      if (b(paramMessage))
      {
        ((zzf.zze)paramMessage.obj).zzxH();
        return;
      }
      int i = paramMessage.what;
      Log.wtf("GmsClient", 45 + "Don't know how to handle message: " + i, new Exception());
    }
  }
  
  public static abstract interface zzb
  {
    public abstract void onConnected(@Nullable Bundle paramBundle);
    
    public abstract void onConnectionSuspended(int paramInt);
  }
  
  public static abstract interface zzc
  {
    public abstract void onConnectionFailed(@NonNull ConnectionResult paramConnectionResult);
  }
  
  public abstract class zze<TListener>
  {
    private TListener a;
    private boolean c;
    
    public zze()
    {
      Object localObject;
      this.a = localObject;
      this.c = false;
    }
    
    public void unregister()
    {
      zzxI();
      synchronized (zzf.c(zzf.this))
      {
        zzf.c(zzf.this).remove(this);
        return;
      }
    }
    
    protected abstract void zzu(TListener paramTListener);
    
    /* Error */
    public void zzxH()
    {
      // Byte code:
      //   0: aload_0
      //   1: monitorenter
      //   2: aload_0
      //   3: getfield 24	com/google/android/gms/common/internal/zzf$zze:a	Ljava/lang/Object;
      //   6: astore_1
      //   7: aload_0
      //   8: getfield 26	com/google/android/gms/common/internal/zzf$zze:c	Z
      //   11: ifeq +48 -> 59
      //   14: aload_0
      //   15: invokestatic 53	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
      //   18: astore_2
      //   19: ldc 55
      //   21: new 57	java/lang/StringBuilder
      //   24: dup
      //   25: aload_2
      //   26: invokestatic 53	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
      //   29: invokevirtual 61	java/lang/String:length	()I
      //   32: bipush 47
      //   34: iadd
      //   35: invokespecial 64	java/lang/StringBuilder:<init>	(I)V
      //   38: ldc 66
      //   40: invokevirtual 70	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   43: aload_2
      //   44: invokevirtual 70	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   47: ldc 72
      //   49: invokevirtual 70	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   52: invokevirtual 76	java/lang/StringBuilder:toString	()Ljava/lang/String;
      //   55: invokestatic 82	android/util/Log:w	(Ljava/lang/String;Ljava/lang/String;)I
      //   58: pop
      //   59: aload_0
      //   60: monitorexit
      //   61: aload_1
      //   62: ifnull +8 -> 70
      //   65: aload_0
      //   66: aload_1
      //   67: invokevirtual 84	com/google/android/gms/common/internal/zzf$zze:zzu	(Ljava/lang/Object;)V
      //   70: aload_0
      //   71: monitorenter
      //   72: aload_0
      //   73: iconst_1
      //   74: putfield 26	com/google/android/gms/common/internal/zzf$zze:c	Z
      //   77: aload_0
      //   78: monitorexit
      //   79: aload_0
      //   80: invokevirtual 86	com/google/android/gms/common/internal/zzf$zze:unregister	()V
      //   83: return
      //   84: astore_1
      //   85: aload_0
      //   86: monitorexit
      //   87: aload_1
      //   88: athrow
      //   89: astore_1
      //   90: aload_1
      //   91: athrow
      //   92: astore_1
      //   93: aload_0
      //   94: monitorexit
      //   95: aload_1
      //   96: athrow
      // Local variable table:
      //   start	length	slot	name	signature
      //   0	97	0	this	zze
      //   6	61	1	localObject1	Object
      //   84	4	1	localObject2	Object
      //   89	2	1	localRuntimeException	RuntimeException
      //   92	4	1	localObject3	Object
      //   18	26	2	str	String
      // Exception table:
      //   from	to	target	type
      //   2	59	84	finally
      //   59	61	84	finally
      //   85	87	84	finally
      //   65	70	89	java/lang/RuntimeException
      //   72	79	92	finally
      //   93	95	92	finally
    }
    
    public void zzxI()
    {
      try
      {
        this.a = null;
        return;
      }
      finally {}
    }
  }
  
  public static abstract interface zzf
  {
    public abstract void zzg(@NonNull ConnectionResult paramConnectionResult);
  }
  
  public static final class zzg
    extends zzu.zza
  {
    private zzf a;
    private final int b;
    
    public zzg(@NonNull zzf paramzzf, int paramInt)
    {
      this.a = paramzzf;
      this.b = paramInt;
    }
    
    @BinderThread
    public final void zza(int paramInt, @NonNull IBinder paramIBinder, @Nullable Bundle paramBundle)
    {
      zzac.zzb(this.a, "onPostInitComplete can be called only once per call to getRemoteService");
      this.a.zza(paramInt, paramIBinder, paramBundle, this.b);
      this.a = null;
    }
    
    @BinderThread
    public final void zzb(int paramInt, @Nullable Bundle paramBundle)
    {
      Log.wtf("GmsClient", "received deprecated onAccountValidationComplete callback, ignoring", new Exception());
    }
  }
  
  public final class zzh
    implements ServiceConnection
  {
    private final int b;
    
    public zzh(int paramInt)
    {
      this.b = paramInt;
    }
    
    public final void onServiceConnected(ComponentName arg1, IBinder paramIBinder)
    {
      if (paramIBinder == null)
      {
        zzf.this.zza(8, null, this.b);
        return;
      }
      synchronized (zzf.a(zzf.this))
      {
        zzf.a(zzf.this, zzv.zza.zzbu(paramIBinder));
        zzf.this.zza(0, null, this.b);
        return;
      }
    }
    
    public final void onServiceDisconnected(ComponentName arg1)
    {
      synchronized (zzf.a(zzf.this))
      {
        zzf.a(zzf.this, null);
        zzf.this.a.sendMessage(zzf.this.a.obtainMessage(4, this.b, 1));
        return;
      }
    }
  }
  
  public class zzi
    implements zzf.zzf
  {
    public zzi() {}
    
    public void zzg(@NonNull ConnectionResult paramConnectionResult)
    {
      if (paramConnectionResult.isSuccess()) {
        zzf.this.zza(null, zzf.this.zzxF());
      }
      while (zzf.d(zzf.this) == null) {
        return;
      }
      zzf.d(zzf.this).onConnectionFailed(paramConnectionResult);
    }
  }
  
  public final class zzj
    extends zzf.a
  {
    public final IBinder zzaFy;
    
    @BinderThread
    public zzj(int paramInt, IBinder paramIBinder, Bundle paramBundle)
    {
      super(paramInt, paramBundle);
      this.zzaFy = paramIBinder;
    }
    
    protected final void zzm(ConnectionResult paramConnectionResult)
    {
      if (zzf.d(zzf.this) != null) {
        zzf.d(zzf.this).onConnectionFailed(paramConnectionResult);
      }
      zzf.this.onConnectionFailed(paramConnectionResult);
    }
    
    protected final boolean zzxG()
    {
      do
      {
        try
        {
          String str1 = this.zzaFy.getInterfaceDescriptor();
          if (!zzf.this.zzeA().equals(str1))
          {
            String str2 = String.valueOf(zzf.this.zzeA());
            Log.e("GmsClient", String.valueOf(str2).length() + 34 + String.valueOf(str1).length() + "service descriptor mismatch: " + str2 + " vs. " + str1);
            return false;
          }
        }
        catch (RemoteException localRemoteException)
        {
          Log.w("GmsClient", "service probably died");
          return false;
        }
        localObject = zzf.this.zzh(this.zzaFy);
      } while ((localObject == null) || (!zzf.a(zzf.this, 2, 3, (IInterface)localObject)));
      Object localObject = zzf.this.zzuC();
      if (zzf.b(zzf.this) != null) {
        zzf.b(zzf.this).onConnected((Bundle)localObject);
      }
      return true;
    }
  }
  
  public final class zzk
    extends zzf.a
  {
    @BinderThread
    public zzk(int paramInt, @Nullable Bundle paramBundle)
    {
      super(paramInt, paramBundle);
    }
    
    protected final void zzm(ConnectionResult paramConnectionResult)
    {
      zzf.this.zzaFi.zzg(paramConnectionResult);
      zzf.this.onConnectionFailed(paramConnectionResult);
    }
    
    protected final boolean zzxG()
    {
      zzf.this.zzaFi.zzg(ConnectionResult.zzayj);
      return true;
    }
  }
}


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