OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.components.minidump_uploader.util; |
| 6 |
| 7 import android.net.ConnectivityManager; |
| 8 import android.net.NetworkInfo; |
| 9 |
| 10 /** |
| 11 * A container for determining whether it's ok to upload crash reports over the
currently active |
| 12 * network. |
| 13 */ |
| 14 public class NetworkPermissionUtil { |
| 15 public static boolean isNetworkUnmetered(ConnectivityManager connectivityMan
ager) { |
| 16 NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); |
| 17 if (networkInfo == null || !networkInfo.isConnected()) return false; |
| 18 return !connectivityManager.isActiveNetworkMetered(); |
| 19 } |
| 20 } |
OLD | NEW |