@Test public void addGeofence_restart_added() throws RemoteException { mTestProvider.resumeIfStarted(); verify(mMockNative, times(2)).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE), eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS), eq(NOTIFICATION_RESPONSIVENESS), eq(UNKNOWN_TIMER)); }
void resumeIfStarted() { if (DEBUG) { Log.d(TAG, "resumeIfStarted"); } mHandler.post(() -> { for (int i = 0; i < mGeofenceEntries.size(); i++) { GeofenceEntry entry = mGeofenceEntries.valueAt(i); boolean added = mNative.addGeofence(entry.geofenceId, entry.latitude, entry.longitude, entry.radius, entry.lastTransition, entry.monitorTransitions, entry.notificationResponsiveness, entry.unknownTimer); if (added && entry.paused) { mNative.pauseGeofence(entry.geofenceId); } } }); }
GnssGeofenceProvider extends IGpsGeofenceHardware.Stub { void resumeIfStarted() { if (DEBUG) { Log.d(TAG, "resumeIfStarted"); } mHandler.post(() -> { for (int i = 0; i < mGeofenceEntries.size(); i++) { GeofenceEntry entry = mGeofenceEntries.valueAt(i); boolean added = mNative.addGeofence(entry.geofenceId, entry.latitude, entry.longitude, entry.radius, entry.lastTransition, entry.monitorTransitions, entry.notificationResponsiveness, entry.unknownTimer); if (added && entry.paused) { mNative.pauseGeofence(entry.geofenceId); } } }); } }
GnssGeofenceProvider extends IGpsGeofenceHardware.Stub { void resumeIfStarted() { if (DEBUG) { Log.d(TAG, "resumeIfStarted"); } mHandler.post(() -> { for (int i = 0; i < mGeofenceEntries.size(); i++) { GeofenceEntry entry = mGeofenceEntries.valueAt(i); boolean added = mNative.addGeofence(entry.geofenceId, entry.latitude, entry.longitude, entry.radius, entry.lastTransition, entry.monitorTransitions, entry.notificationResponsiveness, entry.unknownTimer); if (added && entry.paused) { mNative.pauseGeofence(entry.geofenceId); } } }); } GnssGeofenceProvider(Looper looper); @VisibleForTesting  GnssGeofenceProvider(Looper looper, GnssGeofenceProviderNative gnssGeofenceProviderNative); }
GnssGeofenceProvider extends IGpsGeofenceHardware.Stub { void resumeIfStarted() { if (DEBUG) { Log.d(TAG, "resumeIfStarted"); } mHandler.post(() -> { for (int i = 0; i < mGeofenceEntries.size(); i++) { GeofenceEntry entry = mGeofenceEntries.valueAt(i); boolean added = mNative.addGeofence(entry.geofenceId, entry.latitude, entry.longitude, entry.radius, entry.lastTransition, entry.monitorTransitions, entry.notificationResponsiveness, entry.unknownTimer); if (added && entry.paused) { mNative.pauseGeofence(entry.geofenceId); } } }); } GnssGeofenceProvider(Looper looper); @VisibleForTesting  GnssGeofenceProvider(Looper looper, GnssGeofenceProviderNative gnssGeofenceProviderNative); @Override boolean isHardwareGeofenceSupported(); @Override boolean addCircularHardwareGeofence(int geofenceId, double latitude,
            double longitude, double radius, int lastTransition, int monitorTransitions,
            int notificationResponsiveness, int unknownTimer); @Override boolean removeHardwareGeofence(int geofenceId); @Override boolean pauseHardwareGeofence(int geofenceId); @Override boolean resumeHardwareGeofence(int geofenceId, int monitorTransitions); }
GnssGeofenceProvider extends IGpsGeofenceHardware.Stub { void resumeIfStarted() { if (DEBUG) { Log.d(TAG, "resumeIfStarted"); } mHandler.post(() -> { for (int i = 0; i < mGeofenceEntries.size(); i++) { GeofenceEntry entry = mGeofenceEntries.valueAt(i); boolean added = mNative.addGeofence(entry.geofenceId, entry.latitude, entry.longitude, entry.radius, entry.lastTransition, entry.monitorTransitions, entry.notificationResponsiveness, entry.unknownTimer); if (added && entry.paused) { mNative.pauseGeofence(entry.geofenceId); } } }); } GnssGeofenceProvider(Looper looper); @VisibleForTesting  GnssGeofenceProvider(Looper looper, GnssGeofenceProviderNative gnssGeofenceProviderNative); @Override boolean isHardwareGeofenceSupported(); @Override boolean addCircularHardwareGeofence(int geofenceId, double latitude,
            double longitude, double radius, int lastTransition, int monitorTransitions,
            int notificationResponsiveness, int unknownTimer); @Override boolean removeHardwareGeofence(int geofenceId); @Override boolean pauseHardwareGeofence(int geofenceId); @Override boolean resumeHardwareGeofence(int geofenceId, int monitorTransitions);  }