Merge "Add a missing null object check" into nyc-dev

This commit is contained in:
Svetoslav Ganov
2016-04-27 21:19:05 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 3 deletions

View File

@ -846,7 +846,7 @@ public class SettingsProvider extends ContentProvider {
// Special case for location (sigh).
if (isLocationProvidersAllowedRestricted(name, callingUserId, owningUserId)) {
return null;
continue;
}
Setting setting = mSettingsRegistry.getSettingLocked(
@ -871,7 +871,8 @@ public class SettingsProvider extends ContentProvider {
// Special case for location (sigh).
if (isLocationProvidersAllowedRestricted(name, callingUserId, owningUserId)) {
return null;
return mSettingsRegistry.getSettingsLocked(SETTINGS_TYPE_SECURE,
owningUserId).getNullSetting();
}
// Get the value.

View File

@ -16,7 +16,6 @@
package com.android.providers.settings;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
@ -159,6 +158,10 @@ final class SettingsState {
return mVersion;
}
public Setting getNullSetting() {
return mNullSetting;
}
// The settings provider must hold its lock when calling here.
public void setVersionLocked(int version) {
if (version == mVersion) {