Merge changes from topics "141018421_set3", "146905502", "remove_getPhoneId"

am: 939d3d62cd

Change-Id: Ib7278432e8564c0123c64cdc4934f280e528e687
This commit is contained in:
Xiangyu/Malcolm Chen
2020-01-08 16:08:26 -08:00
committed by android-build-merger
3 changed files with 17 additions and 5 deletions

View File

@@ -8761,6 +8761,7 @@ package android.telephony {
}
public class ServiceState implements android.os.Parcelable {
method @NonNull public android.telephony.ServiceState createLocationInfoSanitizedCopy(boolean);
method public int getDataRegistrationState();
method @Nullable public android.telephony.NetworkRegistrationInfo getNetworkRegistrationInfo(int, int);
method @NonNull public java.util.List<android.telephony.NetworkRegistrationInfo> getNetworkRegistrationInfoList();

View File

@@ -788,9 +788,11 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (checkFineLocationAccess(r, Build.VERSION_CODES.Q)) {
r.callback.onServiceStateChanged(rawSs);
} else if (checkCoarseLocationAccess(r, Build.VERSION_CODES.Q)) {
r.callback.onServiceStateChanged(rawSs.sanitizeLocationInfo(false));
r.callback.onServiceStateChanged(
rawSs.createLocationInfoSanitizedCopy(false));
} else {
r.callback.onServiceStateChanged(rawSs.sanitizeLocationInfo(true));
r.callback.onServiceStateChanged(
rawSs.createLocationInfoSanitizedCopy(true));
}
} catch (RemoteException ex) {
remove(r.binder);
@@ -1146,9 +1148,9 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (checkFineLocationAccess(r, Build.VERSION_CODES.Q)) {
stateToSend = new ServiceState(state);
} else if (checkCoarseLocationAccess(r, Build.VERSION_CODES.Q)) {
stateToSend = state.sanitizeLocationInfo(false);
stateToSend = state.createLocationInfoSanitizedCopy(false);
} else {
stateToSend = state.sanitizeLocationInfo(true);
stateToSend = state.createLocationInfoSanitizedCopy(true);
}
if (DBG) {
log("notifyServiceStateForSubscriber: callback.onSSC r=" + r

View File

@@ -1950,9 +1950,18 @@ public class ServiceState implements Parcelable {
* Returns a copy of self with location-identifying information removed.
* Always clears the NetworkRegistrationInfo's CellIdentity fields, but if removeCoarseLocation
* is true, clears other info as well.
*
* @param removeCoarseLocation Whether to also remove coarse location information.
* if false, it only clears fine location information such as
* NetworkRegistrationInfo's CellIdentity fields; If true, it will
* also remove other location information such as operator's MCC
* and MNC.
* @return the copied ServiceState with location info sanitized.
* @hide
*/
public ServiceState sanitizeLocationInfo(boolean removeCoarseLocation) {
@SystemApi
@NonNull
public ServiceState createLocationInfoSanitizedCopy(boolean removeCoarseLocation) {
ServiceState state = new ServiceState(this);
synchronized (state.mNetworkRegistrationInfos) {
List<NetworkRegistrationInfo> networkRegistrationInfos =