Change the parameter type from ContentResolver to Context
Context is more useful than ContentResolver, it can provide more information if we want to change the behavior in the future. Bug: 172183305 Test: atest FrameworksNetTests Change-Id: I5702c7d74b862a76558b94f1abe2c6df9eb7f097 Merged-In: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
This commit is contained in:
@@ -5124,7 +5124,8 @@ public class ConnectivityManager {
|
||||
/**
|
||||
* Get private DNS mode from settings.
|
||||
*
|
||||
* @param cr The ContentResolver to query private DNS mode from settings.
|
||||
* @param context The Context to get its ContentResolver to query the private DNS mode from
|
||||
* settings.
|
||||
* @return A string of private DNS mode as one of the PRIVATE_DNS_MODE_* constants.
|
||||
*
|
||||
* @hide
|
||||
@@ -5132,7 +5133,8 @@ public class ConnectivityManager {
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
@NonNull
|
||||
@PrivateDnsMode
|
||||
public static String getPrivateDnsMode(@NonNull ContentResolver cr) {
|
||||
public static String getPrivateDnsMode(@NonNull Context context) {
|
||||
final ContentResolver cr = context.getContentResolver();
|
||||
String mode = Settings.Global.getString(cr, PRIVATE_DNS_MODE);
|
||||
if (TextUtils.isEmpty(mode)) mode = Settings.Global.getString(cr, PRIVATE_DNS_DEFAULT_MODE);
|
||||
// If both PRIVATE_DNS_MODE and PRIVATE_DNS_DEFAULT_MODE are not set, choose
|
||||
|
||||
Reference in New Issue
Block a user