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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java

Issue 2737393003: Add Bluetooth Checks to Service (Closed)
Patch Set: fixing teds comments Created 3 years, 9 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
index 3b6dbcb410a211aa0d46a6b62436de68f77ccd05..09891aa8bbbe61dbc91eb2978a1d954d048f65cc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
@@ -26,11 +26,15 @@ public class PhysicalWebShareActivity extends ShareActivity {
/**
* Returns whether we should show this sharing option in the share sheet.
* Pre-conditions for Physical Web Sharing to be enabled:
+ * Device has hardware BLE advertising capabilities.
+ * Device had Bluetooth on.
* Device is Marshmallow or above.
* Device has sharing feature enabled.
* @return {@code true} if the feature should be enabled.
*/
public static boolean featureIsAvailable() {
- return PhysicalWeb.sharingIsEnabled() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return false;
+ return PhysicalWeb.hasBleAdvertiseCapability() && PhysicalWeb.bluetoothIsEnabled()
+ && PhysicalWeb.sharingIsEnabled();
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698