Merge "Fix state dumping when service stopped" into sc-dev
This commit is contained in:
@@ -429,8 +429,11 @@ public class LocationTimeZoneManagerService extends Binder {
|
|||||||
}, BLOCKING_OP_WAIT_DURATION_MILLIS);
|
}, BLOCKING_OP_WAIT_DURATION_MILLIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a snapshot of the current controller state for tests. */
|
/**
|
||||||
@NonNull
|
* Returns a snapshot of the current controller state for tests. Returns {@code null} if the
|
||||||
|
* service is stopped.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
LocationTimeZoneManagerServiceState getStateForTests() {
|
LocationTimeZoneManagerServiceState getStateForTests() {
|
||||||
enforceManageTimeZoneDetectorPermission();
|
enforceManageTimeZoneDetectorPermission();
|
||||||
|
|
||||||
|
|||||||
@@ -217,6 +217,11 @@ class LocationTimeZoneManagerShellCommand extends ShellCommand {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state == null) {
|
||||||
|
// Controller is stopped.
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
DualDumpOutputStream outputStream;
|
DualDumpOutputStream outputStream;
|
||||||
boolean useProto = Objects.equals(DUMP_STATE_OPTION_PROTO, getNextOption());
|
boolean useProto = Objects.equals(DUMP_STATE_OPTION_PROTO, getNextOption());
|
||||||
if (useProto) {
|
if (useProto) {
|
||||||
|
|||||||
Reference in New Issue
Block a user