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

BUG: 166312046
Test: builds
Change-Id: Ie5a38665005257684b36ee858fe81ebdb1484ce7
This commit is contained in:
Songchun Fan
2020-09-03 15:44:53 -07:00
parent 4743509c7e
commit 5d60e0a570

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());
}
}
}