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

Unified Diff: chromecast/base/java/src/org/chromium/chromecast/base/CastSettingsManager.java

Issue 2830843004: Update to newer Android Lint and suppress new Lint errors (Closed)
Patch Set: rebase Created 3 years, 8 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: chromecast/base/java/src/org/chromium/chromecast/base/CastSettingsManager.java
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/CastSettingsManager.java b/chromecast/base/java/src/org/chromium/chromecast/base/CastSettingsManager.java
index 3c397a06b408fee0800c198b1ee7f7478810e8d7..2de2356d57cb185959fc490997248d62bf6e0447 100644
--- a/chromecast/base/java/src/org/chromium/chromecast/base/CastSettingsManager.java
+++ b/chromecast/base/java/src/org/chromium/chromecast/base/CastSettingsManager.java
@@ -4,6 +4,7 @@
package org.chromium.chromecast.base;
+import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.Context;
import android.content.SharedPreferences;
@@ -65,6 +66,7 @@ public final class CastSettingsManager {
return new CastSettingsManager(contentResolver, listener, settings);
}
+ @SuppressLint("NewApi")
private CastSettingsManager(
ContentResolver contentResolver,
OnSettingChangedListener listener,
@@ -94,6 +96,7 @@ public final class CastSettingsManager {
mListener.onDeviceNameChanged(getDeviceName());
}
};
+ // TODO(crbug.com/635567): Fix lint properly.
mContentResolver.registerContentObserver(
Settings.Global.getUriFor(DEVICE_NAME_SETTING_KEY), true, mDeviceNameObserver);
@@ -105,6 +108,7 @@ public final class CastSettingsManager {
mListener.onCastEnabledChanged(isCastEnabled());
}
};
+ // TODO(crbug.com/635567): Fix lint properly.
mContentResolver.registerContentObserver(
Settings.Global.getUriFor(DEVICE_PROVISIONED_SETTING_KEY), true,
mIsDeviceProvisionedObserver);
@@ -123,8 +127,10 @@ public final class CastSettingsManager {
}
}
+ @SuppressLint("NewApi")
public boolean isCastEnabled() {
// However, Cast is disabled until the device is provisioned (see b/18950240).
+ // TODO(crbug.com/635567): Fix lint properly.
return Settings.Global.getInt(
mContentResolver, DEVICE_PROVISIONED_SETTING_KEY, 0) == 1;
}
@@ -137,7 +143,9 @@ public final class CastSettingsManager {
mSettings.edit().putBoolean(SEND_USAGE_STATS_SETTING, enabled).apply();
}
+ @SuppressLint("NewApi")
public String getDeviceName() {
+ // TODO(crbug.com/635567): Fix lint properly.
String deviceName = Settings.Global.getString(mContentResolver, DEVICE_NAME_SETTING_KEY);
return (deviceName != null) ? deviceName : DEFAULT_DEVICE_NAME;
}

Powered by Google App Engine
This is Rietveld 408576698