summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2016-02-03 15:27:48 -0800
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-08 10:42:50 -0700
commit7c94eb8a4ed4f55d70e13616b21fab4ba906d04e (patch)
treeb24e78ee661d2657c4a1eeefa770e9ab79219cff
parentec3dbfad0901ce0ca04ce949cb3044b21f51aba7 (diff)
downloadandroid_packages_apps_PhoneCommon-7c94eb8a4ed4f55d70e13616b21fab4ba906d04e.tar.gz
android_packages_apps_PhoneCommon-7c94eb8a4ed4f55d70e13616b21fab4ba906d04e.tar.bz2
android_packages_apps_PhoneCommon-7c94eb8a4ed4f55d70e13616b21fab4ba906d04e.zip
Use new subscription format
Ticket: CD-338 Change-Id: Iab87e168a160c76665ca8354bc884441af610926
-rw-r--r--res/values/cm_plurals.xml22
-rw-r--r--src-ambient/incall/CallMethodInfo.java24
2 files changed, 24 insertions, 22 deletions
diff --git a/res/values/cm_plurals.xml b/res/values/cm_plurals.xml
new file mode 100644
index 0000000..0ed759e
--- /dev/null
+++ b/res/values/cm_plurals.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <plurals name="number_of_incall_subscriptions">
+ <item quantity="one">%d Subscription</item>
+ <item quantity="other">%d Subscriptions</item>
+ </plurals>
+</resources> \ No newline at end of file
diff --git a/src-ambient/incall/CallMethodInfo.java b/src-ambient/incall/CallMethodInfo.java
index f98e811..c4e0b52 100644
--- a/src-ambient/incall/CallMethodInfo.java
+++ b/src-ambient/incall/CallMethodInfo.java
@@ -181,28 +181,8 @@ public class CallMethodInfo {
List<SubscriptionInfo> subscriptionInfos = ci.subscriptions;
if (subscriptionInfos != null && !subscriptionInfos.isEmpty()) {
- int subscriptionSize = subscriptionInfos.size();
- StringBuilder subscripText = new StringBuilder();
- int extraCount = 0;
- for (int i = 0; i < subscriptionSize; i++) {
- SubscriptionInfo si = subscriptionInfos.get(i);
- if (i >= 3) {
- extraCount++;
- if (i == subscriptionSize - 1) {
- subscripText.append("+" + extraCount);
- }
- } else {
- // Region codes should be no larger than three char long the credits bar
- // can only show so much.
- if (si.regionCode.length() <= 3) {
- subscripText.append(si.regionCode);
- if (i < subscriptionSize - 1) {
- subscripText.append(", ");
- }
- }
- }
- }
- return subscripText.toString();
+ int size = subscriptionInfos.size();
+ return r.getQuantityString(R.plurals.number_of_incall_subscriptions, size, size);
} else {
CreditBalance balance = ci.balance;
if (balance != null) {