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

Commit cf38c458 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Don't bootloop if GNSS is unavailable." into tm-dev am: 92e68968 am:...

Merge "Don't bootloop if GNSS is unavailable." into tm-dev am: 92e68968 am: 1ed4d9ab am: cc4f73b3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18383202



Change-Id: I82789ad22e749439e23d8cf6825c905bfc9ca70e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1a1f0ada cc4f73b3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -116,6 +116,11 @@ public final class GnssTimeUpdateService extends Binder {
            Log.d(TAG, "requestGnssTimeUpdates()");
        }

        if (!mLocationManager.hasProvider(LocationManager.GPS_PROVIDER)) {
            Log.e(TAG, "GPS provider does not exist on this device");
            return;
        }

        // Location Listener triggers onLocationChanged() when GNSS data is available, so
        // that the getGnssTimeMillis() function doesn't need to be continuously polled.
        mLocationListener = new LocationListener() {
+3 −0
Original line number Diff line number Diff line
@@ -85,6 +85,9 @@ public final class GnssTimeUpdateServiceTest {
        when(mMockContext.getSystemService(AlarmManager.class))
                .thenReturn(mMockAlarmManager);

        when(mMockLocationManager.hasProvider(LocationManager.GPS_PROVIDER))
                .thenReturn(true);

        LocalServices.addService(LocationManagerInternal.class, mLocationManagerInternal);

        mGnssTimeUpdateService =