Merge "Skip notify celllocation of not really changed." am: 87a7929958 am: 96e61153a1 am: 584c1588a6 am: 217369162b am: 9af4f1d300

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1425373

Change-Id: I06d8be9d75baae150dfacde68d4338b362faf53f
This commit is contained in:
Meng Wang
2020-09-15 20:44:18 +00:00
committed by Automerger Merge Worker

View File

@@ -1799,20 +1799,16 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
}
@Override
public void notifyCellLocationForSubscriber(int subId, CellIdentity cellLocation) {
public void notifyCellLocationForSubscriber(int subId, CellIdentity cellIdentity) {
log("notifyCellLocationForSubscriber: subId=" + subId
+ " cellLocation=" + cellLocation);
+ " cellIdentity=" + cellIdentity);
if (!checkNotifyPermission("notifyCellLocation()")) {
return;
}
if (VDBG) {
log("notifyCellLocationForSubscriber: subId=" + subId
+ " cellLocation=" + cellLocation);
}
int phoneId = getPhoneIdFromSubId(subId);
synchronized (mRecords) {
if (validatePhoneId(phoneId)) {
mCellIdentity[phoneId] = cellLocation;
if (validatePhoneId(phoneId) && !Objects.equals(cellIdentity, mCellIdentity[phoneId])) {
mCellIdentity[phoneId] = cellIdentity;
for (Record r : mRecords) {
if (validateEventsAndUserLocked(r, PhoneStateListener.LISTEN_CELL_LOCATION) &&
idMatch(r.subId, subId, phoneId) &&
@@ -1820,10 +1816,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
&& checkFineLocationAccess(r, Build.VERSION_CODES.Q))) {
try {
if (DBG_LOC) {
log("notifyCellLocation: cellLocation=" + cellLocation
log("notifyCellLocation: cellIdentity=" + cellIdentity
+ " r=" + r);
}
r.callback.onCellLocationChanged(cellLocation);
r.callback.onCellLocationChanged(cellIdentity);
} catch (RemoteException ex) {
mRemoveList.add(r.binder);
}