Skip to content

Commit 24440cf

Browse files
Naveen KallaJean-Baptiste Queru
authored andcommitted
Support for User to User Signaling (UUS)
Enabling passing UUS information during MO and MT calls. Change-Id: I31621c0a9d3c0607d99d18c49bb6c593cadd0327
1 parent cf1250c commit 24440cf

File tree

13 files changed

+241
-8
lines changed

13 files changed

+241
-8
lines changed

telephony/java/com/android/internal/telephony/CommandsInterface.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,19 @@ public boolean isCdma() {
659659
*/
660660
void dial (String address, int clirMode, Message result);
661661

662+
/**
663+
* returned message
664+
* retMsg.obj = AsyncResult ar
665+
* ar.exception carries exception on failure
666+
* ar.userObject contains the orignal value of result.obj
667+
* ar.result is null on success and failure
668+
*
669+
* CLIR_DEFAULT == on "use subscription default value"
670+
* CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation)
671+
* CLIR_INVOCATION == on "CLIR invocation" (restrict CLI presentation)
672+
*/
673+
void dial(String address, int clirMode, UUSInfo uusInfo, Message result);
674+
662675
/**
663676
* returned message
664677
* retMsg.obj = AsyncResult ar

telephony/java/com/android/internal/telephony/Connection.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ public void clearUserData(){
273273
*/
274274
public abstract int getNumberPresentation();
275275

276+
/**
277+
* Returns the User to User Signaling (UUS) information associated with
278+
* incoming and waiting calls
279+
* @return UUSInfo containing the UUS userdata.
280+
*/
281+
public abstract UUSInfo getUUSInfo();
282+
276283
/**
277284
* Build a human representation of a connection instance, suitable for debugging.
278285
* Don't log personal stuff unless in debug mode.

telephony/java/com/android/internal/telephony/DriverCall.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public enum State {
4949
public int numberPresentation;
5050
public String name;
5151
public int namePresentation;
52+
public UUSInfo uusInfo;
5253

5354
/** returns null on error */
5455
static DriverCall

telephony/java/com/android/internal/telephony/Phone.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,19 @@ enum SuppService {
788788
*/
789789
Connection dial(String dialString) throws CallStateException;
790790

791+
/**
792+
* Initiate a new voice connection with supplementary User to User
793+
* Information. This happens asynchronously, so you cannot assume the audio
794+
* path is connected (or a call index has been assigned) until
795+
* PhoneStateChanged notification has occurred.
796+
*
797+
* @exception CallStateException if a new outgoing call is not currently
798+
* possible because no more call slots exist or a call exists
799+
* that is dialing, alerting, ringing, or waiting. Other
800+
* errors are handled asynchronously.
801+
*/
802+
Connection dial(String dialString, UUSInfo uusInfo) throws CallStateException;
803+
791804
/**
792805
* Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
793806
* without SEND (so <code>dial</code> is not appropriate).

telephony/java/com/android/internal/telephony/PhoneProxy.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ public Connection dial(String dialString) throws CallStateException {
415415
return mActivePhone.dial(dialString);
416416
}
417417

418+
public Connection dial(String dialString, UUSInfo uusInfo) throws CallStateException {
419+
return mActivePhone.dial(dialString, uusInfo);
420+
}
421+
418422
public boolean handlePinMmi(String dialString) {
419423
return mActivePhone.handlePinMmi(dialString);
420424
}

telephony/java/com/android/internal/telephony/RIL.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,11 +788,25 @@ public RIL(Context context, int networkMode, int cdmaSubscription) {
788788

789789
public void
790790
dial (String address, int clirMode, Message result) {
791+
dial(address, clirMode, null, result);
792+
}
793+
794+
public void
795+
dial(String address, int clirMode, UUSInfo uusInfo, Message result) {
791796
RILRequest rr = RILRequest.obtain(RIL_REQUEST_DIAL, result);
792797

793798
rr.mp.writeString(address);
794799
rr.mp.writeInt(clirMode);
795800

801+
if (uusInfo == null) {
802+
rr.mp.writeInt(0); // UUS information is absent
803+
} else {
804+
rr.mp.writeInt(1); // UUS information is present
805+
rr.mp.writeInt(uusInfo.getType());
806+
rr.mp.writeInt(uusInfo.getDcs());
807+
rr.mp.writeByteArray(uusInfo.getUserData());
808+
}
809+
796810
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
797811

798812
send(rr);
@@ -2825,6 +2839,24 @@ private RILRequest findAndRemoveRequestFromList(int serial) {
28252839
dc.numberPresentation = DriverCall.presentationFromCLIP(np);
28262840
dc.name = p.readString();
28272841
dc.namePresentation = p.readInt();
2842+
int uusInfoPresent = p.readInt();
2843+
if (uusInfoPresent == 1) {
2844+
dc.uusInfo = new UUSInfo();
2845+
dc.uusInfo.setType(p.readInt());
2846+
dc.uusInfo.setDcs(p.readInt());
2847+
byte[] userData = p.createByteArray();
2848+
dc.uusInfo.setUserData(userData);
2849+
Log
2850+
.v(LOG_TAG, String.format("Incoming UUS : type=%d, dcs=%d, length=%d",
2851+
dc.uusInfo.getType(), dc.uusInfo.getDcs(),
2852+
dc.uusInfo.getUserData().length));
2853+
Log.v(LOG_TAG, "Incoming UUS : data (string)="
2854+
+ new String(dc.uusInfo.getUserData()));
2855+
Log.v(LOG_TAG, "Incoming UUS : data (hex): "
2856+
+ IccUtils.bytesToHexString(dc.uusInfo.getUserData()));
2857+
} else {
2858+
Log.v(LOG_TAG, "Incoming UUS : NOT present!");
2859+
}
28282860

28292861
// Make sure there's a leading + on addresses with a TOA of 145
28302862
dc.number = PhoneNumberUtils.stringFromStringAndTOA(dc.number, dc.TOA);
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2+
*
3+
* Redistribution and use in source and binary forms, with or without
4+
* modification, are permitted provided that the following conditions are met:
5+
* * Redistributions of source code must retain the above copyright
6+
* notice, this list of conditions and the following disclaimer.
7+
* * Redistributions in binary form must reproduce the above copyright
8+
* notice, this list of conditions and the following disclaimer in the
9+
* documentation and/or other materials provided with the distribution.
10+
* * Neither the name of Code Aurora nor
11+
* the names of its contributors may be used to endorse or promote
12+
* products derived from this software without specific prior written
13+
* permission.
14+
*
15+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22+
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25+
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
*
27+
*/
28+
29+
package com.android.internal.telephony;
30+
31+
public class UUSInfo {
32+
33+
/*
34+
* User-to-User signaling Info activation types derived from 3GPP 23.087
35+
* v8.0
36+
*/
37+
38+
public static final int UUS_TYPE1_IMPLICIT = 0;
39+
40+
public static final int UUS_TYPE1_REQUIRED = 1;
41+
42+
public static final int UUS_TYPE1_NOT_REQUIRED = 2;
43+
44+
public static final int UUS_TYPE2_REQUIRED = 3;
45+
46+
public static final int UUS_TYPE2_NOT_REQUIRED = 4;
47+
48+
public static final int UUS_TYPE3_REQUIRED = 5;
49+
50+
public static final int UUS_TYPE3_NOT_REQUIRED = 6;
51+
52+
/*
53+
* User-to-User Signaling Information data coding schemes. Possible values
54+
* for Octet 3 (Protocol Discriminator field) in the UUIE. The values have
55+
* been specified in section 10.5.4.25 of 3GPP TS 24.008
56+
*/
57+
58+
public static final int UUS_DCS_USP = 0; /* User specified protocol */
59+
60+
public static final int UUS_DCS_OSIHLP = 1; /* OSI higher layer protocol */
61+
62+
public static final int UUS_DCS_X244 = 2; /* X.244 */
63+
64+
public static final int UUS_DCS_RMCF = 3; /*
65+
* Reserved for system management
66+
* convergence function
67+
*/
68+
69+
public static final int UUS_DCS_IA5c = 4; /* IA5 characters */
70+
71+
private int uusType;
72+
73+
private int uusDcs;
74+
75+
private byte[] uusData;
76+
77+
public UUSInfo() {
78+
this.uusType = UUS_TYPE1_IMPLICIT;
79+
this.uusDcs = UUS_DCS_IA5c;
80+
this.uusData = null;
81+
}
82+
83+
public UUSInfo(int uusType, int uusDcs, byte[] uusData) {
84+
this.uusType = uusType;
85+
this.uusDcs = uusDcs;
86+
this.uusData = uusData;
87+
}
88+
89+
public int getDcs() {
90+
return uusDcs;
91+
}
92+
93+
public void setDcs(int uusDcs) {
94+
this.uusDcs = uusDcs;
95+
}
96+
97+
public int getType() {
98+
return uusType;
99+
}
100+
101+
public void setType(int uusType) {
102+
this.uusType = uusType;
103+
}
104+
105+
public byte[] getUserData() {
106+
return uusData;
107+
}
108+
109+
public void setUserData(byte[] uusData) {
110+
this.uusData = uusData;
111+
}
112+
}

telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
import com.android.internal.telephony.PhoneSubInfo;
6363
import com.android.internal.telephony.TelephonyIntents;
6464
import com.android.internal.telephony.TelephonyProperties;
65+
import com.android.internal.telephony.UUSInfo;
6566

6667
import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA;
6768
import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC;
@@ -358,6 +359,10 @@ public DataActivityState getDataActivityState() {
358359
return mCT.dial(newDialString);
359360
}
360361

362+
public Connection dial(String dialString, UUSInfo uusInfo) throws CallStateException {
363+
throw new CallStateException("Sending UUS information NOT supported in CDMA!");
364+
}
365+
361366
public SignalStrength getSignalStrength() {
362367
return mSST.mSignalStrength;
363368
}
@@ -1475,5 +1480,4 @@ private boolean updateCurrentCarrierInProvider(String operatorNumeric) {
14751480
}
14761481
return false;
14771482
}
1478-
14791483
}

telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,4 +933,10 @@ private void log(String msg) {
933933
public int getNumberPresentation() {
934934
return numberPresentation;
935935
}
936+
937+
@Override
938+
public UUSInfo getUUSInfo() {
939+
// UUS information not supported in CDMA
940+
return null;
941+
}
936942
}

telephony/java/com/android/internal/telephony/gsm/GSMPhone.java

100755100644
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import com.android.internal.telephony.PhoneProxy;
6868
import com.android.internal.telephony.PhoneSubInfo;
6969
import com.android.internal.telephony.TelephonyProperties;
70+
import com.android.internal.telephony.UUSInfo;
7071
import com.android.internal.telephony.gsm.stk.StkService;
7172
import com.android.internal.telephony.test.SimulatedRadioControl;
7273
import com.android.internal.telephony.IccVmNotSupportedException;
@@ -719,7 +720,12 @@ boolean isInCall() {
719720
}
720721

721722
public Connection
722-
dial (String dialString) throws CallStateException {
723+
dial(String dialString) throws CallStateException {
724+
return dial(dialString, null);
725+
}
726+
727+
public Connection
728+
dial (String dialString, UUSInfo uusInfo) throws CallStateException {
723729
// Need to make sure dialString gets parsed properly
724730
String newDialString = PhoneNumberUtils.stripSeparators(dialString);
725731

@@ -735,9 +741,9 @@ boolean isInCall() {
735741
"dialing w/ mmi '" + mmi + "'...");
736742

737743
if (mmi == null) {
738-
return mCT.dial(newDialString);
744+
return mCT.dial(newDialString, uusInfo);
739745
} else if (mmi.isTemporaryModeCLIR()) {
740-
return mCT.dial(mmi.dialingNumber, mmi.getCLIRMode());
746+
return mCT.dial(mmi.dialingNumber, mmi.getCLIRMode(), uusInfo);
741747
} else {
742748
mPendingMMIs.add(mmi);
743749
mMmiRegistrants.notifyRegistrants(new AsyncResult(null, mmi, null));

0 commit comments

Comments
 (0)