Merge "A test api to override carrier information" into pi-dev
This commit is contained in:
@@ -779,6 +779,12 @@ package android.telephony {
|
|||||||
method public void setCdmaSystemAndNetworkId(int, int);
|
method public void setCdmaSystemAndNetworkId(int, int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class TelephonyManager {
|
||||||
|
method public int getCarrierIdListVersion();
|
||||||
|
method public void setCarrierTestOverride(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
|
||||||
|
field public static final int UNKNOWN_CARRIER_ID_LIST_VERSION = -1; // 0xffffffff
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package android.telephony.mbms {
|
package android.telephony.mbms {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import android.annotation.SuppressAutoDoc;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.SystemService;
|
import android.annotation.SystemService;
|
||||||
|
import android.annotation.TestApi;
|
||||||
import android.annotation.WorkerThread;
|
import android.annotation.WorkerThread;
|
||||||
import android.app.ActivityThread;
|
import android.app.ActivityThread;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
@@ -1066,6 +1067,13 @@ public class TelephonyManager {
|
|||||||
*/
|
*/
|
||||||
public static final int UNKNOWN_CARRIER_ID = -1;
|
public static final int UNKNOWN_CARRIER_ID = -1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An unknown carrier id list version.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@TestApi
|
||||||
|
public static final int UNKNOWN_CARRIER_ID_LIST_VERSION = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Broadcast Action: The subscription carrier identity has changed.
|
* Broadcast Action: The subscription carrier identity has changed.
|
||||||
* This intent could be sent on the following events:
|
* This intent could be sent on the following events:
|
||||||
@@ -7808,4 +7816,49 @@ public class TelephonyManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A test API to override carrier information including mccmnc, imsi, iccid, gid1, gid2,
|
||||||
|
* plmn and spn. This would be handy for, eg, forcing a particular carrier id, carrier's config
|
||||||
|
* (also any country or carrier overlays) to be loaded when using a test SIM with a call box.
|
||||||
|
*
|
||||||
|
* <p>Requires Permission:
|
||||||
|
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@TestApi
|
||||||
|
public void setCarrierTestOverride(String mccmnc, String imsi, String iccid, String gid1,
|
||||||
|
String gid2, String plmn, String spn) {
|
||||||
|
try {
|
||||||
|
ITelephony telephony = getITelephony();
|
||||||
|
if (telephony != null) {
|
||||||
|
telephony.setCarrierTestOverride(
|
||||||
|
getSubId(), mccmnc, imsi, iccid, gid1, gid2, plmn, spn);
|
||||||
|
}
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
// This could happen if binder process crashes.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A test API to return installed carrier id list version
|
||||||
|
*
|
||||||
|
* <p>Requires Permission:
|
||||||
|
* {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE}
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@TestApi
|
||||||
|
public int getCarrierIdListVersion() {
|
||||||
|
try {
|
||||||
|
ITelephony telephony = getITelephony();
|
||||||
|
if (telephony != null) {
|
||||||
|
return telephony.getCarrierIdListVersion(getSubId());
|
||||||
|
}
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
// This could happen if binder process crashes.
|
||||||
|
}
|
||||||
|
return UNKNOWN_CARRIER_ID_LIST_VERSION;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1486,4 +1486,17 @@ interface ITelephony {
|
|||||||
* screen is off) we want to turn on those indications even when the screen is off.
|
* screen is off) we want to turn on those indications even when the screen is off.
|
||||||
*/
|
*/
|
||||||
void setRadioIndicationUpdateMode(int subId, int filters, int mode);
|
void setRadioIndicationUpdateMode(int subId, int filters, int mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A test API to override carrier information including mccmnc, imsi, iccid, gid1, gid2,
|
||||||
|
* plmn and spn. This would be handy for, eg, forcing a particular carrier id, carrier's config
|
||||||
|
* (also any country or carrier overlays) to be loaded when using a test SIM with a call box.
|
||||||
|
*/
|
||||||
|
void setCarrierTestOverride(int subId, String mccmnc, String imsi, String iccid, String gid1,
|
||||||
|
String gid2, String plmn, String spn);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A test API to return installed carrier id list version.
|
||||||
|
*/
|
||||||
|
int getCarrierIdListVersion(int subId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user