summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-10-22 17:45:26 -0700
committerNancy Chen <nancychen@google.com>2014-10-22 21:44:45 -0700
commit3ace54b895c97f0e98e989667238be9c96c3b40c (patch)
tree19529b4a01728ba5e775624a8d373abae0af962b /telephony
parentdf0ace26279f16beacdf9206cb2a8ecc126aecb7 (diff)
downloadframeworks_base-3ace54b895c97f0e98e989667238be9c96c3b40c.zip
frameworks_base-3ace54b895c97f0e98e989667238be9c96c3b40c.tar.gz
frameworks_base-3ace54b895c97f0e98e989667238be9c96c3b40c.tar.bz2
Add getter methods in SubInfoRecord for UI. Adapt PhoneAccount.
Settings and Dialer need label, icon, and color for UI display of subscriptions/SIMs. Add getters for these methods in SubInfoRecord. Sets up for the following changes: + getIcon will return a drawable instead of a resource ID + getColor will return a color value instead of an index PhoneAccount will also be adding these changes which will be adopted from SubInfoRecord. Adds changes that were reverted from ag/563976. Bug: 17971273 Change-Id: Ie2beedf8475c6deb48a6ab83bc9656c1142cc004
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/SubInfoRecord.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/SubInfoRecord.java b/telephony/java/android/telephony/SubInfoRecord.java
index b9de871..f2df079 100644
--- a/telephony/java/android/telephony/SubInfoRecord.java
+++ b/telephony/java/android/telephony/SubInfoRecord.java
@@ -16,6 +16,7 @@
package android.telephony;
+import android.graphics.drawable.BitmapDrawable;
import android.os.Parcel;
import android.os.Parcelable;
@@ -107,6 +108,31 @@ public class SubInfoRecord implements Parcelable {
this.mnc = mnc;
}
+ /**
+ * Returns the string displayed to the user that identifies this subscription
+ */
+ public String getLabel() {
+ return this.displayName;
+ }
+
+ /**
+ * Return the icon used to identify this SIM.
+ * TODO: return the correct drawable.
+ */
+ public BitmapDrawable getIconDrawable() {
+ return new BitmapDrawable();
+ }
+
+ /**
+ * Return the color to be used for when displaying to the user. This is the value of the color.
+ * ex: 0x00ff00
+ */
+ public int getColor() {
+ // Note: This color is currently an index into a list of drawables, but this is soon to
+ // change.
+ return this.color;
+ }
+
public static final Parcelable.Creator<SubInfoRecord> CREATOR = new Parcelable.Creator<SubInfoRecord>() {
@Override
public SubInfoRecord createFromParcel(Parcel source) {