Merge "Add a missing null object check" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
44cc663f78
@ -846,7 +846,7 @@ public class SettingsProvider extends ContentProvider {
|
|||||||
|
|
||||||
// Special case for location (sigh).
|
// Special case for location (sigh).
|
||||||
if (isLocationProvidersAllowedRestricted(name, callingUserId, owningUserId)) {
|
if (isLocationProvidersAllowedRestricted(name, callingUserId, owningUserId)) {
|
||||||
return null;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Setting setting = mSettingsRegistry.getSettingLocked(
|
Setting setting = mSettingsRegistry.getSettingLocked(
|
||||||
@ -871,7 +871,8 @@ public class SettingsProvider extends ContentProvider {
|
|||||||
|
|
||||||
// Special case for location (sigh).
|
// Special case for location (sigh).
|
||||||
if (isLocationProvidersAllowedRestricted(name, callingUserId, owningUserId)) {
|
if (isLocationProvidersAllowedRestricted(name, callingUserId, owningUserId)) {
|
||||||
return null;
|
return mSettingsRegistry.getSettingsLocked(SETTINGS_TYPE_SECURE,
|
||||||
|
owningUserId).getNullSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the value.
|
// Get the value.
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.providers.settings;
|
package com.android.providers.settings;
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
@ -159,6 +158,10 @@ final class SettingsState {
|
|||||||
return mVersion;
|
return mVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Setting getNullSetting() {
|
||||||
|
return mNullSetting;
|
||||||
|
}
|
||||||
|
|
||||||
// The settings provider must hold its lock when calling here.
|
// The settings provider must hold its lock when calling here.
|
||||||
public void setVersionLocked(int version) {
|
public void setVersionLocked(int version) {
|
||||||
if (version == mVersion) {
|
if (version == mVersion) {
|
||||||
|
Reference in New Issue
Block a user