Merge "[mainline] Decouple ServiceState.bitmaskHasTech and getBitmaskForTech" am: ecce39622d
am: 2be27a8d81
Change-Id: Ia5c3e5043d885812fa013caa7b0786819ec81e5c
This commit is contained in:
@@ -29,7 +29,6 @@ import android.os.Bundle;
|
|||||||
import android.os.PersistableBundle;
|
import android.os.PersistableBundle;
|
||||||
import android.provider.Telephony;
|
import android.provider.Telephony;
|
||||||
import android.telephony.CarrierConfigManager;
|
import android.telephony.CarrierConfigManager;
|
||||||
import android.telephony.ServiceState;
|
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -1000,7 +999,7 @@ public class ApnEditor extends SettingsPreferenceFragment
|
|||||||
bearerBitmask = 0;
|
bearerBitmask = 0;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
bearerBitmask |= ServiceState.getBitmaskForTech(Integer.parseInt(bearer));
|
bearerBitmask |= getBitmaskForTech(Integer.parseInt(bearer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
callUpdate = setIntValueAndCheckIfDiff(values,
|
callUpdate = setIntValueAndCheckIfDiff(values,
|
||||||
@@ -1012,7 +1011,7 @@ public class ApnEditor extends SettingsPreferenceFragment
|
|||||||
int bearerVal;
|
int bearerVal;
|
||||||
if (bearerBitmask == 0 || mBearerInitialVal == 0) {
|
if (bearerBitmask == 0 || mBearerInitialVal == 0) {
|
||||||
bearerVal = 0;
|
bearerVal = 0;
|
||||||
} else if (ServiceState.bitmaskHasTech(bearerBitmask, mBearerInitialVal)) {
|
} else if (bitmaskHasTech(bearerBitmask, mBearerInitialVal)) {
|
||||||
bearerVal = mBearerInitialVal;
|
bearerVal = mBearerInitialVal;
|
||||||
} else {
|
} else {
|
||||||
// bearer field was being used but bitmask has changed now and does not include the
|
// bearer field was being used but bitmask has changed now and does not include the
|
||||||
@@ -1304,4 +1303,20 @@ public class ApnEditor extends SettingsPreferenceFragment
|
|||||||
return (String) mData[index];
|
return (String) mData[index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int getBitmaskForTech(int radioTech) {
|
||||||
|
if (radioTech >= 1) {
|
||||||
|
return (1 << (radioTech - 1));
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean bitmaskHasTech(int bearerBitmask, int radioTech) {
|
||||||
|
if (bearerBitmask == 0) {
|
||||||
|
return true;
|
||||||
|
} else if (radioTech >= 1) {
|
||||||
|
return ((bearerBitmask & (1 << (radioTech - 1))) != 0);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user