RemoteInput.java 5.21 KB
package android.support.v4.app;

import android.content.ClipData;
import android.content.ClipData.Item;
import android.content.ClipDescription;
import android.content.Intent;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.support.annotation.RestrictTo;
import android.util.Log;
import cv;
import cw;

public final class RemoteInput
  extends RemoteInputCompatBase.RemoteInput
{
  public static final String EXTRA_RESULTS_DATA = "android.remoteinput.resultsData";
  @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
  public static final RemoteInputCompatBase.RemoteInput.Factory FACTORY;
  public static final String RESULTS_CLIP_LABEL = "android.remoteinput.results";
  private static final a f;
  private final String a;
  private final CharSequence b;
  private final CharSequence[] c;
  private final boolean d;
  private final Bundle e;
  
  static
  {
    if (Build.VERSION.SDK_INT >= 20) {
      f = new b();
    }
    for (;;)
    {
      FACTORY = new RemoteInputCompatBase.RemoteInput.Factory() {};
      return;
      if (Build.VERSION.SDK_INT >= 16) {
        f = new d();
      } else {
        f = new c();
      }
    }
  }
  
  RemoteInput(String paramString, CharSequence paramCharSequence, CharSequence[] paramArrayOfCharSequence, boolean paramBoolean, Bundle paramBundle)
  {
    this.a = paramString;
    this.b = paramCharSequence;
    this.c = paramArrayOfCharSequence;
    this.d = paramBoolean;
    this.e = paramBundle;
  }
  
  public static void addResultsToIntent(RemoteInput[] paramArrayOfRemoteInput, Intent paramIntent, Bundle paramBundle)
  {
    f.a(paramArrayOfRemoteInput, paramIntent, paramBundle);
  }
  
  public static Bundle getResultsFromIntent(Intent paramIntent)
  {
    return f.a(paramIntent);
  }
  
  public final boolean getAllowFreeFormInput()
  {
    return this.d;
  }
  
  public final CharSequence[] getChoices()
  {
    return this.c;
  }
  
  public final Bundle getExtras()
  {
    return this.e;
  }
  
  public final CharSequence getLabel()
  {
    return this.b;
  }
  
  public final String getResultKey()
  {
    return this.a;
  }
  
  public static final class Builder
  {
    private final String a;
    private CharSequence b;
    private CharSequence[] c;
    private boolean d = true;
    private Bundle e = new Bundle();
    
    public Builder(String paramString)
    {
      if (paramString == null) {
        throw new IllegalArgumentException("Result key can't be null");
      }
      this.a = paramString;
    }
    
    public final Builder addExtras(Bundle paramBundle)
    {
      if (paramBundle != null) {
        this.e.putAll(paramBundle);
      }
      return this;
    }
    
    public final RemoteInput build()
    {
      return new RemoteInput(this.a, this.b, this.c, this.d, this.e);
    }
    
    public final Bundle getExtras()
    {
      return this.e;
    }
    
    public final Builder setAllowFreeFormInput(boolean paramBoolean)
    {
      this.d = paramBoolean;
      return this;
    }
    
    public final Builder setChoices(CharSequence[] paramArrayOfCharSequence)
    {
      this.c = paramArrayOfCharSequence;
      return this;
    }
    
    public final Builder setLabel(CharSequence paramCharSequence)
    {
      this.b = paramCharSequence;
      return this;
    }
  }
  
  static abstract interface a
  {
    public abstract Bundle a(Intent paramIntent);
    
    public abstract void a(RemoteInput[] paramArrayOfRemoteInput, Intent paramIntent, Bundle paramBundle);
  }
  
  static final class b
    implements RemoteInput.a
  {
    public final Bundle a(Intent paramIntent)
    {
      return android.app.RemoteInput.getResultsFromIntent(paramIntent);
    }
    
    public final void a(RemoteInput[] paramArrayOfRemoteInput, Intent paramIntent, Bundle paramBundle)
    {
      android.app.RemoteInput.addResultsToIntent(cv.a(paramArrayOfRemoteInput), paramIntent, paramBundle);
    }
  }
  
  static final class c
    implements RemoteInput.a
  {
    public final Bundle a(Intent paramIntent)
    {
      Log.w("RemoteInput", "RemoteInput is only supported from API Level 16");
      return null;
    }
    
    public final void a(RemoteInput[] paramArrayOfRemoteInput, Intent paramIntent, Bundle paramBundle)
    {
      Log.w("RemoteInput", "RemoteInput is only supported from API Level 16");
    }
  }
  
  static final class d
    implements RemoteInput.a
  {
    public final Bundle a(Intent paramIntent)
    {
      paramIntent = paramIntent.getClipData();
      if (paramIntent != null)
      {
        ClipDescription localClipDescription = paramIntent.getDescription();
        if ((localClipDescription.hasMimeType("text/vnd.android.intent")) && (localClipDescription.getLabel().equals("android.remoteinput.results"))) {
          return (Bundle)paramIntent.getItemAt(0).getIntent().getExtras().getParcelable("android.remoteinput.resultsData");
        }
      }
      return null;
    }
    
    public final void a(RemoteInput[] paramArrayOfRemoteInput, Intent paramIntent, Bundle paramBundle)
    {
      cw.a(paramArrayOfRemoteInput, paramIntent, paramBundle);
    }
  }
}


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