Merge changes from topic "servicelocation" am: 63ced6b508 am: 0b41b930a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1355808 Change-Id: I1992b4e1c9d7c2cf442515b4c397a9975478df85
This commit is contained in:
@@ -2340,58 +2340,6 @@ public class TelephonyManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables location update notifications. {@link PhoneStateListener#onCellLocationChanged
|
||||
* PhoneStateListener.onCellLocationChanged} will be called on location updates.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.CONTROL_LOCATION_UPDATES)
|
||||
public void enableLocationUpdates() {
|
||||
enableLocationUpdates(getSubId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables location update notifications for a subscription.
|
||||
* {@link PhoneStateListener#onCellLocationChanged
|
||||
* PhoneStateListener.onCellLocationChanged} will be called on location updates.
|
||||
*
|
||||
* @param subId for which the location updates are enabled
|
||||
* @hide
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.CONTROL_LOCATION_UPDATES)
|
||||
public void enableLocationUpdates(int subId) {
|
||||
try {
|
||||
ITelephony telephony = getITelephony();
|
||||
if (telephony != null)
|
||||
telephony.enableLocationUpdatesForSubscriber(subId);
|
||||
} catch (RemoteException ex) {
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables location update notifications. {@link PhoneStateListener#onCellLocationChanged
|
||||
* PhoneStateListener.onCellLocationChanged} will be called on location updates.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@RequiresPermission(android.Manifest.permission.CONTROL_LOCATION_UPDATES)
|
||||
public void disableLocationUpdates() {
|
||||
disableLocationUpdates(getSubId());
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void disableLocationUpdates(int subId) {
|
||||
try {
|
||||
ITelephony telephony = getITelephony();
|
||||
if (telephony != null)
|
||||
telephony.disableLocationUpdatesForSubscriber(subId);
|
||||
} catch (RemoteException ex) {
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the neighboring cell information of the device.
|
||||
*
|
||||
@@ -9307,17 +9255,14 @@ public class TelephonyManager {
|
||||
return RADIO_POWER_UNAVAILABLE;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
/**
|
||||
* This method should not be used due to privacy and stability concerns.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@SuppressLint("Doclava125")
|
||||
public void updateServiceLocation() {
|
||||
try {
|
||||
ITelephony telephony = getITelephony();
|
||||
if (telephony != null)
|
||||
telephony.updateServiceLocation();
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Error calling ITelephony#updateServiceLocation", e);
|
||||
}
|
||||
Log.e(TAG, "Do not call TelephonyManager#updateServiceLocation()");
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
|
||||
@@ -222,7 +222,7 @@ interface ITelephony {
|
||||
boolean setRadioPower(boolean turnOn);
|
||||
|
||||
/**
|
||||
* Request to update location information in service state
|
||||
* This method has been removed due to security and stability issues.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
void updateServiceLocation();
|
||||
@@ -233,35 +233,17 @@ interface ITelephony {
|
||||
void updateServiceLocationWithPackageName(String callingPkg);
|
||||
|
||||
/**
|
||||
* Request to update location information for a subscrition in service state
|
||||
* @param subId user preferred subId.
|
||||
*/
|
||||
void updateServiceLocationForSubscriber(int subId);
|
||||
|
||||
/**
|
||||
* Enable location update notifications.
|
||||
* This method has been removed due to security and stability issues.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
void enableLocationUpdates();
|
||||
|
||||
/**
|
||||
* Enable location update notifications.
|
||||
* @param subId user preferred subId.
|
||||
*/
|
||||
void enableLocationUpdatesForSubscriber(int subId);
|
||||
|
||||
/**
|
||||
* Disable location update notifications.
|
||||
* This method has been removed due to security and stability issues.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
void disableLocationUpdates();
|
||||
|
||||
/**
|
||||
* Disable location update notifications.
|
||||
* @param subId user preferred subId.
|
||||
*/
|
||||
void disableLocationUpdatesForSubscriber(int subId);
|
||||
|
||||
/**
|
||||
* Allow mobile data connections.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user