Merge "Add mTimeStamp to SignalStrength"
am: aa5b09f6ad
Change-Id: I77ded661edc7fc2f0fbc10bb8b4c39f10000553d
This commit is contained in:
@@ -44754,7 +44754,8 @@ package android.telephony {
|
||||
method public int getCellConnectionStatus();
|
||||
method @NonNull public abstract android.telephony.CellIdentity getCellIdentity();
|
||||
method @NonNull public abstract android.telephony.CellSignalStrength getCellSignalStrength();
|
||||
method public long getTimeStamp();
|
||||
method @Deprecated public long getTimeStamp();
|
||||
method public long getTimestampNanos();
|
||||
method public boolean isRegistered();
|
||||
field public static final int CONNECTION_NONE = 0; // 0x0
|
||||
field public static final int CONNECTION_PRIMARY_SERVING = 1; // 0x1
|
||||
@@ -45197,6 +45198,7 @@ package android.telephony {
|
||||
method @Deprecated public int getGsmBitErrorRate();
|
||||
method @Deprecated public int getGsmSignalStrength();
|
||||
method public int getLevel();
|
||||
method public long getTimestampNanos();
|
||||
method @Deprecated public boolean isGsm();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.telephony.SignalStrength> CREATOR;
|
||||
|
||||
@@ -18,6 +18,7 @@ package android.telephony;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.hardware.radio.V1_4.CellInfo.Info;
|
||||
import android.os.Parcel;
|
||||
@@ -179,6 +180,18 @@ public abstract class CellInfo implements Parcelable {
|
||||
*
|
||||
* @return a time stamp in nanos since boot.
|
||||
*/
|
||||
@SuppressLint("MethodNameUnits")
|
||||
public long getTimestampNanos() {
|
||||
return mTimeStamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Approximate time this cell information was received from the modem.
|
||||
*
|
||||
* @return a time stamp in nanos since boot.
|
||||
* @deprecated Use {@link #getTimestampNanos} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public long getTimeStamp() {
|
||||
return mTimeStamp;
|
||||
}
|
||||
|
||||
@@ -16,9 +16,8 @@
|
||||
|
||||
package android.telephony;
|
||||
|
||||
import com.android.telephony.Rlog;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.SystemApi;
|
||||
import android.compat.annotation.UnsupportedAppUsage;
|
||||
import android.os.Build;
|
||||
@@ -26,6 +25,9 @@ import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.PersistableBundle;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.android.telephony.Rlog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -77,6 +79,9 @@ public class SignalStrength implements Parcelable {
|
||||
/* The type of signal measurement */
|
||||
private static final String MEASUREMENT_TYPE_RSCP = "rscp";
|
||||
|
||||
// timeStamp of signalStrength in nanoseconds since boot
|
||||
private long mTimestamp = Long.MAX_VALUE;
|
||||
|
||||
CellSignalStrengthCdma mCdma;
|
||||
CellSignalStrengthGsm mGsm;
|
||||
CellSignalStrengthWcdma mWcdma;
|
||||
@@ -135,6 +140,7 @@ public class SignalStrength implements Parcelable {
|
||||
mTdscdma = tdscdma;
|
||||
mLte = lte;
|
||||
mNr = nr;
|
||||
mTimestamp = SystemClock.elapsedRealtimeNanos();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -269,6 +275,7 @@ public class SignalStrength implements Parcelable {
|
||||
mTdscdma.updateLevel(cc, ss);
|
||||
mLte.updateLevel(cc, ss);
|
||||
mNr.updateLevel(cc, ss);
|
||||
mTimestamp = SystemClock.elapsedRealtimeNanos();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -294,6 +301,7 @@ public class SignalStrength implements Parcelable {
|
||||
mTdscdma = new CellSignalStrengthTdscdma(s.mTdscdma);
|
||||
mLte = new CellSignalStrengthLte(s.mLte);
|
||||
mNr = new CellSignalStrengthNr(s.mNr);
|
||||
mTimestamp = s.getTimestampNanos();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,6 +319,7 @@ public class SignalStrength implements Parcelable {
|
||||
mTdscdma = in.readParcelable(CellSignalStrengthTdscdma.class.getClassLoader());
|
||||
mLte = in.readParcelable(CellSignalStrengthLte.class.getClassLoader());
|
||||
mNr = in.readParcelable(CellSignalStrengthLte.class.getClassLoader());
|
||||
mTimestamp = in.readLong();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -323,9 +332,18 @@ public class SignalStrength implements Parcelable {
|
||||
out.writeParcelable(mTdscdma, flags);
|
||||
out.writeParcelable(mLte, flags);
|
||||
out.writeParcelable(mNr, flags);
|
||||
out.writeLong(mTimestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mTimestamp in nanoseconds
|
||||
*/
|
||||
@SuppressLint("MethodNameUnits")
|
||||
public long getTimestampNanos() {
|
||||
return mTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link Parcelable#describeContents}
|
||||
*/
|
||||
public int describeContents() {
|
||||
|
||||
Reference in New Issue
Block a user