NotificationCompat.java 18.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
package com.pushwoosh.support.v4.app;

import android.app.Notification;
import android.app.Notification.BigPictureStyle;
import android.app.Notification.BigTextStyle;
import android.app.Notification.Builder;
import android.app.PendingIntent;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build.VERSION;
import android.widget.RemoteViews;
import java.util.ArrayList;
import java.util.Iterator;
import sc;

public class NotificationCompat
{
  public static final int FLAG_HIGH_PRIORITY = 128;
  public static final int PRIORITY_DEFAULT = 0;
  public static final int PRIORITY_HIGH = 1;
  public static final int PRIORITY_LOW = -1;
  public static final int PRIORITY_MAX = 2;
  public static final int PRIORITY_MIN = -2;
  private static final a a = new b();
  
  static
  {
    if (Build.VERSION.SDK_INT >= 16)
    {
      a = new e();
      return;
    }
    if (Build.VERSION.SDK_INT >= 14)
    {
      a = new d();
      return;
    }
    if (Build.VERSION.SDK_INT >= 11)
    {
      a = new c();
      return;
    }
  }
  
  public static class Action
  {
    public PendingIntent actionIntent;
    public int icon;
    public CharSequence title;
    
    public Action(int paramInt, CharSequence paramCharSequence, PendingIntent paramPendingIntent)
    {
      this.icon = paramInt;
      this.title = paramCharSequence;
      this.actionIntent = paramPendingIntent;
    }
  }
  
  public static class BigPictureStyle
    extends NotificationCompat.Style
  {
    Bitmap a;
    
    public BigPictureStyle() {}
    
    public BigPictureStyle(NotificationCompat.Builder paramBuilder)
    {
      setBuilder(paramBuilder);
    }
    
    public BigPictureStyle bigPicture(Bitmap paramBitmap)
    {
      this.a = paramBitmap;
      return this;
    }
    
    public BigPictureStyle setBigContentTitle(CharSequence paramCharSequence)
    {
      this.c = paramCharSequence;
      return this;
    }
    
    public BigPictureStyle setSummaryText(CharSequence paramCharSequence)
    {
      this.d = paramCharSequence;
      this.e = true;
      return this;
    }
  }
  
  public static class BigTextStyle
    extends NotificationCompat.Style
  {
    CharSequence a;
    
    public BigTextStyle() {}
    
    public BigTextStyle(NotificationCompat.Builder paramBuilder)
    {
      setBuilder(paramBuilder);
    }
    
    public BigTextStyle bigText(CharSequence paramCharSequence)
    {
      this.a = paramCharSequence;
      return this;
    }
    
    public BigTextStyle setBigContentTitle(CharSequence paramCharSequence)
    {
      this.c = paramCharSequence;
      return this;
    }
    
    public BigTextStyle setSummaryText(CharSequence paramCharSequence)
    {
      this.d = paramCharSequence;
      this.e = true;
      return this;
    }
  }
  
  public static class Builder
  {
    Context a;
    CharSequence b;
    CharSequence c;
    PendingIntent d;
    PendingIntent e;
    RemoteViews f;
    Bitmap g;
    CharSequence h;
    int i;
    int j;
    boolean k;
    NotificationCompat.Style l;
    CharSequence m;
    int n;
    int o;
    boolean p;
    ArrayList<NotificationCompat.Action> q = new ArrayList();
    Notification r = new Notification();
    
    public Builder(Context paramContext)
    {
      this.a = paramContext;
      this.r.when = System.currentTimeMillis();
      this.r.audioStreamType = -1;
      this.j = 0;
    }
    
    private void a(int paramInt, boolean paramBoolean)
    {
      if (paramBoolean)
      {
        localNotification = this.r;
        localNotification.flags |= paramInt;
        return;
      }
      Notification localNotification = this.r;
      localNotification.flags &= (paramInt ^ 0xFFFFFFFF);
    }
    
    public Builder addAction(int paramInt, CharSequence paramCharSequence, PendingIntent paramPendingIntent)
    {
      this.q.add(new NotificationCompat.Action(paramInt, paramCharSequence, paramPendingIntent));
      return this;
    }
    
    public Notification build()
    {
      return NotificationCompat.a().a(this);
    }
    
    @Deprecated
    public Notification getNotification()
    {
      return NotificationCompat.a().a(this);
    }
    
    public Builder setAutoCancel(boolean paramBoolean)
    {
      a(16, paramBoolean);
      return this;
    }
    
    public Builder setContent(RemoteViews paramRemoteViews)
    {
      this.r.contentView = paramRemoteViews;
      return this;
    }
    
    public Builder setContentInfo(CharSequence paramCharSequence)
    {
      this.h = paramCharSequence;
      return this;
    }
    
    public Builder setContentIntent(PendingIntent paramPendingIntent)
    {
      this.d = paramPendingIntent;
      return this;
    }
    
    public Builder setContentText(CharSequence paramCharSequence)
    {
      this.c = paramCharSequence;
      return this;
    }
    
    public Builder setContentTitle(CharSequence paramCharSequence)
    {
      this.b = paramCharSequence;
      return this;
    }
    
    public Builder setDefaults(int paramInt)
    {
      this.r.defaults = paramInt;
      if ((paramInt & 0x4) != 0)
      {
        Notification localNotification = this.r;
        localNotification.flags |= 0x1;
      }
      return this;
    }
    
    public Builder setDeleteIntent(PendingIntent paramPendingIntent)
    {
      this.r.deleteIntent = paramPendingIntent;
      return this;
    }
    
    public Builder setFullScreenIntent(PendingIntent paramPendingIntent, boolean paramBoolean)
    {
      this.e = paramPendingIntent;
      a(128, paramBoolean);
      return this;
    }
    
    public Builder setLargeIcon(Bitmap paramBitmap)
    {
      this.g = paramBitmap;
      return this;
    }
    
    public Builder setLights(int paramInt1, int paramInt2, int paramInt3)
    {
      int i1 = 1;
      this.r.ledARGB = paramInt1;
      this.r.ledOnMS = paramInt2;
      this.r.ledOffMS = paramInt3;
      Notification localNotification;
      if ((this.r.ledOnMS != 0) && (this.r.ledOffMS != 0))
      {
        paramInt1 = 1;
        localNotification = this.r;
        paramInt2 = this.r.flags;
        if (paramInt1 == 0) {
          break label88;
        }
      }
      label88:
      for (paramInt1 = i1;; paramInt1 = 0)
      {
        localNotification.flags = (paramInt2 & 0xFFFFFFFE | paramInt1);
        return this;
        paramInt1 = 0;
        break;
      }
    }
    
    public Builder setNumber(int paramInt)
    {
      this.i = paramInt;
      return this;
    }
    
    public Builder setOngoing(boolean paramBoolean)
    {
      a(2, paramBoolean);
      return this;
    }
    
    public Builder setOnlyAlertOnce(boolean paramBoolean)
    {
      a(8, paramBoolean);
      return this;
    }
    
    public Builder setPriority(int paramInt)
    {
      this.j = paramInt;
      return this;
    }
    
    public Builder setProgress(int paramInt1, int paramInt2, boolean paramBoolean)
    {
      this.n = paramInt1;
      this.o = paramInt2;
      this.p = paramBoolean;
      return this;
    }
    
    public Builder setSmallIcon(int paramInt)
    {
      this.r.icon = paramInt;
      return this;
    }
    
    public Builder setSmallIcon(int paramInt1, int paramInt2)
    {
      this.r.icon = paramInt1;
      this.r.iconLevel = paramInt2;
      return this;
    }
    
    public Builder setSound(Uri paramUri)
    {
      this.r.sound = paramUri;
      this.r.audioStreamType = -1;
      return this;
    }
    
    public Builder setSound(Uri paramUri, int paramInt)
    {
      this.r.sound = paramUri;
      this.r.audioStreamType = paramInt;
      return this;
    }
    
    public Builder setStyle(NotificationCompat.Style paramStyle)
    {
      if (this.l != paramStyle)
      {
        this.l = paramStyle;
        if (this.l != null) {
          this.l.setBuilder(this);
        }
      }
      return this;
    }
    
    public Builder setSubText(CharSequence paramCharSequence)
    {
      this.m = paramCharSequence;
      return this;
    }
    
    public Builder setTicker(CharSequence paramCharSequence)
    {
      this.r.tickerText = paramCharSequence;
      return this;
    }
    
    public Builder setTicker(CharSequence paramCharSequence, RemoteViews paramRemoteViews)
    {
      this.r.tickerText = paramCharSequence;
      this.f = paramRemoteViews;
      return this;
    }
    
    public Builder setUsesChronometer(boolean paramBoolean)
    {
      this.k = paramBoolean;
      return this;
    }
    
    public Builder setVibrate(long[] paramArrayOfLong)
    {
      this.r.vibrate = paramArrayOfLong;
      return this;
    }
    
    public Builder setWhen(long paramLong)
    {
      this.r.when = paramLong;
      return this;
    }
  }
  
  public static class InboxStyle
    extends NotificationCompat.Style
  {
    ArrayList<CharSequence> a = new ArrayList();
    
    public InboxStyle() {}
    
    public InboxStyle(NotificationCompat.Builder paramBuilder)
    {
      setBuilder(paramBuilder);
    }
    
    public InboxStyle addLine(CharSequence paramCharSequence)
    {
      this.a.add(paramCharSequence);
      return this;
    }
    
    public InboxStyle setBigContentTitle(CharSequence paramCharSequence)
    {
      this.c = paramCharSequence;
      return this;
    }
    
    public InboxStyle setSummaryText(CharSequence paramCharSequence)
    {
      this.d = paramCharSequence;
      this.e = true;
      return this;
    }
  }
  
  public static abstract class Style
  {
    NotificationCompat.Builder b;
    CharSequence c;
    CharSequence d;
    boolean e = false;
    
    public Notification build()
    {
      Notification localNotification = null;
      if (this.b != null) {
        localNotification = this.b.build();
      }
      return localNotification;
    }
    
    public void setBuilder(NotificationCompat.Builder paramBuilder)
    {
      if (this.b != paramBuilder)
      {
        this.b = paramBuilder;
        if (this.b != null) {
          this.b.setStyle(this);
        }
      }
    }
  }
  
  static abstract interface a
  {
    public abstract Notification a(NotificationCompat.Builder paramBuilder);
  }
  
  static final class b
    implements NotificationCompat.a
  {
    public final Notification a(NotificationCompat.Builder paramBuilder)
    {
      Notification localNotification = paramBuilder.r;
      localNotification.setLatestEventInfo(paramBuilder.a, paramBuilder.b, paramBuilder.c, paramBuilder.d);
      if (paramBuilder.j > 0) {
        localNotification.flags |= 0x80;
      }
      return localNotification;
    }
  }
  
  static final class c
    implements NotificationCompat.a
  {
    public final Notification a(NotificationCompat.Builder paramBuilder)
    {
      Object localObject2 = paramBuilder.a;
      Notification localNotification = paramBuilder.r;
      Object localObject1 = paramBuilder.b;
      CharSequence localCharSequence1 = paramBuilder.c;
      CharSequence localCharSequence2 = paramBuilder.h;
      RemoteViews localRemoteViews = paramBuilder.f;
      int i = paramBuilder.i;
      PendingIntent localPendingIntent2 = paramBuilder.d;
      PendingIntent localPendingIntent1 = paramBuilder.e;
      paramBuilder = paramBuilder.g;
      localObject2 = new Notification.Builder((Context)localObject2).setWhen(localNotification.when).setSmallIcon(localNotification.icon, localNotification.iconLevel).setContent(localNotification.contentView).setTicker(localNotification.tickerText, localRemoteViews).setSound(localNotification.sound, localNotification.audioStreamType).setVibrate(localNotification.vibrate).setLights(localNotification.ledARGB, localNotification.ledOnMS, localNotification.ledOffMS);
      if ((localNotification.flags & 0x2) != 0)
      {
        bool = true;
        localObject2 = ((Notification.Builder)localObject2).setOngoing(bool);
        if ((localNotification.flags & 0x8) == 0) {
          break label284;
        }
        bool = true;
        label180:
        localObject2 = ((Notification.Builder)localObject2).setOnlyAlertOnce(bool);
        if ((localNotification.flags & 0x10) == 0) {
          break label289;
        }
        bool = true;
        label201:
        localObject1 = ((Notification.Builder)localObject2).setAutoCancel(bool).setDefaults(localNotification.defaults).setContentTitle((CharSequence)localObject1).setContentText(localCharSequence1).setContentInfo(localCharSequence2).setContentIntent(localPendingIntent2).setDeleteIntent(localNotification.deleteIntent);
        if ((localNotification.flags & 0x80) == 0) {
          break label294;
        }
      }
      label284:
      label289:
      label294:
      for (boolean bool = true;; bool = false)
      {
        return ((Notification.Builder)localObject1).setFullScreenIntent(localPendingIntent1, bool).setLargeIcon(paramBuilder).setNumber(i).getNotification();
        bool = false;
        break;
        bool = false;
        break label180;
        bool = false;
        break label201;
      }
    }
  }
  
  static final class d
    implements NotificationCompat.a
  {
    public final Notification a(NotificationCompat.Builder paramBuilder)
    {
      Context localContext = paramBuilder.a;
      Notification localNotification = paramBuilder.r;
      CharSequence localCharSequence1 = paramBuilder.b;
      CharSequence localCharSequence2 = paramBuilder.c;
      CharSequence localCharSequence3 = paramBuilder.h;
      RemoteViews localRemoteViews = paramBuilder.f;
      int i = paramBuilder.i;
      PendingIntent localPendingIntent2 = paramBuilder.d;
      PendingIntent localPendingIntent1 = paramBuilder.e;
      Bitmap localBitmap = paramBuilder.g;
      int j = paramBuilder.n;
      int k = paramBuilder.o;
      boolean bool2 = paramBuilder.p;
      paramBuilder = new Notification.Builder(localContext).setWhen(localNotification.when).setSmallIcon(localNotification.icon, localNotification.iconLevel).setContent(localNotification.contentView).setTicker(localNotification.tickerText, localRemoteViews).setSound(localNotification.sound, localNotification.audioStreamType).setVibrate(localNotification.vibrate).setLights(localNotification.ledARGB, localNotification.ledOnMS, localNotification.ledOffMS);
      if ((localNotification.flags & 0x2) != 0)
      {
        bool1 = true;
        paramBuilder = paramBuilder.setOngoing(bool1);
        if ((localNotification.flags & 0x8) == 0) {
          break label312;
        }
        bool1 = true;
        label198:
        paramBuilder = paramBuilder.setOnlyAlertOnce(bool1);
        if ((localNotification.flags & 0x10) == 0) {
          break label318;
        }
        bool1 = true;
        label219:
        paramBuilder = paramBuilder.setAutoCancel(bool1).setDefaults(localNotification.defaults).setContentTitle(localCharSequence1).setContentText(localCharSequence2).setContentInfo(localCharSequence3).setContentIntent(localPendingIntent2).setDeleteIntent(localNotification.deleteIntent);
        if ((localNotification.flags & 0x80) == 0) {
          break label324;
        }
      }
      label312:
      label318:
      label324:
      for (boolean bool1 = true;; bool1 = false)
      {
        return paramBuilder.setFullScreenIntent(localPendingIntent1, bool1).setLargeIcon(localBitmap).setNumber(i).setProgress(j, k, bool2).getNotification();
        bool1 = false;
        break;
        bool1 = false;
        break label198;
        bool1 = false;
        break label219;
      }
    }
  }
  
  static final class e
    implements NotificationCompat.a
  {
    public final Notification a(NotificationCompat.Builder paramBuilder)
    {
      sc localsc = new sc(paramBuilder.a, paramBuilder.r, paramBuilder.b, paramBuilder.c, paramBuilder.h, paramBuilder.f, paramBuilder.i, paramBuilder.d, paramBuilder.e, paramBuilder.g, paramBuilder.n, paramBuilder.o, paramBuilder.p, paramBuilder.k, paramBuilder.j, paramBuilder.m);
      Object localObject1 = paramBuilder.q.iterator();
      Object localObject2;
      while (((Iterator)localObject1).hasNext())
      {
        Object localObject3 = (NotificationCompat.Action)((Iterator)localObject1).next();
        int i = ((NotificationCompat.Action)localObject3).icon;
        localObject2 = ((NotificationCompat.Action)localObject3).title;
        localObject3 = ((NotificationCompat.Action)localObject3).actionIntent;
        localsc.a.addAction(i, (CharSequence)localObject2, (PendingIntent)localObject3);
      }
      boolean bool;
      if (paramBuilder.l != null)
      {
        if (!(paramBuilder.l instanceof NotificationCompat.BigTextStyle)) {
          break label237;
        }
        localObject2 = (NotificationCompat.BigTextStyle)paramBuilder.l;
        localObject1 = ((NotificationCompat.BigTextStyle)localObject2).c;
        bool = ((NotificationCompat.BigTextStyle)localObject2).e;
        paramBuilder = ((NotificationCompat.BigTextStyle)localObject2).d;
        localObject2 = ((NotificationCompat.BigTextStyle)localObject2).a;
        localObject1 = new Notification.BigTextStyle(localsc.a).setBigContentTitle((CharSequence)localObject1).bigText((CharSequence)localObject2);
        if (bool) {
          ((Notification.BigTextStyle)localObject1).setSummaryText(paramBuilder);
        }
      }
      for (;;)
      {
        return localsc.a.build();
        label237:
        if ((paramBuilder.l instanceof NotificationCompat.InboxStyle))
        {
          paramBuilder = (NotificationCompat.InboxStyle)paramBuilder.l;
          localsc.a(paramBuilder.c, paramBuilder.e, paramBuilder.d, paramBuilder.a);
        }
        else if ((paramBuilder.l instanceof NotificationCompat.BigPictureStyle))
        {
          localObject2 = (NotificationCompat.BigPictureStyle)paramBuilder.l;
          localObject1 = ((NotificationCompat.BigPictureStyle)localObject2).c;
          bool = ((NotificationCompat.BigPictureStyle)localObject2).e;
          paramBuilder = ((NotificationCompat.BigPictureStyle)localObject2).d;
          localObject2 = ((NotificationCompat.BigPictureStyle)localObject2).a;
          localObject1 = new Notification.BigPictureStyle(localsc.a).setBigContentTitle((CharSequence)localObject1).bigPicture((Bitmap)localObject2);
          if (bool) {
            ((Notification.BigPictureStyle)localObject1).setSummaryText(paramBuilder);
          }
        }
      }
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/pushwoosh/support/v4/app/NotificationCompat.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */