Change subId to int from long
automerge: 830a40f
* commit '830a40f0150ef7e9e34f85062a4f9c0b8fe7ce92':
Change subId to int from long
diff --git a/src/com/android/providers/telephony/TelephonyProvider.java b/src/com/android/providers/telephony/TelephonyProvider.java
index 8b8d088..1d80317 100644
--- a/src/com/android/providers/telephony/TelephonyProvider.java
+++ b/src/com/android/providers/telephony/TelephonyProvider.java
@@ -578,7 +578,7 @@
values.put(Telephony.Carriers.MVNO_MATCH_DATA, "");
}
- long subId = SubscriptionManager.getDefaultSubId();
+ int subId = SubscriptionManager.getDefaultSubId();
if (!values.containsKey(Telephony.Carriers.SUB_ID)) {
values.put(Telephony.Carriers.SUB_ID, subId);
}
@@ -616,7 +616,7 @@
return true;
}
- private void setPreferredApnId(Long id, long subId) {
+ private void setPreferredApnId(Long id, int subId) {
SharedPreferences sp = getContext().getSharedPreferences(
PREF_FILE + subId, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
@@ -624,7 +624,7 @@
editor.apply();
}
- private long getPreferredApnId(long subId) {
+ private long getPreferredApnId(int subId) {
SharedPreferences sp = getContext().getSharedPreferences(
PREF_FILE + subId, Context.MODE_PRIVATE);
return sp.getLong(COLUMN_APN_ID, -1);
@@ -635,7 +635,7 @@
String[] selectionArgs, String sort) {
TelephonyManager mTelephonyManager =
(TelephonyManager)getContext().getSystemService(Context.TELEPHONY_SERVICE);
- long subId = SubscriptionManager.getDefaultSubId();
+ int subId = SubscriptionManager.getDefaultSubId();
String subIdString;
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setStrict(true); // a little protection from injection attacks
@@ -646,7 +646,7 @@
case URL_TELEPHONY_USING_SUBID: {
subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
return null;
@@ -665,7 +665,7 @@
case URL_CURRENT_USING_SUBID: {
subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
return null;
@@ -691,7 +691,7 @@
case URL_PREFERAPN_NO_UPDATE_USING_SUBID: {
subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
return null;
@@ -773,7 +773,7 @@
public Uri insert(Uri url, ContentValues initialValues)
{
Uri result = null;
- long subId = SubscriptionManager.getDefaultSubId();
+ int subId = SubscriptionManager.getDefaultSubId();
checkPermission();
@@ -786,7 +786,7 @@
{
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
return result;
@@ -821,7 +821,7 @@
{
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
return result;
@@ -856,7 +856,7 @@
{
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
return result;
@@ -894,7 +894,7 @@
public int delete(Uri url, String where, String[] whereArgs)
{
int count = 0;
- long subId = SubscriptionManager.getDefaultSubId();
+ int subId = SubscriptionManager.getDefaultSubId();
checkPermission();
@@ -906,7 +906,7 @@
{
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
throw new IllegalArgumentException("Invalid subId " + url);
@@ -925,7 +925,7 @@
case URL_CURRENT_USING_SUBID: {
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
throw new IllegalArgumentException("Invalid subId " + url);
@@ -951,7 +951,7 @@
case URL_RESTOREAPN_USING_SUBID: {
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
throw new IllegalArgumentException("Invalid subId " + url);
@@ -969,7 +969,7 @@
case URL_PREFERAPN_NO_UPDATE_USING_SUBID: {
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
throw new IllegalArgumentException("Invalid subId " + url);
@@ -1008,7 +1008,7 @@
{
int count = 0;
int uriType = URL_UNKNOWN;
- long subId = SubscriptionManager.getDefaultSubId();
+ int subId = SubscriptionManager.getDefaultSubId();
checkPermission();
@@ -1020,7 +1020,7 @@
{
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
throw new IllegalArgumentException("Invalid subId " + url);
@@ -1040,7 +1040,7 @@
{
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
throw new IllegalArgumentException("Invalid subId " + url);
@@ -1072,7 +1072,7 @@
{
String subIdString = url.getLastPathSegment();
try {
- subId = Long.parseLong(subIdString);
+ subId = Integer.parseInt(subIdString);
} catch (NumberFormatException e) {
loge("NumberFormatException" + e);
throw new IllegalArgumentException("Invalid subId " + url);
@@ -1144,7 +1144,7 @@
private DatabaseHelper mOpenHelper;
- private void restoreDefaultAPN(long subId) {
+ private void restoreDefaultAPN(int subId) {
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
try {