Merge changes from topics "enterprise_internet", "set_data_enabled"
* changes: Improved the network type to string SetDataEnabled indicate calling package
This commit is contained in:
@@ -3134,8 +3134,10 @@ public class TelephonyManager {
|
|||||||
return "LTE_CA";
|
return "LTE_CA";
|
||||||
case NETWORK_TYPE_NR:
|
case NETWORK_TYPE_NR:
|
||||||
return "NR";
|
return "NR";
|
||||||
default:
|
case NETWORK_TYPE_UNKNOWN:
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + type + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10291,7 +10293,7 @@ public class TelephonyManager {
|
|||||||
try {
|
try {
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null)
|
if (telephony != null)
|
||||||
return telephony.enableDataConnectivity();
|
return telephony.enableDataConnectivity(getOpPackageName());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "Error calling ITelephony#enableDataConnectivity", e);
|
Log.e(TAG, "Error calling ITelephony#enableDataConnectivity", e);
|
||||||
}
|
}
|
||||||
@@ -10305,7 +10307,7 @@ public class TelephonyManager {
|
|||||||
try {
|
try {
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null)
|
if (telephony != null)
|
||||||
return telephony.disableDataConnectivity();
|
return telephony.disableDataConnectivity(getOpPackageName());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "Error calling ITelephony#disableDataConnectivity", e);
|
Log.e(TAG, "Error calling ITelephony#disableDataConnectivity", e);
|
||||||
}
|
}
|
||||||
@@ -11682,7 +11684,7 @@ public class TelephonyManager {
|
|||||||
Log.d(TAG, "factoryReset: subId=" + subId);
|
Log.d(TAG, "factoryReset: subId=" + subId);
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null) {
|
if (telephony != null) {
|
||||||
telephony.factoryReset(subId);
|
telephony.factoryReset(subId, getOpPackageName());
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
@@ -11702,7 +11704,7 @@ public class TelephonyManager {
|
|||||||
Log.d(TAG, "resetSettings: subId=" + getSubId());
|
Log.d(TAG, "resetSettings: subId=" + getSubId());
|
||||||
ITelephony telephony = getITelephony();
|
ITelephony telephony = getITelephony();
|
||||||
if (telephony != null) {
|
if (telephony != null) {
|
||||||
telephony.factoryReset(getSubId());
|
telephony.factoryReset(getSubId(), getOpPackageName());
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
@@ -12942,7 +12944,7 @@ public class TelephonyManager {
|
|||||||
try {
|
try {
|
||||||
ITelephony service = getITelephony();
|
ITelephony service = getITelephony();
|
||||||
if (service != null) {
|
if (service != null) {
|
||||||
service.setDataEnabledForReason(subId, reason, enabled);
|
service.setDataEnabledForReason(subId, reason, enabled, getOpPackageName());
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("telephony service is null.");
|
throw new IllegalStateException("telephony service is null.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,13 +270,13 @@ interface ITelephony {
|
|||||||
* Allow mobile data connections.
|
* Allow mobile data connections.
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
boolean enableDataConnectivity();
|
boolean enableDataConnectivity(String callingPackage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disallow mobile data connections.
|
* Disallow mobile data connections.
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
boolean disableDataConnectivity();
|
boolean disableDataConnectivity(String callingPackage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report whether data connectivity is possible.
|
* Report whether data connectivity is possible.
|
||||||
@@ -959,8 +959,9 @@ interface ITelephony {
|
|||||||
* @param subId user preferred subId.
|
* @param subId user preferred subId.
|
||||||
* @param reason the reason the data enable change is taking place
|
* @param reason the reason the data enable change is taking place
|
||||||
* @param enable true to turn on, else false
|
* @param enable true to turn on, else false
|
||||||
|
* @param callingPackage the package that changed the data enabled state
|
||||||
*/
|
*/
|
||||||
void setDataEnabledForReason(int subId, int reason, boolean enable);
|
void setDataEnabledForReason(int subId, int reason, boolean enable, String callingPackage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether data is enabled for certain reason
|
* Return whether data is enabled for certain reason
|
||||||
@@ -1332,7 +1333,7 @@ interface ITelephony {
|
|||||||
*/
|
*/
|
||||||
PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId);
|
PhoneAccountHandle getPhoneAccountHandleForSubscriptionId(int subscriptionId);
|
||||||
|
|
||||||
void factoryReset(int subId);
|
void factoryReset(int subId, String callingPackage);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns users's current locale based on the SIM.
|
* Returns users's current locale based on the SIM.
|
||||||
|
|||||||
Reference in New Issue
Block a user