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

Commit 14e55996 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android (Google) Code Review
Browse files

Merge "Fix Batched Scan Results to give Timestamp in uS" into klp-dev

parents 5fbfb81d dee971b9
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -65,6 +65,7 @@ import android.os.PowerManager;
import android.os.Process;
import android.os.Process;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserHandle;
import android.os.WorkSource;
import android.os.WorkSource;
@@ -1016,7 +1017,7 @@ public class WifiStateMachine extends StateMachine {
            int dist, distSd;
            int dist, distSd;
            long tsf = 0;
            long tsf = 0;
            dist = distSd = ScanResult.UNSPECIFIED;
            dist = distSd = ScanResult.UNSPECIFIED;
            long now = System.currentTimeMillis();
            long now = SystemClock.elapsedRealtime();


            while (true) {
            while (true) {
                while (n < splitData.length) {
                while (n < splitData.length) {
@@ -1064,6 +1065,7 @@ public class WifiStateMachine extends StateMachine {
                    } else if (splitData[n].startsWith(AGE)) {
                    } else if (splitData[n].startsWith(AGE)) {
                        try {
                        try {
                            tsf = now - Long.parseLong(splitData[n].substring(AGE.length()));
                            tsf = now - Long.parseLong(splitData[n].substring(AGE.length()));
                            tsf *= 1000; // convert mS -> uS
                        } catch (NumberFormatException e) {
                        } catch (NumberFormatException e) {
                            loge("Invalid timestamp: " + splitData[n]);
                            loge("Invalid timestamp: " + splitData[n]);
                            tsf = 0;
                            tsf = 0;