InputConnectionCompat.java 10.7 KB
package android.support.v13.view.inputmethod;

import android.annotation.TargetApi;
import android.content.ClipDescription;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.v4.os.BuildCompat;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputConnectionWrapper;
import android.view.inputmethod.InputContentInfo;

@TargetApi(13)
@RequiresApi(13)
public final class InputConnectionCompat
{
  public static int INPUT_CONTENT_GRANT_READ_URI_PERMISSION;
  private static final c a;
  
  static
  {
    if (BuildCompat.isAtLeastNMR1()) {}
    for (a = new a((byte)0);; a = new b())
    {
      INPUT_CONTENT_GRANT_READ_URI_PERMISSION = 1;
      return;
    }
  }
  
  public static boolean commitContent(@NonNull InputConnection paramInputConnection, @NonNull EditorInfo paramEditorInfo, @NonNull InputContentInfoCompat paramInputContentInfoCompat, int paramInt, @Nullable Bundle paramBundle)
  {
    ClipDescription localClipDescription = paramInputContentInfoCompat.getDescription();
    paramEditorInfo = EditorInfoCompat.getContentMimeTypes(paramEditorInfo);
    int j = paramEditorInfo.length;
    int i = 0;
    if (i < j) {
      if (!localClipDescription.hasMimeType(paramEditorInfo[i])) {}
    }
    for (i = 1;; i = 0)
    {
      if (i == 0)
      {
        return false;
        i += 1;
        break;
      }
      return a.a(paramInputConnection, paramInputContentInfoCompat, paramInt, paramBundle);
    }
  }
  
  @NonNull
  public static InputConnection createWrapper(@NonNull InputConnection paramInputConnection, @NonNull EditorInfo paramEditorInfo, @NonNull OnCommitContentListener paramOnCommitContentListener)
  {
    if (paramInputConnection == null) {
      throw new IllegalArgumentException("inputConnection must be non-null");
    }
    if (paramEditorInfo == null) {
      throw new IllegalArgumentException("editorInfo must be non-null");
    }
    if (paramOnCommitContentListener == null) {
      throw new IllegalArgumentException("onCommitContentListener must be non-null");
    }
    return a.a(paramInputConnection, paramEditorInfo, paramOnCommitContentListener);
  }
  
  public static abstract interface OnCommitContentListener
  {
    public abstract boolean onCommitContent(InputContentInfoCompat paramInputContentInfoCompat, int paramInt, Bundle paramBundle);
  }
  
  static final class a
    implements InputConnectionCompat.c
  {
    @Nullable
    public final InputConnection a(@Nullable InputConnection paramInputConnection, @NonNull EditorInfo paramEditorInfo, @Nullable final InputConnectionCompat.OnCommitContentListener paramOnCommitContentListener)
    {
      new InputConnectionCompatApi25.1(paramInputConnection, new InputConnectionCompatApi25.OnCommitContentListener()
      {
        public final boolean onCommitContent(Object paramAnonymousObject, int paramAnonymousInt, Bundle paramAnonymousBundle)
        {
          paramAnonymousObject = InputContentInfoCompat.wrap(paramAnonymousObject);
          return paramOnCommitContentListener.onCommitContent((InputContentInfoCompat)paramAnonymousObject, paramAnonymousInt, paramAnonymousBundle);
        }
      });
    }
    
    public final boolean a(@NonNull InputConnection paramInputConnection, @NonNull InputContentInfoCompat paramInputContentInfoCompat, int paramInt, @Nullable Bundle paramBundle)
    {
      return paramInputConnection.commitContent((InputContentInfo)paramInputContentInfoCompat.unwrap(), paramInt, paramBundle);
    }
  }
  
  static final class b
    implements InputConnectionCompat.c
  {
    private static String a = "android.support.v13.view.inputmethod.InputConnectionCompat.COMMIT_CONTENT";
    private static String b = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_URI";
    private static String c = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_DESCRIPTION";
    private static String d = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_LINK_URI";
    private static String e = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_OPTS";
    private static String f = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_FLAGS";
    private static String g = "android.support.v13.view.inputmethod.InputConnectionCompat.CONTENT_RESULT_RECEIVER";
    
    /* Error */
    static boolean a(@Nullable String paramString, @NonNull Bundle paramBundle, @NonNull InputConnectionCompat.OnCommitContentListener paramOnCommitContentListener)
    {
      // Byte code:
      //   0: getstatic 24	android/support/v13/view/inputmethod/InputConnectionCompat$b:a	Ljava/lang/String;
      //   3: aload_0
      //   4: invokestatic 61	android/text/TextUtils:equals	(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
      //   7: ifne +5 -> 12
      //   10: iconst_0
      //   11: ireturn
      //   12: aload_1
      //   13: ifnull -3 -> 10
      //   16: aload_1
      //   17: getstatic 48	android/support/v13/view/inputmethod/InputConnectionCompat$b:g	Ljava/lang/String;
      //   20: invokevirtual 67	android/os/Bundle:getParcelable	(Ljava/lang/String;)Landroid/os/Parcelable;
      //   23: checkcast 69	android/os/ResultReceiver
      //   26: astore_0
      //   27: aload_1
      //   28: getstatic 28	android/support/v13/view/inputmethod/InputConnectionCompat$b:b	Ljava/lang/String;
      //   31: invokevirtual 67	android/os/Bundle:getParcelable	(Ljava/lang/String;)Landroid/os/Parcelable;
      //   34: checkcast 71	android/net/Uri
      //   37: astore 5
      //   39: aload_1
      //   40: getstatic 32	android/support/v13/view/inputmethod/InputConnectionCompat$b:c	Ljava/lang/String;
      //   43: invokevirtual 67	android/os/Bundle:getParcelable	(Ljava/lang/String;)Landroid/os/Parcelable;
      //   46: checkcast 73	android/content/ClipDescription
      //   49: astore 6
      //   51: aload_1
      //   52: getstatic 36	android/support/v13/view/inputmethod/InputConnectionCompat$b:d	Ljava/lang/String;
      //   55: invokevirtual 67	android/os/Bundle:getParcelable	(Ljava/lang/String;)Landroid/os/Parcelable;
      //   58: checkcast 71	android/net/Uri
      //   61: astore 7
      //   63: aload_1
      //   64: getstatic 44	android/support/v13/view/inputmethod/InputConnectionCompat$b:f	Ljava/lang/String;
      //   67: invokevirtual 77	android/os/Bundle:getInt	(Ljava/lang/String;)I
      //   70: istore_3
      //   71: aload_1
      //   72: getstatic 40	android/support/v13/view/inputmethod/InputConnectionCompat$b:e	Ljava/lang/String;
      //   75: invokevirtual 67	android/os/Bundle:getParcelable	(Ljava/lang/String;)Landroid/os/Parcelable;
      //   78: checkcast 63	android/os/Bundle
      //   81: astore_1
      //   82: aload_2
      //   83: new 79	android/support/v13/view/inputmethod/InputContentInfoCompat
      //   86: dup
      //   87: aload 5
      //   89: aload 6
      //   91: aload 7
      //   93: invokespecial 82	android/support/v13/view/inputmethod/InputContentInfoCompat:<init>	(Landroid/net/Uri;Landroid/content/ClipDescription;Landroid/net/Uri;)V
      //   96: iload_3
      //   97: aload_1
      //   98: invokeinterface 88 4 0
      //   103: istore 4
      //   105: aload_0
      //   106: ifnull +16 -> 122
      //   109: iload 4
      //   111: ifeq +14 -> 125
      //   114: iconst_1
      //   115: istore_3
      //   116: aload_0
      //   117: iload_3
      //   118: aconst_null
      //   119: invokevirtual 92	android/os/ResultReceiver:send	(ILandroid/os/Bundle;)V
      //   122: iload 4
      //   124: ireturn
      //   125: iconst_0
      //   126: istore_3
      //   127: goto -11 -> 116
      //   130: astore_1
      //   131: aconst_null
      //   132: astore_0
      //   133: aload_0
      //   134: ifnull +9 -> 143
      //   137: aload_0
      //   138: iconst_0
      //   139: aconst_null
      //   140: invokevirtual 92	android/os/ResultReceiver:send	(ILandroid/os/Bundle;)V
      //   143: aload_1
      //   144: athrow
      //   145: astore_1
      //   146: goto -13 -> 133
      // Local variable table:
      //   start	length	slot	name	signature
      //   0	149	0	paramString	String
      //   0	149	1	paramBundle	Bundle
      //   0	149	2	paramOnCommitContentListener	InputConnectionCompat.OnCommitContentListener
      //   70	57	3	i	int
      //   103	20	4	bool	boolean
      //   37	51	5	localUri1	android.net.Uri
      //   49	41	6	localClipDescription	ClipDescription
      //   61	31	7	localUri2	android.net.Uri
      // Exception table:
      //   from	to	target	type
      //   16	27	130	finally
      //   27	105	145	finally
    }
    
    @NonNull
    public final InputConnection a(@NonNull InputConnection paramInputConnection, @NonNull EditorInfo paramEditorInfo, @NonNull final InputConnectionCompat.OnCommitContentListener paramOnCommitContentListener)
    {
      if (EditorInfoCompat.getContentMimeTypes(paramEditorInfo).length == 0) {
        return paramInputConnection;
      }
      new InputConnectionWrapper(paramInputConnection, paramOnCommitContentListener)
      {
        public final boolean performPrivateCommand(String paramAnonymousString, Bundle paramAnonymousBundle)
        {
          if (InputConnectionCompat.b.a(paramAnonymousString, paramAnonymousBundle, paramOnCommitContentListener)) {
            return true;
          }
          return super.performPrivateCommand(paramAnonymousString, paramAnonymousBundle);
        }
      };
    }
    
    public final boolean a(@NonNull InputConnection paramInputConnection, @NonNull InputContentInfoCompat paramInputContentInfoCompat, int paramInt, @Nullable Bundle paramBundle)
    {
      Bundle localBundle = new Bundle();
      localBundle.putParcelable(b, paramInputContentInfoCompat.getContentUri());
      localBundle.putParcelable(c, paramInputContentInfoCompat.getDescription());
      localBundle.putParcelable(d, paramInputContentInfoCompat.getLinkUri());
      localBundle.putInt(f, paramInt);
      localBundle.putParcelable(e, paramBundle);
      return paramInputConnection.performPrivateCommand(a, localBundle);
    }
  }
  
  static abstract interface c
  {
    @NonNull
    public abstract InputConnection a(@NonNull InputConnection paramInputConnection, @NonNull EditorInfo paramEditorInfo, @NonNull InputConnectionCompat.OnCommitContentListener paramOnCommitContentListener);
    
    public abstract boolean a(@NonNull InputConnection paramInputConnection, @NonNull InputContentInfoCompat paramInputContentInfoCompat, int paramInt, @Nullable Bundle paramBundle);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/android/support/v13/view/inputmethod/InputConnectionCompat.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */