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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java

Issue 2742583004: Android settings: conditionally show notification vibrate option (Closed)
Patch Set: add nullcheck 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/preferences/website/SingleCategoryPreferences.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
index 9350e99b72631ca5b0daf01f9a8c74549a6beab4..08a731a750a337a3c6b450d7e4fc6a9e738e056e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
@@ -28,6 +28,7 @@ import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
+import org.chromium.base.BuildInfo;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.help.HelpAndFeedback;
@@ -609,7 +610,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
// Configure/hide the notifications vibrate toggle, as needed.
Preference notificationsVibrate =
getPreferenceScreen().findPreference(NOTIFICATIONS_VIBRATE_TOGGLE_KEY);
- if (mCategory.showNotificationsSites()) {
+ if (mCategory.showNotificationsSites() && !BuildInfo.isAtLeastO()) {
notificationsVibrate.setOnPreferenceChangeListener(this);
updateNotificationsVibrateCheckBox();
} else {
@@ -727,7 +728,9 @@ public class SingleCategoryPreferences extends PreferenceFragment
ChromeBaseCheckBoxPreference preference =
(ChromeBaseCheckBoxPreference) getPreferenceScreen().findPreference(
NOTIFICATIONS_VIBRATE_TOGGLE_KEY);
- preference.setEnabled(PrefServiceBridge.getInstance().isNotificationsEnabled());
+ if (preference != null) {
+ preference.setEnabled(PrefServiceBridge.getInstance().isNotificationsEnabled());
+ }
}
private void showManagedToast() {
« 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