Skip to content

Commit 9b4dcce

Browse files
feat(aws-datastore): Make the reachability component configurable (#2307)
Signed-off-by: Manuel Iglesias <[email protected]> Co-authored-by: Divyesh Chitroda <[email protected]>
1 parent 86dfdbe commit 9b4dcce

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

aws-datastore/src/main/java/com/amplifyframework/datastore/AWSDataStorePlugin.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,7 @@ Builder storageAdapter(LocalStorageAdapter storageAdapter) {
755755
* @param reachabilityMonitor An instance that implements LocalStorageAdapter.
756756
* @return Current builder instance, for fluent construction of plugin.
757757
*/
758-
@VisibleForTesting
759-
Builder reachabilityMonitor(ReachabilityMonitor reachabilityMonitor) {
758+
public Builder reachabilityMonitor(ReachabilityMonitor reachabilityMonitor) {
760759
this.reachabilityMonitor = reachabilityMonitor;
761760
return this;
762761
}

aws-datastore/src/main/java/com/amplifyframework/datastore/syncengine/ReachabilityMonitor.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit
3636
* The network changes are debounced with a 250 ms delay to allow some time for one network to connect after another
3737
* network has disconnected (for example, wifi is lost, then cellular connects) to reduce thrashing.
3838
*/
39-
internal interface ReachabilityMonitor {
39+
public interface ReachabilityMonitor {
4040
fun configure(context: Context)
4141
@VisibleForTesting
4242
fun configure(context: Context, connectivityProvider: ConnectivityProvider)
@@ -99,7 +99,7 @@ private class ReachabilityMonitorImpl constructor(val schedulerProvider: Schedul
9999
* is a concrete class created within context.getSystemService() it can't be overridden with a test
100100
* implementation, so this interface works around that issue.
101101
*/
102-
internal interface ConnectivityProvider {
102+
public interface ConnectivityProvider {
103103
val hasActiveNetwork: Boolean
104104
fun registerDefaultNetworkCallback(context: Context, callback: NetworkCallback)
105105
}

0 commit comments

Comments
 (0)