Temp tracking of plugin load/unload requests

Bug: 270860591
Test: Checked device logs
Change-Id: I342cb3097d5f4ffdfdcaf94af50e6701bd75c4ea
This commit is contained in:
Hawkwood Glazier
2023-04-20 20:23:43 +00:00
parent 742405591b
commit bf55be5e38

View File

@@ -403,12 +403,14 @@ open class ClockRegistry(
}
scope.launch(bgDispatcher) {
Log.i(TAG, "verifyLoadedProviders: ${availableClocks.size}")
if (keepAllLoaded) {
// Enforce that all plugins are loaded if requested
for ((_, info) in availableClocks) {
info.manager?.loadPlugin()
}
isVerifying.set(false)
Log.i(TAG, "verifyLoadedProviders: keepAllLoaded=true, load all")
return@launch
}
@@ -419,16 +421,21 @@ open class ClockRegistry(
info.manager?.unloadPlugin()
}
isVerifying.set(false)
Log.i(TAG, "verifyLoadedProviders: currentClock unavailable, unload all")
return@launch
}
val currentManager = currentClock.manager
currentManager?.loadPlugin()
Log.i(TAG, "verifyLoadedProviders: load ${currentClock.metadata.clockId}")
for ((_, info) in availableClocks) {
val manager = info.manager
if (manager != null && manager.isLoaded && currentManager != manager) {
Log.i(TAG, "verifyLoadedProviders: unload ${info.metadata.clockId}")
manager.unloadPlugin()
} else {
Log.i(TAG, "verifyLoadedProviders: skip unload of ${info.metadata.clockId}")
}
}
isVerifying.set(false)