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

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

Issue 2759283003: Remove Physical Web optin recording code (Closed)
Patch Set: Rebase 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 | « no previous file | 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/PhysicalWeb.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
index 9516ea15350fc684f2b9b550e484f1424f720fcf..2405c574616a3b2b946c92962deee4b9edfa2be9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
@@ -9,8 +9,8 @@ import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.content.Intent;
-import android.content.SharedPreferences;
import android.net.Uri;
+import android.os.AsyncTask;
import android.os.Build;
import org.chromium.base.ContextUtils;
@@ -28,7 +28,6 @@ import org.chromium.components.location.LocationUtils;
public class PhysicalWeb {
public static final int OPTIN_NOTIFY_MAX_TRIES = 1;
private static final String PHYSICAL_WEB_SHARING_PREFERENCE = "physical_web_sharing";
- private static final String PREF_PHYSICAL_WEB_NOTIFY_COUNT = "physical_web_notify_count";
private static final String FEATURE_NAME = "PhysicalWeb";
private static final String PHYSICAL_WEB_SHARING_FEATURE_NAME = "PhysicalWebSharing";
private static final int MIN_ANDROID_VERSION = 18;
@@ -67,8 +66,8 @@ public class PhysicalWeb {
* @return boolean {@code true} if the feature is enabled
*/
public static boolean sharingIsOptedIn() {
- SharedPreferences sharedPrefs = ContextUtils.getAppSharedPreferences();
- return sharedPrefs.getBoolean(PHYSICAL_WEB_SHARING_PREFERENCE, false);
+ return ContextUtils.getAppSharedPreferences()
+ .getBoolean(PHYSICAL_WEB_SHARING_PREFERENCE, false);
}
/**
@@ -92,26 +91,6 @@ public class PhysicalWeb {
}
/**
- * Increments a value tracking how many times we've shown the Physical Web
- * opt-in notification.
- */
- public static void recordOptInNotification() {
- SharedPreferences sharedPreferences = ContextUtils.getAppSharedPreferences();
- int value = sharedPreferences.getInt(PREF_PHYSICAL_WEB_NOTIFY_COUNT, 0);
- sharedPreferences.edit().putInt(PREF_PHYSICAL_WEB_NOTIFY_COUNT, value + 1).apply();
- }
-
- /**
- * Gets the current count of how many times a high-priority opt-in notification
- * has been shown.
- * @return an integer representing the high-priority notifification display count.
- */
- public static int getOptInNotifyCount() {
- SharedPreferences sharedPreferences = ContextUtils.getAppSharedPreferences();
- return sharedPreferences.getInt(PREF_PHYSICAL_WEB_NOTIFY_COUNT, 0);
- }
-
- /**
* Performs various Physical Web operations that should happen on startup.
*/
public static void onChromeStart() {
@@ -131,6 +110,17 @@ public class PhysicalWeb {
// The PhysicalWebUma call in this method should be called only when the native library
// is loaded. This is always the case on chrome startup.
PhysicalWebUma.uploadDeferredMetrics();
+
+ // We can remove this block after M60.
+ new AsyncTask<Void, Void, Void>() {
+ @Override
+ protected Void doInBackground(Void... params) {
+ ContextUtils.getAppSharedPreferences().edit()
+ .remove("physical_web_notify_count")
+ .apply();
+ return null;
+ }
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698