Fixing implicit app deactivation for apps loaded from disk.
Apps loaded from disk will be marked as having been
activated explicitly, which means they won't deactivate
implicitly when all dependent apps have been deactivated.
Change-Id: I831befdd26615b241da8fdbdb35d21359d3a8665
diff --git a/core/store/dist/src/main/java/org/onosproject/store/app/DistributedApplicationStore.java b/core/store/dist/src/main/java/org/onosproject/store/app/DistributedApplicationStore.java
index c0b8d4e..5e2ec0d 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/app/DistributedApplicationStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/app/DistributedApplicationStore.java
@@ -244,6 +244,10 @@
getApplicationNames().forEach(appName -> {
Application app = loadFromDisk(appName);
if (app != null && isActive(app.id().name())) {
+ // For now, apps loaded from disk will be marked as having been
+ // activated explicitly, which means they won't deactivate
+ // implicitly when all dependent apps have been deactivated.
+ requiredBy.put(app.id(), coreAppId);
activate(app.id(), false);
// TODO Load app permissions
}