|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The MobileRadio
interface is used for
simple radio management capabilities (turning on and off), if
the platform supports it.
and getting information about the current signal strength.
MobileRadio
state can either be on (setState(true)) or off (setState(false)).
If state management is not user controllable, then the setState
method
will throw a MethodNotSupportedException
If the device has been secured via password protection (e.g. PIN-code),
the setState
method may also throw the
InvalidStateException
, if an attempt is made to manipulate the
radio while the device is secured.
MobileRadio
object are reported via the
MobileRadioListener
interface.
Applications instantiate an object which implements this
interface and begins this delivery of events to this object using the
MobileRadio.addRadioListener()
method.
Applications receive events on a listener until the listener
is removed via the MobileRadio.removeRadioListener()
method.
MobileRadioEvent
,
MobileRadioListener
Method Summary | |
void |
addRadioListener(MobileRadioListener listener)
Add a listener for MobileRadio events. |
int |
getMaxSignalLevel()
Get the maximum radio signal level. |
boolean |
getRadioStartState()
Returns the MobileRadio startup state at boot. |
boolean |
getRadioState()
Returns the current MobileRadio state. |
int |
getSignalLevel()
Get the current radio signal level. |
void |
removeRadioListener(MobileRadioListener listener)
Remove a listener from the MobileRadio . |
void |
setRadioStartState(boolean state)
Sets the MobileRadio startup state at boot. |
void |
setRadioState(boolean state)
Set the MobileRadio state. |
Method Detail |
public boolean getRadioState() throws MethodNotSupportedException
MethodNotSupportedException
- can not access the current radio state.public void setRadioState(boolean state) throws MethodNotSupportedException, InvalidStateException
MobileProvider
must be OUT_OF_SERVICE before the MobileRadio object
may turn the physical radio off.
After the radio is successfully turned off the MobileRadio
state
must be changed to reflect the radio off status.
When the radio is turned off, no further network events will be generated
and the radio signal level is set to zero, until the radio is reenabled.
When the radio is turned on,
the MobileProvider
can be in any valid state, depending
on whether there are networks detected and subscription details
are OK.
state
- The desired radio state.MethodNotSupportedException
- Indicates the radio state can not
be manipulated on this implementation.InvalidStateException
- Indicates the network service
state cannot be changed due to current MobileProvider
state.public boolean getRadioStartState() throws MethodNotSupportedException
MobileRadio
startup state at boot.MethodNotSupportedException
- Indicates the radio
state startup management capability is not supported.public void setRadioStartState(boolean state) throws MethodNotSupportedException, InvalidStateException
MobileRadio
startup state at boot.
A possible required password will not be
given here for security reasons!
The password required should
be given some other way, determined by native implementation,
or at next time when a MobileProvider
object is requested
from the JtapiPeer.state
- The new radio startup state. True, if radio
is turned on. Otherwise, false.MethodNotSupportedException
- Indicates the radio
state startup management is not supported.InvalidStateException
- Indicates the network service
startup state cannot be changed due to current platform state.public int getSignalLevel()
When the radio is turned off the signal level is set to zero.
The radio signal is mapped to positive integer values from 1 to
getMaxSignalLevel
. In GSM networks the signal strength
is mapped to the range 1-5. (e.g. Level 1 = 20%, Level 5 = 100%)
getMaxSignalLevel()
public int getMaxSignalLevel()
getSignalLevel()
public void addRadioListener(MobileRadioListener listener) throws MethodNotSupportedException
MobileRadio
events.listener
- The listener object to add.MethodNotSupportedException
- This implementation does not generate events.public void removeRadioListener(MobileRadioListener listener)
MobileRadio
.listener
- The listener to remove.
|
JSR-043: JTAPI-1.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |