Merge "Update the permission check for dump" am: 8df8f29f8b am: 1e46f3f547 am: 2f059d6005

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1678985

Change-Id: Ie43488b368a8bae1c75b4228f2214dd540a9b8f7
This commit is contained in:
Chiachang Wang
2021-04-19 06:20:15 +00:00
committed by Automerger Merge Worker

View File

@@ -2810,6 +2810,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
@Override
protected void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter writer,
@Nullable String[] args) {
if (!checkDumpPermission(mContext, TAG, writer)) return;
mPriorityDumper.dump(fd, writer, args);
}
@@ -2827,7 +2829,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
private void doDump(FileDescriptor fd, PrintWriter writer, String[] args) {
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
if (!checkDumpPermission(mContext, TAG, pw)) return;
if (CollectionUtils.contains(args, DIAG_ARG)) {
dumpNetworkDiagnostics(pw);