Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 586f0513 authored by Ken Wakasa's avatar Ken Wakasa
Browse files

Refine InputMethodInfo API

bug: 3370297
Change-Id: I2a18f3bdbe2fccb22e22cdae0f75aec5c703ad6d
parent 317b2ea1
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -231405,8 +231405,21 @@
 visibility="public"
>
</method>
<method name="getSubtypes"
 return="java.util.ArrayList&lt;android.view.inputmethod.InputMethodSubtype&gt;"
<method name="getSubtypeAt"
 return="android.view.inputmethod.InputMethodSubtype"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="index" type="int">
</parameter>
</method>
<method name="getSubtypeCount"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
+15 −2
Original line number Diff line number Diff line
@@ -231426,8 +231426,21 @@
 visibility="public"
>
</method>
<method name="getSubtypes"
 return="java.util.ArrayList&lt;android.view.inputmethod.InputMethodSubtype&gt;"
<method name="getSubtypeAt"
 return="android.view.inputmethod.InputMethodSubtype"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="index" type="int">
</parameter>
</method>
<method name="getSubtypeCount"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
+12 −3
Original line number Diff line number Diff line
@@ -265,10 +265,19 @@ public final class InputMethodInfo implements Parcelable {
    }

    /**
     * Return the subtypes of Input Method.
     * Return the count of the subtypes of Input Method.
     */
    public ArrayList<InputMethodSubtype> getSubtypes() {
        return mSubtypes;
    public int getSubtypeCount() {
        return mSubtypes.size();
    }

    /**
     * Return the Input Method's subtype at the specified index.
     *
     * @param index the index of the subtype to return.
     */
    public InputMethodSubtype getSubtypeAt(int index) {
        return mSubtypes.get(index);
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -124,9 +124,9 @@ public class InputMethodButton extends ImageView {
            if (subtype != null) {
                return pm.getDrawable(imi.getPackageName(), subtype.getIconResId(),
                        imi.getServiceInfo().applicationInfo);
            } else if (imi.getSubtypes().size() > 0) {
            } else if (imi.getSubtypeCount() > 0) {
                return pm.getDrawable(imi.getPackageName(),
                        imi.getSubtypes().get(0).getIconResId(),
                        imi.getSubtypeAt(0).getIconResId(),
                        imi.getServiceInfo().applicationInfo);
            } else {
                try {
+2 −2
Original line number Diff line number Diff line
@@ -342,9 +342,9 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O
            if (subtype != null) {
                return mPackageManager.getDrawable(imi.getPackageName(), subtype.getIconResId(),
                        imi.getServiceInfo().applicationInfo);
            } else if (imi.getSubtypes().size() > 0) {
            } else if (imi.getSubtypeCount() > 0) {
                return mPackageManager.getDrawable(imi.getPackageName(),
                        imi.getSubtypes().get(0).getIconResId(),
                        imi.getSubtypeAt(0).getIconResId(),
                        imi.getServiceInfo().applicationInfo);
            } else {
                try {
Loading