Commit 0c9c09e1 authored by Etan Cohen's avatar Etan Cohen
Browse files

Make sure IMS service is created before calling on/off APIs.

Change-Id: I5ab50e570d06865b3b12a65454c0d4b2803c4ffc
parent 7da5a11a
......@@ -182,6 +182,8 @@ public class ImsManager {
*/
public int open(int serviceClass, PendingIntent incomingCallPendingIntent,
ImsConnectionStateListener listener) throws ImsException {
// TODO: check global IMS-enabled property and do not open if disabled
checkAndThrowExceptionIfServiceUnavailable();
if (incomingCallPendingIntent == null) {
......@@ -573,6 +575,8 @@ public class ImsManager {
* Used for turning on IMS.if its off already
*/
public void turnOnIms() throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();
try {
mImsService.turnOnIms();
} catch (RemoteException e) {
......@@ -585,6 +589,8 @@ public class ImsManager {
* Once turned off, all calls will be over CS.
*/
public void turnOffIms() throws ImsException {
checkAndThrowExceptionIfServiceUnavailable();
try {
mImsService.turnOffIms();
} catch (RemoteException e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment