Replace null checks is null object checks
A recent change replaced the null state during a setting
lookup with a null object, however missed to update some
null checks to be null object ones.
bug:28405145
Change-Id: I80f0fb3ac6e64f4283b6c617283a009e97a40efe
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 75fb413..bb80636 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -1458,7 +1458,7 @@
}
private static MatrixCursor packageSettingForQuery(Setting setting, String[] projection) {
- if (setting == null) {
+ if (setting.isNull()) {
return new MatrixCursor(projection, 0);
}
MatrixCursor cursor = new MatrixCursor(projection, 1);
@@ -1483,7 +1483,7 @@
}
private static void appendSettingToCursor(MatrixCursor cursor, Setting setting) {
- if (setting == null) {
+ if (setting.isNull()) {
return;
}
final int columnCount = cursor.getColumnCount();
@@ -2210,7 +2210,7 @@
Setting currentSetting = secureSettings.getSettingLocked(
Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT);
if (defaultComponent != null && !defaultComponent.isEmpty() &&
- currentSetting == null) {
+ currentSetting.isNull()) {
secureSettings.insertSettingLocked(
Settings.Secure.NFC_PAYMENT_DEFAULT_COMPONENT,
defaultComponent,
@@ -2226,7 +2226,7 @@
final SettingsState globalSettings = getGlobalSettingsLocked();
Setting currentSetting = globalSettings.getSettingLocked(
Settings.Global.ADD_USERS_WHEN_LOCKED);
- if (currentSetting == null) {
+ if (currentSetting.isNull()) {
globalSettings.insertSettingLocked(
Settings.Global.ADD_USERS_WHEN_LOCKED,
getContext().getResources().getBoolean(
@@ -2252,7 +2252,7 @@
final SettingsState secureSettings = getSecureSettingsLocked(userId);
Setting currentSetting = secureSettings.getSettingLocked(
Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD);
- if (currentSetting == null) {
+ if (currentSetting.isNull()) {
secureSettings.insertSettingLocked(
Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD,
getContext().getResources().getBoolean(
@@ -2268,7 +2268,7 @@
Setting currentSetting = secureSettings.getSettingLocked(
Settings.Secure.ENABLED_VR_LISTENERS);
- if (currentSetting == null) {
+ if (currentSetting.isNull()) {
ArraySet<ComponentName> l =
SystemConfig.getInstance().getDefaultVrComponents();