summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard MacGregor <rmacgregor@cyngn.com>2016-02-22 16:52:18 -0800
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-08 10:42:50 -0700
commit503b9dc572b03034e7aa532d45aaf078d6c0b8da (patch)
tree4cd6babed18c22e2d692818a3fdd52561ef9f2b4
parent0cd7e34f9adbf124b77720d01e5202b34823adb1 (diff)
downloadandroid_packages_apps_PhoneCommon-503b9dc572b03034e7aa532d45aaf078d6c0b8da.tar.gz
android_packages_apps_PhoneCommon-503b9dc572b03034e7aa532d45aaf078d6c0b8da.tar.bz2
android_packages_apps_PhoneCommon-503b9dc572b03034e7aa532d45aaf078d6c0b8da.zip
[1/2] fix spinner/hint issues
Tickets CD-389 & CD-393 Change-Id: Ic9abcd294b25c26e236dcafe630b2261a00f1676
-rw-r--r--src-ambient/incall/CallMethodSpinnerAdapter.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src-ambient/incall/CallMethodSpinnerAdapter.java b/src-ambient/incall/CallMethodSpinnerAdapter.java
index 629fa64..62777b3 100644
--- a/src-ambient/incall/CallMethodSpinnerAdapter.java
+++ b/src-ambient/incall/CallMethodSpinnerAdapter.java
@@ -41,6 +41,7 @@ import static com.cyanogen.ambient.incall.util.InCallHelper.NO_COLOR;
public class CallMethodSpinnerAdapter extends ArrayAdapter<CallMethodInfo>
implements SpinnerAdapter {
private static final String TAG = CallMethodSpinnerAdapter.class.getSimpleName();
+ public static final int POSITION_UNKNOWN = -1;
private final Context mContext;
private Map<String, Integer> mComponentMap;
@@ -224,13 +225,13 @@ public class CallMethodSpinnerAdapter extends ArrayAdapter<CallMethodInfo>
/**
* Returns the position of the specified component within the spinner
* @param key String key for call method lookup
- * @return Position of specified component, 0 if not found.
+ * @return Position of specified component, POSITION_UNKNOWN if not found.
*/
public int getPosition(String key) {
- int position = 0;
+ int position = POSITION_UNKNOWN;
if (!TextUtils.isEmpty(key)) {
position = mComponentMap.containsKey(key) ?
- mComponentMap.get(key) : 0;
+ mComponentMap.get(key) : POSITION_UNKNOWN;
}
return position;
}