Fix warning

This commit is contained in:
Benoit Marty 2019-09-27 12:22:33 +02:00 committed by Benoit Marty
parent d68a9a5342
commit f8b665a245

View File

@ -33,9 +33,8 @@ class TestBackgroundRestrictions @Inject constructor(private val context: AppCom
// Checks if the device is on a metered network // Checks if the device is on a metered network
if (isActiveNetworkMetered) { if (isActiveNetworkMetered) {
// Checks users Data Saver settings. // Checks users Data Saver settings.
val restrictBackgroundStatus = ConnectivityManagerCompat.getRestrictBackgroundStatus(this) when (ConnectivityManagerCompat.getRestrictBackgroundStatus(this)) {
when (restrictBackgroundStatus) { ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_ENABLED -> {
ConnectivityManager.RESTRICT_BACKGROUND_STATUS_ENABLED -> {
// Background data usage is blocked for this app. Wherever possible, // Background data usage is blocked for this app. Wherever possible,
// the app should also use less data in the foreground. // the app should also use less data in the foreground.
description = stringProvider.getString(R.string.settings_troubleshoot_test_bg_restricted_failed, description = stringProvider.getString(R.string.settings_troubleshoot_test_bg_restricted_failed,
@ -43,7 +42,7 @@ class TestBackgroundRestrictions @Inject constructor(private val context: AppCom
status = TestStatus.FAILED status = TestStatus.FAILED
quickFix = null quickFix = null
} }
ConnectivityManager.RESTRICT_BACKGROUND_STATUS_WHITELISTED -> { ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_WHITELISTED -> {
// The app is whitelisted. Wherever possible, // The app is whitelisted. Wherever possible,
// the app should use less data in the foreground and background. // the app should use less data in the foreground and background.
description = stringProvider.getString(R.string.settings_troubleshoot_test_bg_restricted_success, description = stringProvider.getString(R.string.settings_troubleshoot_test_bg_restricted_success,
@ -51,7 +50,7 @@ class TestBackgroundRestrictions @Inject constructor(private val context: AppCom
status = TestStatus.SUCCESS status = TestStatus.SUCCESS
quickFix = null quickFix = null
} }
ConnectivityManager.RESTRICT_BACKGROUND_STATUS_DISABLED -> { ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_DISABLED -> {
// Data Saver is disabled. Since the device is connected to a // Data Saver is disabled. Since the device is connected to a
// metered network, the app should use less data wherever possible. // metered network, the app should use less data wherever possible.
description = stringProvider.getString(R.string.settings_troubleshoot_test_bg_restricted_success, description = stringProvider.getString(R.string.settings_troubleshoot_test_bg_restricted_success,