Skip to content

Commit

Permalink
Merge pull request #556 from morckx/respect-no-wifi-warning-setting-o…
Browse files Browse the repository at this point in the history
…n-resume

Respect warn_no_wifi setting when resuming after connection regain
  • Loading branch information
segler-alex authored Jul 31, 2019
2 parents e28aa46 + 1f11608 commit 053a1b4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ public class ExoPlayerWrapper implements PlayerWrapper, IcyDataSource.IcyDataSou
private final BroadcastReceiver networkChangedReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context);
final boolean warn_no_wifi = sharedPref.getBoolean("warn_no_wifi", false);
if (interruptedByConnectionLoss && player != null && audioSource != null
&& Utils.hasAnyConnection(context)) {
&& (Utils.hasWifiConnection(context) || (!warn_no_wifi && Utils.hasAnyConnection(context)))) {
interruptedByConnectionLoss = false;
Log.i(TAG, "Regained connection. Resuming playback.");
player.prepare(audioSource);
Expand Down

0 comments on commit 053a1b4

Please sign in to comment.