Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1565)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/DeviceConditions.java

Issue 2064323004: Defines initial DeviceConditions and and plumbs down through StartProcessing() call. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/DeviceConditions.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/DeviceConditions.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/DeviceConditions.java
new file mode 100644
index 0000000000000000000000000000000000000000..ff0e9ba9303a0983026a2ddabbe26ef2e65e6040
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/DeviceConditions.java
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.offlinepages;
+
+/** Device network and power conditions. */
+public class DeviceConditions {
+ private final boolean mPowerConnected;
+ private final int mBatteryPercentage;
+ private final int mNetConnectionType;
+
+ /**
+ * Creates set of device network and power conditions.
+ * @param powerConnected whether device is connected to power
+ * @param batteryPercentage percentage (0-100) of remaining battery power
+ * @param connectionType the org.chromium.net.ConnectionType value for the network connection
+ */
+ public DeviceConditions(boolean powerConnected, int batteryPercentage, int netConnectionType) {
+ mPowerConnected = powerConnected;
+ mBatteryPercentage = batteryPercentage;
+ mNetConnectionType = netConnectionType;
+ }
+
+ public boolean isPowerConnected() {
+ return mPowerConnected;
+ }
+
+ public int getBatteryPercentage() {
+ return mBatteryPercentage;
+ }
+
+ /**
+ * Returns the Chromium enum value for the network connection type. Connection type values are
+ * defined in org.chromium.net.ConnectionType.
+ */
+ public int getNetConnectionType() {
+ return mNetConnectionType;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698