Merge "[NetworkScorerAppManager] system_server should not call non forUser Settings.Secure.get* methods"

This commit is contained in:
TreeHugger Robot
2020-09-09 23:14:33 +00:00
committed by Android (Google) Code Review

View File

@@ -19,6 +19,7 @@ package com.android.server;
import android.Manifest.permission;
import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.PermissionChecker;
@@ -404,7 +405,8 @@ public class NetworkScorerAppManager {
}
public int getSecureInt(Context context, String name, int defaultValue) {
return Settings.Secure.getInt(context.getContentResolver(), name, defaultValue);
final ContentResolver cr = context.getContentResolver();
return Settings.Secure.getIntForUser(cr, name, defaultValue, cr.getUserId());
}
}
}