summaryrefslogtreecommitdiff
path: root/cmds/servicemanager/ServiceManager.cpp
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2022-11-14 18:55:06 +0900
committer Jooyung Han <jooyung@google.com> 2022-11-15 06:08:39 +0900
commitce94b75b68df3e07e9c73d42eaa59cfce0929e53 (patch)
tree837226244a1be78b19155b430f49b4dbd0484925 /cmds/servicemanager/ServiceManager.cpp
parent213454462ca60ec8af20f69a797bbef19712b85b (diff)
servicemanager: add tests for updatable-via-apex
This is a follow-up of 76944fee1a642cdfbabaa72ef7d29e53af1d50db. With an example vendor apex installed on a cuttlefish device, the added tests test two new APIs regarding updatable-via-apex. - ServiceManager.updatableViaApex(instance) - ServiceManager.getUpdatableNames(apexName) This also fixes both methods - (minor) updatableViaApex returns early when the match found - getUpdatableNames iterates over all instances to find updatable instances. Bug: 254201177 Test: atest servicemanager_test Change-Id: I165c5532b40a4f9d520bef55864708b1629e24c7
Diffstat (limited to 'cmds/servicemanager/ServiceManager.cpp')
-rw-r--r--cmds/servicemanager/ServiceManager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds/servicemanager/ServiceManager.cpp b/cmds/servicemanager/ServiceManager.cpp
index 2ae61b9603..cc038ae0d4 100644
--- a/cmds/servicemanager/ServiceManager.cpp
+++ b/cmds/servicemanager/ServiceManager.cpp
@@ -136,6 +136,7 @@ static std::optional<std::string> getVintfUpdatableApex(const std::string& name)
updatableViaApex = manifestInstance.updatableViaApex();
return false; // break (libvintf uses opposite convention)
});
+ if (updatableViaApex.has_value()) return true; // break (found match)
return false; // continue
});
@@ -154,7 +155,7 @@ static std::vector<std::string> getVintfUpdatableInstances(const std::string& ap
manifestInstance.interface() + "/" + manifestInstance.instance();
instances.push_back(aname);
}
- return false; // continue
+ return true; // continue (libvintf uses opposite convention)
});
return false; // continue
});