PROBE_STATUS_FAILURE = 3;
}
+ // Codes for cellular data network type
+ enum CellularDataNetworkType {
+ // Unknown network
+ NETWORK_TYPE_UNKNOWN = 0;
+
+ // GSM network
+ NETWORK_TYPE_GSM = 1;
+
+ // CDMA network
+ NETWORK_TYPE_CDMA = 2;
+
+ // CDMA EVDO network
+ NETWORK_TYPE_EVDO_0 = 3;
+
+ // WCDMA network
+ NETWORK_TYPE_UMTS = 4;
+
+ // TDSCDMA network
+ NETWORK_TYPE_TD_SCDMA = 5;
+
+ // LTE network
+ NETWORK_TYPE_LTE = 6;
+
+ // NR network
+ NETWORK_TYPE_NR = 7;
+ }
+
// Absolute milliseconds from device boot when these stats were sampled
optional int64 time_stamp_ms = 1;
// Whether current entry is for the same BSSID on the same frequency compared
// to last entry
optional bool is_same_bssid_and_freq = 29;
+
+ // Cellular data network type currently in use on the device for data transmission
+ optional CellularDataNetworkType cellular_data_network_type = 30;
+
+ // Cellular signal strength in dBm, NR: CsiRsrp, LTE: Rsrp, WCDMA/TDSCDMA: Rscp,
+ // CDMA: Rssi, EVDO: Rssi, GSM: Rssi
+ optional int32 cellular_signal_strength_dbm = 31;
+
+ // Cellular signal strength in dB, NR: CsiSinr, LTE: Rsrq, WCDMA: EcNo, TDSCDMA: invalid,
+ // CDMA: Ecio, EVDO: SNR, GSM: invalid */
+ optional int32 cellular_signal_strength_db = 32;
+
+ // Whether the primary registered cell of current entry is same as that of previous entry
+ optional bool is_same_registered_cell = 33;
}
message WifiUsabilityStats {
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
+import android.telephony.TelephonyManager.NetworkType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
private final int mProbeMcsRateSinceLastUpdate;
/** Rx link speed at the sample time in Mbps */
private final int mRxLinkSpeedMbps;
+ private final @NetworkType int mCellularDataNetworkType;
+ private final int mCellularSignalStrengthDbm;
+ private final int mCellularSignalStrengthDb;
+ private final boolean mIsSameRegisteredCell;
/** Constructor function {@hide} */
public WifiUsabilityStatsEntry(long timeStampMillis, int rssi, int linkSpeedMbps,
long totalHotspot2ScanTimeMillis,
long totalCcaBusyFreqTimeMillis, long totalRadioOnFreqTimeMillis, long totalBeaconRx,
@ProbeStatus int probeStatusSinceLastUpdate, int probeElapsedTimeSinceLastUpdateMillis,
- int probeMcsRateSinceLastUpdate, int rxLinkSpeedMbps) {
+ int probeMcsRateSinceLastUpdate, int rxLinkSpeedMbps,
+ @NetworkType int cellularDataNetworkType,
+ int cellularSignalStrengthDbm, int cellularSignalStrengthDb,
+ boolean isSameRegisteredCell) {
mTimeStampMillis = timeStampMillis;
mRssi = rssi;
mLinkSpeedMbps = linkSpeedMbps;
mProbeElapsedTimeSinceLastUpdateMillis = probeElapsedTimeSinceLastUpdateMillis;
mProbeMcsRateSinceLastUpdate = probeMcsRateSinceLastUpdate;
mRxLinkSpeedMbps = rxLinkSpeedMbps;
+ mCellularDataNetworkType = cellularDataNetworkType;
+ mCellularSignalStrengthDbm = cellularSignalStrengthDbm;
+ mCellularSignalStrengthDb = cellularSignalStrengthDb;
+ mIsSameRegisteredCell = isSameRegisteredCell;
}
/** Implement the Parcelable interface */
dest.writeInt(mProbeElapsedTimeSinceLastUpdateMillis);
dest.writeInt(mProbeMcsRateSinceLastUpdate);
dest.writeInt(mRxLinkSpeedMbps);
+ dest.writeInt(mCellularDataNetworkType);
+ dest.writeInt(mCellularSignalStrengthDbm);
+ dest.writeInt(mCellularSignalStrengthDb);
+ dest.writeBoolean(mIsSameRegisteredCell);
}
/** Implement the Parcelable interface */
in.readLong(), in.readLong(), in.readLong(),
in.readLong(), in.readLong(), in.readLong(),
in.readLong(), in.readLong(), in.readInt(),
- in.readInt(), in.readInt(), in.readInt()
+ in.readInt(), in.readInt(), in.readInt(),
+ in.readInt(), in.readInt(), in.readInt(),
+ in.readBoolean()
);
}
public int getRxLinkSpeedMbps() {
return mRxLinkSpeedMbps;
}
+
+ /** Cellular data network type currently in use on the device for data transmission */
+ @NetworkType public int getCellularDataNetworkType() {
+ return mCellularDataNetworkType;
+ }
+
+ /**
+ * Cellular signal strength in dBm, NR: CsiRsrp, LTE: Rsrp, WCDMA/TDSCDMA: Rscp,
+ * CDMA: Rssi, EVDO: Rssi, GSM: Rssi
+ */
+ public int getCellularSignalStrengthDbm() {
+ return mCellularSignalStrengthDbm;
+ }
+
+ /**
+ * Cellular signal strength in dB, NR: CsiSinr, LTE: Rsrq, WCDMA: EcNo, TDSCDMA: invalid,
+ * CDMA: Ecio, EVDO: SNR, GSM: invalid
+ */
+ public int getCellularSignalStrengthDb() {
+ return mCellularSignalStrengthDb;
+ }
+
+ /** Whether the primary registered cell of current entry is same as that of previous entry */
+ public boolean getIsSameRegisteredCell() {
+ return mIsSameRegisteredCell;
+ }
}
private static WifiUsabilityStatsEntry createResult() {
return new WifiUsabilityStatsEntry(
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, true
);
}
assertEquals(expected.getProbeMcsRateSinceLastUpdate(),
actual.getProbeMcsRateSinceLastUpdate());
assertEquals(expected.getRxLinkSpeedMbps(), actual.getRxLinkSpeedMbps());
+ assertEquals(expected.getCellularDataNetworkType(), actual.getCellularDataNetworkType());
+ assertEquals(expected.getCellularSignalStrengthDbm(),
+ actual.getCellularSignalStrengthDbm());
+ assertEquals(expected.getCellularSignalStrengthDb(), actual.getCellularSignalStrengthDb());
+ assertEquals(expected.getIsSameRegisteredCell(), actual.getIsSameRegisteredCell());
}
}