Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dad38c0 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Change timestamp unit from nanos to millis" am: 4aee28ea am: 3a63fa76 am: f5ef40c9

Change-Id: I4db855e9cf6e39c128b2ece9d4c61c326e919b3c
parents 40fd197d f5ef40c9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -46973,7 +46973,7 @@ package android.telephony {
    method @NonNull public abstract android.telephony.CellIdentity getCellIdentity();
    method @NonNull public abstract android.telephony.CellSignalStrength getCellSignalStrength();
    method @Deprecated public long getTimeStamp();
    method public long getTimestampNanos();
    method public long getTimestampMillis();
    method public boolean isRegistered();
    field public static final int CONNECTION_NONE = 0; // 0x0
    field public static final int CONNECTION_PRIMARY_SERVING = 1; // 0x1
@@ -47488,7 +47488,7 @@ package android.telephony {
    method @Deprecated public int getGsmBitErrorRate();
    method @Deprecated public int getGsmSignalStrength();
    method public int getLevel();
    method public long getTimestampNanos();
    method public long getTimestampMillis();
    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;
+6 −6
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@

package android.telephony;

import android.annotation.ElapsedRealtimeLong;
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;
@@ -178,18 +178,18 @@ public abstract class CellInfo implements Parcelable {
    /**
     * Approximate time this cell information was received from the modem.
     *
     * @return a time stamp in nanos since boot.
     * @return a time stamp in millis since boot.
     */
    @SuppressLint("MethodNameUnits")
    public long getTimestampNanos() {
        return mTimeStamp;
    @ElapsedRealtimeLong
    public long getTimestampMillis() {
        return mTimeStamp / 1000000;
    }

    /**
     * Approximate time this cell information was received from the modem.
     *
     * @return a time stamp in nanos since boot.
     * @deprecated Use {@link #getTimestampNanos} instead.
     * @deprecated Use {@link #getTimestampMillis} instead.
     */
    @Deprecated
    public long getTimeStamp() {
+14 −12
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@

package android.telephony;

import android.annotation.ElapsedRealtimeLong;
import android.annotation.NonNull;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
@@ -79,8 +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;
    // Timestamp of SignalStrength since boot
    // Effectively final. Timestamp is set during construction of SignalStrength
    private long mTimestampMillis;

    CellSignalStrengthCdma mCdma;
    CellSignalStrengthGsm mGsm;
@@ -139,7 +140,7 @@ public class SignalStrength implements Parcelable {
        mTdscdma = tdscdma;
        mLte = lte;
        mNr = nr;
        mTimestamp = SystemClock.elapsedRealtimeNanos();
        mTimestampMillis = SystemClock.elapsedRealtime();
    }

    /**
@@ -274,7 +275,6 @@ public class SignalStrength implements Parcelable {
        mTdscdma.updateLevel(cc, ss);
        mLte.updateLevel(cc, ss);
        mNr.updateLevel(cc, ss);
        mTimestamp = SystemClock.elapsedRealtimeNanos();
    }

    /**
@@ -300,7 +300,7 @@ public class SignalStrength implements Parcelable {
        mTdscdma = new CellSignalStrengthTdscdma(s.mTdscdma);
        mLte = new CellSignalStrengthLte(s.mLte);
        mNr = new CellSignalStrengthNr(s.mNr);
        mTimestamp = s.getTimestampNanos();
        mTimestampMillis = s.getTimestampMillis();
    }

    /**
@@ -318,7 +318,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();
        mTimestampMillis = in.readLong();
    }

    /**
@@ -331,15 +331,17 @@ public class SignalStrength implements Parcelable {
        out.writeParcelable(mTdscdma, flags);
        out.writeParcelable(mLte, flags);
        out.writeParcelable(mNr, flags);
        out.writeLong(mTimestamp);
        out.writeLong(mTimestampMillis);
    }

    /**
     * @return mTimestamp in nanoseconds
     * @return timestamp in milliseconds since boot for {@link SignalStrength}.
     * This timestamp reports the approximate time that the signal was measured and reported
     * by the modem. It can be used to compare the recency of {@link SignalStrength} instances.
     */
    @SuppressLint("MethodNameUnits")
    public long getTimestampNanos() {
        return mTimestamp;
    @ElapsedRealtimeLong
    public long getTimestampMillis() {
        return mTimestampMillis;
    }

   /**