Sasken proposes to contribute following USSD API enhancements to the
android open source project.
- Support for sending of USSD message
- Support for receiving of USSD Notify/ Response
This requirement essentially arises from an enhancement request
#1285.
http://code.google.com/p/android/issues/detail?id=1285
The changes to the framework are described below. Before starting with
the design and implementation, we would like to have some feedback on
our proposal.
====================
ARCHITECTURAL IMPACT
====================
Current implementation provides the USSD functionality as a normal
dial transaction. Thus the USSD string is sent by the dialer using the
dial intent to the framework. The dialed string is then parsed by the
dial string parser and if found to be a USSD string, invokes the USSD
session.
Following are the details of the current implementation:
Currently USSD handling is being performed by the class "GsmMMICode"
which parses the dial string through the GsmMMICode.process Code and
invokes the USSD transaction.
The response / notification received for this request is also sent to
the Dial MMI .
Thus in case there is a user application which wants to use the USSD
session for sending and receiving strings, currently there is no API
available for USSD transactions for it to use.
The proposed feature enhancement is to provide a USSD send and receive
facility to the user application without binding to the phone dial
code functionality.
Changes are required only in the Telephony Framework. No changes are
required in the RIL.
----------------------
Change details
-----------------------
UssdManager
--------------------
New class UssdManager will have to be introduced which would expose
following APIs to enable the Application to send, receive and cancel
of USSD transactions .
USSD notifier registration/unregister functions for application to
register for USSD events
- registerForUssdNotification
- unregisterForUssdNotification
NOTE: In this case the use application can implement the callback
registration and handling similar to existing apps like
EmergencyCallHandler and BluetoothHandsFree which are registered for
handling SERVICE_STATE_CHANGED message from the framework.
USSD Send API - sendAppUssd(String ussdMessage) can be provided. The
App Ussd session would be identified using the isAppUSSDPending flag
which would help identify the App Ussd session from the Phone MMI ussd
session.
USSD Cancel API - cancelAppUssd() can be provided for cancelling a App
ussd session in progress.
App USSD Error handler - for sending Ussd error information to App
which had invoked the ussd transaction.
onAppUssdFinishedError to be provided for notifying the App registrant
about the occurrence of an error.
App USSD Finished handler - for sending ussd success information to
App which had invoked the ussd transaction.
onAppUssdFinished be provided for notifying the app registrant about a
ussd response or ussd notification which can be handled by the App
appropriately.
GsmPhone
------------------
The incoming USSD callback handler in class “GsmPhone” is currently
implemented to route the USSD response/notifications to the USSD MMI.
In order to ensure that the response is routed to the USSD
Application, it would be required to check whether the response is in
relation to an Application initiated or Dial initiated USSD session.
If it is established that the session in progress is an Application
initated session, the response would be routed to the USSD
Application.
In case of a network initiated USSD handling, the USSD Application of
interest should be registered with the framework. Any network
initiated USSD would then be handled in the USSD callback handler and
routed to the USSD application. In absence of any application being
registered for receiving network initiated USSD, the USSD message
would be routed to the default USSD MMI.
Described below are the implementation details :
Modify onIncomingUSSD callback function to invoke the app ussd
handlers in case of USSD operations was invoked using the Send USSD
API
Check to be added in the onIncomingUSSD handler for verifying whether
USSD response/notification is pending (isUSSDPending).
Depending on the whether we have a registered for USSD session or
not the ussd response would be routed to the USSD or to the
GsmMMICode handlers.
Support for handling network initiated USSD for s registered for
receiving these events.
If a is registered for receiving the Network initiated USSD , it can
be identified using the mAppUssdRegistrants.size value
Based on this check and no ussd is pending, the USSD event can be
routed to the onNetworkInitiatedUssd for the registered to handled
else it could be routed to the GsmMMICode handler.