Merge "Fix empty network type list in triggerEmergencyNetworkScan"
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index e90f37c..cec3a94 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -2309,7 +2309,8 @@
phone.startSatellitePositionUpdates(onCompleted);
} else {
loge("startSatellitePositionUpdates: No phone object");
- request.result = SatelliteManager.SATELLITE_SERVICE_REQUEST_FAILED;
+ request.result =
+ SatelliteManager.SATELLITE_SERVICE_TELEPHONY_INTERNAL_ERROR;
notifyRequester(request);
}
break;
@@ -2344,7 +2345,8 @@
phone.stopSatellitePositionUpdates(onCompleted);
} else {
loge("stopSatellitePositionUpdates: No phone object");
- request.result = SatelliteManager.SATELLITE_SERVICE_REQUEST_FAILED;
+ request.result =
+ SatelliteManager.SATELLITE_SERVICE_TELEPHONY_INTERNAL_ERROR;
notifyRequester(request);
}
break;
@@ -12238,7 +12240,12 @@
@Override
@SatelliteManager.SatelliteServiceResult public int startSatellitePositionUpdates(int subId,
int callbackId, @NonNull ISatellitePositionUpdateCallback callback) {
- // TODO: check for SATELLITE_COMMUNICATION permission
+ enforceSatelliteCommunicationPermission("startSatellitePositionUpdates");
+
+ if (!isSatelliteEnabled(subId)) {
+ return SatelliteManager.SATELLITE_SERVICE_DISABLED;
+ }
+
Phone phone = getPhone(subId);
if (phone == null) {
loge("startSatellitePositionUpdates called with invalid subId: " + subId
@@ -12246,7 +12253,7 @@
phone = getDefaultPhone();
if (phone == null) {
loge("startSatellitePositionUpdates failed with no phone object.");
- return SatelliteManager.SATELLITE_SERVICE_REQUEST_FAILED;
+ return SatelliteManager.SATELLITE_SERVICE_TELEPHONY_INTERNAL_ERROR;
}
}
@@ -12280,7 +12287,12 @@
@Override
@SatelliteManager.SatelliteServiceResult public int stopSatellitePositionUpdates(int subId,
int callbackId) {
- // TODO: check for SATELLITE_COMMUNICATION permission
+ enforceSatelliteCommunicationPermission("stopSatellitePositionUpdates");
+
+ if (!isSatelliteEnabled(subId)) {
+ return SatelliteManager.SATELLITE_SERVICE_DISABLED;
+ }
+
Phone phone = getPhone(subId);
if (phone == null) {
loge("stopSatellitePositionUpdates called with invalid subId: " + subId
@@ -12288,7 +12300,7 @@
phone = getDefaultPhone();
if (phone == null) {
loge("stopSatellitePositionUpdates failed with no phone object.");
- return SatelliteManager.SATELLITE_SERVICE_REQUEST_FAILED;
+ return SatelliteManager.SATELLITE_SERVICE_TELEPHONY_INTERNAL_ERROR;
}
}
@@ -12296,7 +12308,7 @@
mSatellitePositionUpdateHandlers.remove(callbackId);
if (handler == null) {
loge("stopSatellitePositionUpdates: No SatellitePositionArgument");
- return SatelliteManager.SATELLITE_SERVICE_REQUEST_FAILED;
+ return SatelliteManager.SATELLITE_SERVICE_TELEPHONY_INTERNAL_ERROR;
} else {
phone.unregisterForSatellitePointingInfoChanged(handler);
phone.unregisterForSatelliteMessagesTransferComplete(handler);