summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hall Liu <hallliu@google.com> 2017-05-27 01:08:29 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-05-27 01:08:31 +0000
commit8e7057ccf3824d1421a12abad7a2ba8b07e877c6 (patch)
tree122f5f226c61061a97ae20558bf73ce53f06f9b2
parent725e212de31046763d1e6164c96a0c6484c6a4a4 (diff)
parent80a8687a87a7d268164b1f3dd5e37a0b2cd7407e (diff)
Merge "Add new error codes in MbmsException"
-rw-r--r--telephony/java/android/telephony/MbmsStreamingManager.java16
-rw-r--r--telephony/java/android/telephony/mbms/MbmsException.java8
-rw-r--r--telephony/java/android/telephony/mbms/StreamingService.java19
3 files changed, 14 insertions, 29 deletions
diff --git a/telephony/java/android/telephony/MbmsStreamingManager.java b/telephony/java/android/telephony/MbmsStreamingManager.java
index 675442610b0b..e90a63cb7881 100644
--- a/telephony/java/android/telephony/MbmsStreamingManager.java
+++ b/telephony/java/android/telephony/MbmsStreamingManager.java
@@ -156,7 +156,6 @@ public class MbmsStreamingManager {
*
* This may throw an {@link MbmsException} containing one of the following errors:
* {@link MbmsException#ERROR_MIDDLEWARE_NOT_BOUND}
- * {@link MbmsException#ERROR_UNKNOWN_REMOTE_EXCEPTION}
* {@link MbmsException#ERROR_CONCURRENT_SERVICE_LIMIT_REACHED}
* {@link MbmsException#ERROR_SERVICE_LOST}
*
@@ -174,12 +173,10 @@ public class MbmsStreamingManager {
if (returnCode != MbmsException.SUCCESS) {
throw new MbmsException(returnCode);
}
- } catch (DeadObjectException e) {
+ } catch (RemoteException e) {
Log.w(LOG_TAG, "Remote process died");
mService = null;
throw new MbmsException(MbmsException.ERROR_SERVICE_LOST);
- } catch (RemoteException e) {
- throw new MbmsException(MbmsException.ERROR_UNKNOWN_REMOTE_EXCEPTION);
}
}
@@ -191,7 +188,6 @@ public class MbmsStreamingManager {
*
* May throw an {@link MbmsException} containing any of the following error codes:
* {@link MbmsException#ERROR_MIDDLEWARE_NOT_BOUND}
- * {@link MbmsException#ERROR_UNKNOWN_REMOTE_EXCEPTION}
* {@link MbmsException#ERROR_CONCURRENT_SERVICE_LIMIT_REACHED}
* {@link MbmsException#ERROR_SERVICE_LOST}
*
@@ -211,12 +207,10 @@ public class MbmsStreamingManager {
if (returnCode != MbmsException.SUCCESS) {
throw new MbmsException(returnCode);
}
- } catch (DeadObjectException e) {
+ } catch (RemoteException e) {
Log.w(LOG_TAG, "Remote process died");
mService = null;
throw new MbmsException(MbmsException.ERROR_SERVICE_LOST);
- } catch (RemoteException e) {
- throw new MbmsException(MbmsException.ERROR_UNKNOWN_REMOTE_EXCEPTION);
}
return new StreamingService(
@@ -280,11 +274,7 @@ public class MbmsStreamingManager {
} catch (RemoteException e) {
mService = null;
Log.e(LOG_TAG, "Service died before initialization");
- if (e instanceof DeadObjectException) {
- throw new MbmsException(MbmsException.ERROR_SERVICE_LOST);
- } else {
- throw new MbmsException(MbmsException.ERROR_UNKNOWN_REMOTE_EXCEPTION);
- }
+ throw new MbmsException(MbmsException.ERROR_SERVICE_LOST);
}
}
}
diff --git a/telephony/java/android/telephony/mbms/MbmsException.java b/telephony/java/android/telephony/mbms/MbmsException.java
index ac14c4f18320..6b905921dba0 100644
--- a/telephony/java/android/telephony/mbms/MbmsException.java
+++ b/telephony/java/android/telephony/mbms/MbmsException.java
@@ -22,7 +22,7 @@ public class MbmsException extends Exception {
public static final int ERROR_NO_SERVICE_INSTALLED = 1;
public static final int ERROR_MULTIPLE_SERVICES_INSTALLED = 2;
public static final int ERROR_BIND_TIMEOUT_OR_FAILURE = 3;
- public static final int ERROR_UNKNOWN_REMOTE_EXCEPTION = 4;
+ public static final int ERROR_UNABLE_TO_INITIALIZE = 4;
public static final int ERROR_ALREADY_INITIALIZED = 5;
public static final int ERROR_CONCURRENT_SERVICE_LIMIT_REACHED = 6;
public static final int ERROR_MIDDLEWARE_NOT_BOUND = 7;
@@ -30,6 +30,12 @@ public class MbmsException extends Exception {
public static final int ERROR_STREAM_ALREADY_STARTED = 9;
public static final int ERROR_END_OF_SESSION = 10;
public static final int ERROR_SERVICE_LOST = 11;
+ public static final int ERROR_APP_PERMISSIONS_NOT_GRANTED = 12;
+ public static final int ERROR_IN_E911 = 13;
+ public static final int ERROR_OUT_OF_MEMORY = 14;
+ public static final int ERROR_NOT_CONNECTED_TO_HOME_CARRIER_LTE = 15;
+ public static final int ERROR_UNABLE_TO_READ_SIM = 16;
+ public static final int ERROR_CARRIER_CHANGE_NOT_ALLOWED = 17;
private final int mErrorCode;
diff --git a/telephony/java/android/telephony/mbms/StreamingService.java b/telephony/java/android/telephony/mbms/StreamingService.java
index 745cb98bc3bf..85ba6251905c 100644
--- a/telephony/java/android/telephony/mbms/StreamingService.java
+++ b/telephony/java/android/telephony/mbms/StreamingService.java
@@ -55,8 +55,7 @@ public class StreamingService {
/**
* Retreive the Uri used to play this stream.
*
- * This may throw a {@link MbmsException} with the error codes
- * {@link MbmsException#ERROR_UNKNOWN_REMOTE_EXCEPTION} or
+ * This may throw a {@link MbmsException} with the error code
* {@link MbmsException#ERROR_SERVICE_LOST}
*
* @return The {@link Uri} to pass to the streaming client.
@@ -68,13 +67,10 @@ public class StreamingService {
try {
return mService.getPlaybackUri(mAppName, mSubscriptionId, mServiceInfo.getServiceId());
- } catch (DeadObjectException e) {
+ } catch (RemoteException e) {
Log.w(LOG_TAG, "Remote process died");
mService = null;
throw new MbmsException(MbmsException.ERROR_SERVICE_LOST);
- } catch (RemoteException e) {
- Log.w(LOG_TAG, "Caught remote exception calling getPlaybackUri: " + e);
- throw new MbmsException(MbmsException.ERROR_UNKNOWN_REMOTE_EXCEPTION);
}
}
@@ -88,7 +84,6 @@ public class StreamingService {
/**
* Stop streaming this service.
* This may throw a {@link MbmsException} with the error code
- * {@link MbmsException#ERROR_UNKNOWN_REMOTE_EXCEPTION} or
* {@link MbmsException#ERROR_SERVICE_LOST}
*/
public void stopStreaming() throws MbmsException {
@@ -98,13 +93,10 @@ public class StreamingService {
try {
mService.stopStreaming(mAppName, mSubscriptionId, mServiceInfo.getServiceId());
- } catch (DeadObjectException e) {
+ } catch (RemoteException e) {
Log.w(LOG_TAG, "Remote process died");
mService = null;
throw new MbmsException(MbmsException.ERROR_SERVICE_LOST);
- } catch (RemoteException e) {
- Log.w(LOG_TAG, "Caught remote exception calling stopStreaming: " + e);
- throw new MbmsException(MbmsException.ERROR_UNKNOWN_REMOTE_EXCEPTION);
}
}
@@ -115,13 +107,10 @@ public class StreamingService {
try {
mService.disposeStream(mAppName, mSubscriptionId, mServiceInfo.getServiceId());
- } catch (DeadObjectException e) {
+ } catch (RemoteException e) {
Log.w(LOG_TAG, "Remote process died");
mService = null;
throw new MbmsException(MbmsException.ERROR_SERVICE_LOST);
- } catch (RemoteException e) {
- Log.w(LOG_TAG, "Caught remote exception calling dispose: " + e);
- throw new MbmsException(MbmsException.ERROR_UNKNOWN_REMOTE_EXCEPTION);
}
}
}