Added Cellular Data for Multi-Sim Data Usage

+ Bug Fix: SimSettings would crash if a SIM was not in the first slot.

Change-Id: Iee75ea78dde72dc7d2d588caff1ddd451347a8f5
This commit is contained in:
PauloftheWest
2014-10-28 08:30:05 -07:00
parent 917aaf9ebd
commit 98523c8b8b
2 changed files with 28 additions and 10 deletions

View File

@@ -941,7 +941,8 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
mMobileDataEnabled = null;
} else {
//SUB SELECT
isEnable = mTelephonyManager.getDataEnabled() && isMobileDataAvailable(subId);
isEnable = mTelephonyManager.getDataEnabled()
&& (subId == SubscriptionManager.getDefaultDataSubId());
}
return isEnable;
}
@@ -2594,8 +2595,21 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
}
//SUB SELECT
private boolean isMobileDataAvailable(int subId) {
private boolean isMobileDataAvailable(long subId) {
int[] subIds = SubscriptionManager.getSubId(PhoneConstants.SUB1);
return subIds[0] == subId;
if (subIds != null && subIds[0] == subId) {
return true;
}
subIds = SubscriptionManager.getSubId(PhoneConstants.SUB2);
if (subIds != null && subIds[0] == subId) {
return true;
}
subIds = SubscriptionManager.getSubId(PhoneConstants.SUB3);
if (subIds != null && subIds[0] == subId) {
return true;
}
return false;
}
}