ImsUtpublic class ImsUt extends Object implements ImsUtInterfaceProvides APIs for the supplementary service settings using IMS (Ut interface).
It is created from 3GPP TS 24.623 (XCAP(XML Configuration Access Protocol)
over the Ut interface for manipulating supplementary services). |
Fields Summary |
---|
public static final String | KEY_ACTIONActions : string format of ImsUtInterface#ACTION_xxx
"0" (deactivation), "1" (activation), "2" (not_used),
"3" (registration), "4" (erasure), "5" (Interrogation) | public static final String | KEY_CATEGORYCategories :
"OIP", "OIR", "TIP", "TIR", "CDIV", "CB", "CW", "CONF",
"ACR", "MCID", "ECT", "CCBS", "AOC", "MWI", "FA", "CAT"
Detailed parameter name will be determined according to the properties
of the supplementary service configuration. | public static final String | CATEGORY_OIP | public static final String | CATEGORY_OIR | public static final String | CATEGORY_TIP | public static final String | CATEGORY_TIR | public static final String | CATEGORY_CDIV | public static final String | CATEGORY_CB | public static final String | CATEGORY_CW | public static final String | CATEGORY_CONF | private static final String | TAG | private static final boolean | DBG | private Object | mLockObj | private final com.android.ims.internal.IImsUt | miUt | private HashMap | mPendingCmds |
Constructors Summary |
---|
public ImsUt(com.android.ims.internal.IImsUt iUt)
miUt = iUt;
if (miUt != null) {
try {
miUt.setListener(new IImsUtListenerProxy());
} catch (RemoteException e) {
}
}
|
Methods Summary |
---|
public void | close()
synchronized(mLockObj) {
if (miUt != null) {
try {
miUt.close();
} catch (RemoteException e) {
}
}
if (!mPendingCmds.isEmpty()) {
Map.Entry<Integer, Message>[] entries =
mPendingCmds.entrySet().toArray(new Map.Entry[mPendingCmds.size()]);
for (Map.Entry<Integer, Message> entry : entries) {
sendFailureReport(entry.getValue(),
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
mPendingCmds.clear();
}
}
| private void | log(java.lang.String s)
Rlog.d(TAG, s);
| private void | loge(java.lang.String s)
Rlog.e(TAG, s);
| private void | loge(java.lang.String s, java.lang.Throwable t)
Rlog.e(TAG, s, t);
| public void | queryCLIP(android.os.Message result)Retrieves the CLIP call setting.
if (DBG) {
log("queryCLIP :: Ut=" + miUt);
}
synchronized(mLockObj) {
try {
int id = miUt.queryCLIP();
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | queryCLIR(android.os.Message result)Retrieves the default CLIR setting.
if (DBG) {
log("queryCLIR :: Ut=" + miUt);
}
synchronized(mLockObj) {
try {
int id = miUt.queryCLIR();
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | queryCOLP(android.os.Message result)Retrieves the COLP call setting.
if (DBG) {
log("queryCOLP :: Ut=" + miUt);
}
synchronized(mLockObj) {
try {
int id = miUt.queryCOLP();
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | queryCOLR(android.os.Message result)Retrieves the COLR call setting.
if (DBG) {
log("queryCOLR :: Ut=" + miUt);
}
synchronized(mLockObj) {
try {
int id = miUt.queryCOLR();
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | queryCallBarring(int cbType, android.os.Message result)Retrieves the configuration of the call barring.
if (DBG) {
log("queryCallBarring :: Ut=" + miUt + ", cbType=" + cbType);
}
synchronized(mLockObj) {
try {
int id = miUt.queryCallBarring(cbType);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | queryCallForward(int condition, java.lang.String number, android.os.Message result)Retrieves the configuration of the call forward.
The return value of ((AsyncResult)result.obj) is an array of {@link ImsCallForwardInfo}.
if (DBG) {
log("queryCallForward :: Ut=" + miUt + ", condition=" + condition
+ ", number=" + number);
}
synchronized(mLockObj) {
try {
int id = miUt.queryCallForward(condition, number);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | queryCallWaiting(android.os.Message result)Retrieves the configuration of the call waiting.
The return value of ((AsyncResult)result.obj) is an array of {@link ImsSsInfo}.
if (DBG) {
log("queryCallWaiting :: Ut=" + miUt);
}
synchronized(mLockObj) {
try {
int id = miUt.queryCallWaiting();
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| private void | sendFailureReport(android.os.Message result, ImsReasonInfo error)
if (result == null || error == null) {
return;
}
String errorString;
// If ImsReasonInfo object does not have a String error code, use a
// default error string.
if (error.mExtraMessage == null) {
errorString = new String("IMS UT exception");
}
else {
errorString = new String(error.mExtraMessage);
}
AsyncResult.forMessage(result, null, new ImsException(errorString, error.mCode));
result.sendToTarget();
| private void | sendSuccessReport(android.os.Message result)
if (result == null) {
return;
}
AsyncResult.forMessage(result, null, null);
result.sendToTarget();
| private void | sendSuccessReport(android.os.Message result, java.lang.Object ssInfo)
if (result == null) {
return;
}
AsyncResult.forMessage(result, ssInfo, null);
result.sendToTarget();
| public void | transact(android.os.Bundle ssInfo, android.os.Message result)
if (DBG) {
log("transact :: Ut=" + miUt + ", ssInfo=" + ssInfo);
}
synchronized(mLockObj) {
try {
int id = miUt.transact(ssInfo);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | updateCLIP(boolean enable, android.os.Message result)Updates the configuration of the CLIP supplementary service.
if (DBG) {
log("updateCLIP :: Ut=" + miUt + ", enable=" + enable);
}
synchronized(mLockObj) {
try {
int id = miUt.updateCLIP(enable);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | updateCLIR(int clirMode, android.os.Message result)Updates the configuration of the CLIR supplementary service.
if (DBG) {
log("updateCLIR :: Ut=" + miUt + ", clirMode=" + clirMode);
}
synchronized(mLockObj) {
try {
int id = miUt.updateCLIR(clirMode);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | updateCOLP(boolean enable, android.os.Message result)Updates the configuration of the COLP supplementary service.
if (DBG) {
log("updateCallWaiting :: Ut=" + miUt + ", enable=" + enable);
}
synchronized(mLockObj) {
try {
int id = miUt.updateCOLP(enable);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | updateCOLR(int presentation, android.os.Message result)Updates the configuration of the COLR supplementary service.
if (DBG) {
log("updateCOLR :: Ut=" + miUt + ", presentation=" + presentation);
}
synchronized(mLockObj) {
try {
int id = miUt.updateCOLR(presentation);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | updateCallBarring(int cbType, boolean enable, android.os.Message result, java.lang.String[] barrList)Modifies the configuration of the call barring.
if (DBG) {
if (barrList != null) {
String bList = new String();
for (int i = 0; i < barrList.length; i++) {
bList.concat(barrList[i] + " ");
}
log("updateCallBarring :: Ut=" + miUt + ", cbType=" + cbType
+ ", enable=" + enable + ", barrList=" + bList);
}
else {
log("updateCallBarring :: Ut=" + miUt + ", cbType=" + cbType
+ ", enable=" + enable);
}
}
synchronized(mLockObj) {
try {
int id = miUt.updateCallBarring(cbType, enable, barrList);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | updateCallForward(int action, int condition, java.lang.String number, int timeSeconds, android.os.Message result)Modifies the configuration of the call forward.
if (DBG) {
log("updateCallForward :: Ut=" + miUt + ", action=" + action
+ ", condition=" + condition + ", number=" + number
+ ", timeSeconds=" + timeSeconds);
}
synchronized(mLockObj) {
try {
int id = miUt.updateCallForward(action, condition, number, timeSeconds);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
| public void | updateCallWaiting(boolean enable, android.os.Message result)Modifies the configuration of the call waiting.
if (DBG) {
log("updateCallWaiting :: Ut=" + miUt + ", enable=" + enable);
}
synchronized(mLockObj) {
try {
int id = miUt.updateCallWaiting(enable);
if (id < 0) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
return;
}
mPendingCmds.put(Integer.valueOf(id), result);
} catch (RemoteException e) {
sendFailureReport(result,
new ImsReasonInfo(ImsReasonInfo.CODE_UT_SERVICE_UNAVAILABLE, 0));
}
}
|
|