Polish developer option enable verbose vendor logging

Robotests cases in EnableVerboseVendorLoggingPreferenceControllerTest
show all pass but actually they are all bypassed due to the fact that
the test class can not grant sepolicy permission as what Settings
app does.

This version introduces mock DumpstateDevice HAL to really
perform the Robotests cases.

This CL also clear up code format issues.

Bug: 149886908
Test: make && make RunSettingsRoboTests
Change-Id: I64025ebea60e18d17338604519a6cae98ca7928b
This commit is contained in:
Rambo Wang
2020-02-20 16:42:01 -08:00
parent 5522099ef0
commit c13ba9d27f
3 changed files with 34 additions and 12 deletions

View File

@@ -133,7 +133,8 @@ public class EnableVerboseVendorLoggingPreferenceController
}
/** Return a {@IDumpstateDevice} instance or null if service is not available. */
private @Nullable IDumpstateDevice getDumpstateDeviceService() {
@VisibleForTesting
@Nullable IDumpstateDevice getDumpstateDeviceService() {
IDumpstateDevice service = null;
try {
service = android.hardware.dumpstate.V1_1.IDumpstateDevice