diff options
author | MÃ¥rten Kongstad <marten.kongstad@sony.com> | 2019-02-07 02:21:56 +0100 |
---|---|---|
committer | Todd Kennedy <toddke@google.com> | 2019-03-19 14:26:38 -0700 |
commit | 0c6ff1da4f20da59b6bb8649429142390c636743 (patch) | |
tree | e56e9111d6f7c37c9d106e010f78268e4d7a7bc0 /cmds/idmap2/idmap2d/Idmap2Service.cpp | |
parent | 09eb96c4c7874f06bc71d084b7d51eac26779b52 (diff) |
idmap2: move commands to Result<Unit>
Change the signature of the idmap2 commands (Create, Dump, ...) to
return Result<Unit> instead of bool. This removes the need to pass in an
ostream for error messages: instead, those messages are part of the
returned Result.
Consolidate error messages: texts in Error objects should not be
prefixed with "error:", that is the responsibility of the outer-most
caller (i.e. main()).
Test: make idmap2_tests
Change-Id: I074881b3d1982ea8f4be5752161ac74b14fcba95
Diffstat (limited to 'cmds/idmap2/idmap2d/Idmap2Service.cpp')
-rw-r--r-- | cmds/idmap2/idmap2d/Idmap2Service.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cmds/idmap2/idmap2d/Idmap2Service.cpp b/cmds/idmap2/idmap2d/Idmap2Service.cpp index fa944143e408..e03a9cc1032e 100644 --- a/cmds/idmap2/idmap2d/Idmap2Service.cpp +++ b/cmds/idmap2/idmap2d/Idmap2Service.cpp @@ -104,8 +104,7 @@ Status Idmap2Service::verifyIdmap(const std::string& overlay_apk_path, std::ifstream fin(idmap_path); const std::unique_ptr<const IdmapHeader> header = IdmapHeader::FromBinaryStream(fin); fin.close(); - std::stringstream dev_null; - *_aidl_return = header && header->IsUpToDate(dev_null); + *_aidl_return = header && header->IsUpToDate(); // TODO(b/119328308): Check that the set of fulfilled policies of the overlay has not changed |