|
|
@ -559,20 +559,14 @@ public class FragmentSetup extends FragmentBase {
|
|
|
|
tvDozeDone.setCompoundDrawablesWithIntrinsicBounds(ignoring == null || ignoring ? check : null, null, null, null);
|
|
|
|
tvDozeDone.setCompoundDrawablesWithIntrinsicBounds(ignoring == null || ignoring ? check : null, null, null, null);
|
|
|
|
|
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
|
|
ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE);
|
|
|
|
ActivityManager am =
|
|
|
|
grpBackgroundRestricted.setVisibility(am.isBackgroundRestricted() ? View.VISIBLE : View.GONE);
|
|
|
|
(ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE);
|
|
|
|
|
|
|
|
grpBackgroundRestricted.setVisibility(am.isBackgroundRestricted()
|
|
|
|
|
|
|
|
? View.VISIBLE : View.GONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// https://developer.android.com/training/basics/network-ops/data-saver.html
|
|
|
|
grpDataSaver.setVisibility(ConnectionHelper.isDataSaving(getContext())
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
|
|
|
? View.VISIBLE : View.GONE);
|
|
|
|
ConnectivityManager cm = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
|
|
|
|
|
|
if (cm != null) {
|
|
|
|
|
|
|
|
int status = cm.getRestrictBackgroundStatus();
|
|
|
|
|
|
|
|
grpDataSaver.setVisibility(
|
|
|
|
|
|
|
|
status == ConnectivityManager.RESTRICT_BACKGROUND_STATUS_ENABLED
|
|
|
|
|
|
|
|
? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|