summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorPaul Hu <paulhu@google.com>2021-03-03 02:17:02 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-03-03 02:17:02 +0000
commit5e62891a8a2665262bf4e2e2fe1b91e9187c8a0d (patch)
tree06730ec7a610cdd11e2dabc2f65e013d6ead11b2 /core/java/android
parentaee4bb286fb78590444712e65bdf5a1e10a338d6 (diff)
parent9bd19b31276d9d8fbcc28b292c7b0652a18f2943 (diff)
Merge "Implement Settings#checkAndNoteChangeNetworkStateOperation on CS" am: 18a60acfdf am: 9bd19b3127
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1560476 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Iad6f9e6cabc5f7eccd0aad020b398950f0495703
Diffstat (limited to 'core/java/android')
-rwxr-xr-xcore/java/android/provider/Settings.java24
1 files changed, 0 insertions, 24 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index cfb18ad24faf..6d3b58c7db20 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -15099,30 +15099,6 @@ public final class Settings {
/**
* Performs a strict and comprehensive check of whether a calling package is allowed to
- * change the state of network, as the condition differs for pre-M, M+, and
- * privileged/preinstalled apps. The caller is expected to have either the
- * CHANGE_NETWORK_STATE or the WRITE_SETTINGS permission declared. Either of these
- * permissions allow changing network state; WRITE_SETTINGS is a runtime permission and
- * can be revoked, but (except in M, excluding M MRs), CHANGE_NETWORK_STATE is a normal
- * permission and cannot be revoked. See http://b/23597341
- *
- * Note: if the check succeeds because the application holds WRITE_SETTINGS, the operation
- * of this app will be updated to the current time.
- * @hide
- */
- public static boolean checkAndNoteChangeNetworkStateOperation(Context context, int uid,
- String callingPackage, boolean throwException) {
- if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE)
- == PackageManager.PERMISSION_GRANTED) {
- return true;
- }
- return isCallingPackageAllowedToPerformAppOpsProtectedOperation(context, uid,
- callingPackage, throwException, AppOpsManager.OP_WRITE_SETTINGS,
- PM_CHANGE_NETWORK_STATE, true);
- }
-
- /**
- * Performs a strict and comprehensive check of whether a calling package is allowed to
* draw on top of other apps, as the conditions differs for pre-M, M+, and
* privileged/preinstalled apps. If the provided uid does not match the callingPackage,
* a negative result will be returned.