HardwareConfigpublic class HardwareConfig extends Object {@hide}
hardware configuration information reported by the ril layer and for
use by the telephone framework.
the hardware configuration is managed by the TelephonyDevController
(aka: the 'TDC').
the hardware resources are:
- modem: physical entity providing acces technology.
- sim: physicaly entity providing a slot interface. |
Fields Summary |
---|
static final String | LOG_TAG | public static final int | DEV_HARDWARE_TYPE_MODEMhardware configuration kind. | public static final int | DEV_HARDWARE_TYPE_SIM | public static final int | DEV_MODEM_RIL_MODEL_SINGLEril attachment model. if single, there is a one-to-one
relationship between a modem hardware and a ril daemon.
if multiple, there is a one-to-many relatioship between a
modem hardware and several ril simultaneous ril daemons. | public static final int | DEV_MODEM_RIL_MODEL_MULTIPLE | public static final int | DEV_HARDWARE_STATE_ENABLEDhardware state of the resource.
enabled: the resource can be used by the msim-framework,
call activity can be handled on it.
standby: the resource can be used by the msim-framework but
only for non call related activity. as example:
reading the address book from a sim device. attempt
to use this resource for call activity leads to
undetermined results.
disabled: the resource cannot be used and attempt to use
it leads to undetermined results.
by default, all resources are 'enabled', what causes a resource
to be marked otherwise is a property of the underlying hardware
knowledge and implementation and it is out of scope of the TDC. | public static final int | DEV_HARDWARE_STATE_STANDBY | public static final int | DEV_HARDWARE_STATE_DISABLED | public int | typecommon hardware configuration.
type - see DEV_HARDWARE_TYPE_
uuid - unique identifier for this hardware.
state - see DEV_HARDWARE_STATE_ | public String | uuid | public int | state | public int | rilModelDEV_HARDWARE_TYPE_MODEM.
rilModel - see DEV_MODEM_RIL_MODEL_
rat - BitSet value, based on android.telephony.ServiceState
maxActiveVoiceCall - maximum number of concurent active voice calls.
maxActiveDataCall - maximum number of concurent active data calls.
maxStandby - maximum number of concurent standby connections.
note: the maxStandby is not necessarily an equal sum of the maxActiveVoiceCall
and maxActiveDataCall (nor a derivative of it) since it really depends on the
modem capability, hence it is left for the hardware to define. | public BitSet | rat | public int | maxActiveVoiceCall | public int | maxActiveDataCall | public int | maxStandby | public String | modemUuidDEV_HARDWARE_TYPE_SIM.
modemUuid - unique association to a modem for a sim. |
Constructors Summary |
---|
public HardwareConfig(int type)default constructor.
type = type;
| public HardwareConfig(String res)create from a resource string format.
String split[] = res.split(",");
type = Integer.parseInt(split[0]);
switch (type) {
case DEV_HARDWARE_TYPE_MODEM: {
assignModem(
split[1].trim(), /* uuid */
Integer.parseInt(split[2]), /* state */
Integer.parseInt(split[3]), /* ril-model */
Integer.parseInt(split[4]), /* rat */
Integer.parseInt(split[5]), /* max-voice */
Integer.parseInt(split[6]), /* max-data */
Integer.parseInt(split[7]) /* max-standby */
);
break;
}
case DEV_HARDWARE_TYPE_SIM: {
assignSim(
split[1].trim(), /* uuid */
Integer.parseInt(split[2]), /* state */
split[3].trim() /* modem-uuid */
);
break;
}
}
|
Methods Summary |
---|
public void | assignModem(java.lang.String id, int state, int model, int ratBits, int maxV, int maxD, int maxS)
if (type == DEV_HARDWARE_TYPE_MODEM) {
char[] bits = Integer.toBinaryString(ratBits).toCharArray();
uuid = id;
state = state;
rilModel = model;
rat = new BitSet(bits.length);
for (int i = 0 ; i < bits.length ; i++) {
rat.set(i, (bits[i] == '1" ? true : false));
}
maxActiveVoiceCall = maxV;
maxActiveDataCall = maxD;
maxStandby = maxS;
}
| public void | assignSim(java.lang.String id, int state, java.lang.String link)
if (type == DEV_HARDWARE_TYPE_SIM) {
uuid = id;
modemUuid = link;
state = state;
}
| public int | compareTo(com.android.internal.telephony.HardwareConfig hw)
String one = this.toString();
String two = hw.toString();
return (one.compareTo(two));
| public java.lang.String | toString()
StringBuilder builder = new StringBuilder();
if (type == DEV_HARDWARE_TYPE_MODEM) {
builder.append("Modem ");
builder.append("{ uuid=" + uuid);
builder.append(", state=" + state);
builder.append(", rilModel=" + rilModel);
builder.append(", rat=" + rat.toString());
builder.append(", maxActiveVoiceCall=" + maxActiveVoiceCall);
builder.append(", maxActiveDataCall=" + maxActiveDataCall);
builder.append(", maxStandby=" + maxStandby);
builder.append(" }");
} else if (type == DEV_HARDWARE_TYPE_SIM) {
builder.append("Sim ");
builder.append("{ uuid=" + uuid);
builder.append(", modemUuid=" + modemUuid);
builder.append(", state=" + state);
builder.append(" }");
} else {
builder.append("Invalid Configration");
}
return builder.toString();
|
|