Merge "fix the issue that sending wrong preferred networktype to RIL"
am: 695bbd1858
Change-Id: I25367a464940eed11028d98f27aa9dd9a1258bbc
This commit is contained in:
@@ -22,6 +22,7 @@ import android.hardware.radio.V1_4.CellInfo.Info;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.telephony.TelephonyManager.PrefNetworkMode;
|
||||
|
||||
import com.android.internal.telephony.RILConstants;
|
||||
|
||||
@@ -170,7 +171,8 @@ public class RadioAccessFamily implements Parcelable {
|
||||
};
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int getRafFromNetworkType(int type) {
|
||||
@TelephonyManager.NetworkTypeBitMask
|
||||
public static int getRafFromNetworkType(@PrefNetworkMode int type) {
|
||||
switch (type) {
|
||||
case RILConstants.NETWORK_MODE_WCDMA_PREF:
|
||||
return GSM | WCDMA;
|
||||
@@ -279,6 +281,7 @@ public class RadioAccessFamily implements Parcelable {
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||
@PrefNetworkMode
|
||||
public static int getNetworkTypeFromRaf(int raf) {
|
||||
raf = getAdjustedRaf(raf);
|
||||
|
||||
|
||||
@@ -6837,12 +6837,12 @@ public class TelephonyManager {
|
||||
* app has carrier privileges (see {@link #hasCarrierPrivileges}).
|
||||
*
|
||||
* @param subId the id of the subscription to set the preferred network type for.
|
||||
* @param networkType the preferred network type, defined in RILConstants.java.
|
||||
* @param networkType the preferred network type
|
||||
* @return true on success; false on any failure.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public boolean setPreferredNetworkType(int subId, int networkType) {
|
||||
public boolean setPreferredNetworkType(int subId, @PrefNetworkMode int networkType) {
|
||||
try {
|
||||
ITelephony telephony = getITelephony();
|
||||
if (telephony != null) {
|
||||
|
||||
Reference in New Issue
Block a user