Chiachang Wang 70348a2672 Update the permission check for dump
ServicePermissionsTest#testDumpProtected expects to see nothing
from dump() if the caller does not have the required permission.

After the refactor the ConnectivityService#dump(). It does not
leak real information for those callers without permission but
show the title of dumpsys, i.e. it shows "DUMP OF SERVICE HIGH
connectivity". This breaks the test since the test expects to
see nothing.

Move the permission check to the front of dump call stack since
there is no way to call other private dump related methods.

Bug: 185425662
Test: atest android.security.cts.ServicePermissionsTest
Test: adb shell dumpsys connectivity
Change-Id: I173c968a4f1c4d6f618ed87725a6ccda8d309988
2021-04-19 11:09:15 +08:00
2020-12-14 18:34:39 +09:00
2021-03-19 16:03:14 +00:00
Description
android_packages_modules_Connectivity
189 MiB
Languages
Java 81.4%
Kotlin 7.7%
AIDL 4.5%
C++ 4.5%
C 1.7%
Other 0.1%