Skip to content

Commit

Permalink
Only prompt for battery optimizations if the user is enrolled in study
Browse files Browse the repository at this point in the history
  • Loading branch information
barbeau committed Jul 3, 2019
1 parent 1ad5e5d commit 724d33e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.onebusaway.android.region.ObaRegionsTask;
import org.onebusaway.android.report.ui.ReportActivity;
import org.onebusaway.android.travelbehavior.TravelBehaviorManager;
import org.onebusaway.android.travelbehavior.utils.TravelBehaviorUtils;
import org.onebusaway.android.tripservice.TripService;
import org.onebusaway.android.util.FragmentUtils;
import org.onebusaway.android.util.LocationUtils;
Expand All @@ -70,7 +71,6 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.PowerManager;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
Expand Down Expand Up @@ -120,7 +120,6 @@
import static org.onebusaway.android.ui.NavigationDrawerFragment.NAVDRAWER_ITEM_STARRED_STOPS;
import static org.onebusaway.android.ui.NavigationDrawerFragment.NavigationDrawerCallbacks;
import static org.onebusaway.android.util.PermissionUtils.LOCATION_PERMISSIONS;
import static org.onebusaway.android.util.PermissionUtils.LOCATION_PERMISSION_REQUEST;
import static uk.co.markormesher.android_fab.FloatingActionButton.POSITION_BOTTOM;
import static uk.co.markormesher.android_fab.FloatingActionButton.POSITION_END;
import static uk.co.markormesher.android_fab.FloatingActionButton.POSITION_START;
Expand Down Expand Up @@ -2027,7 +2026,7 @@ public ArrivalsListFragment getArrivalsListFragment() {

private void checkBatteryOptimizations() {
if (PreferenceUtils.getBoolean(getString(R.string.not_request_battery_optimizations_key),
false)) {
false) || !TravelBehaviorUtils.isUserParticipatingInStudy()) {
return;
}

Expand Down

0 comments on commit 724d33e

Please sign in to comment.