Merge "Revert "Temp tracking of plugin load/unload requests"" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ec55a87de8
@@ -404,14 +404,12 @@ open class ClockRegistry(
|
|||||||
}
|
}
|
||||||
|
|
||||||
scope.launch(bgDispatcher) {
|
scope.launch(bgDispatcher) {
|
||||||
Log.i(TAG, "verifyLoadedProviders: ${availableClocks.size}")
|
|
||||||
if (keepAllLoaded) {
|
if (keepAllLoaded) {
|
||||||
// Enforce that all plugins are loaded if requested
|
// Enforce that all plugins are loaded if requested
|
||||||
for ((_, info) in availableClocks) {
|
for ((_, info) in availableClocks) {
|
||||||
info.manager?.loadPlugin()
|
info.manager?.loadPlugin()
|
||||||
}
|
}
|
||||||
isVerifying.set(false)
|
isVerifying.set(false)
|
||||||
Log.i(TAG, "verifyLoadedProviders: keepAllLoaded=true, load all")
|
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,21 +420,16 @@ open class ClockRegistry(
|
|||||||
info.manager?.unloadPlugin()
|
info.manager?.unloadPlugin()
|
||||||
}
|
}
|
||||||
isVerifying.set(false)
|
isVerifying.set(false)
|
||||||
Log.i(TAG, "verifyLoadedProviders: currentClock unavailable, unload all")
|
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
|
|
||||||
val currentManager = currentClock.manager
|
val currentManager = currentClock.manager
|
||||||
currentManager?.loadPlugin()
|
currentManager?.loadPlugin()
|
||||||
Log.i(TAG, "verifyLoadedProviders: load ${currentClock.metadata.clockId}")
|
|
||||||
|
|
||||||
for ((_, info) in availableClocks) {
|
for ((_, info) in availableClocks) {
|
||||||
val manager = info.manager
|
val manager = info.manager
|
||||||
if (manager != null && manager.isLoaded && currentManager != manager) {
|
if (manager != null && manager.isLoaded && currentManager != manager) {
|
||||||
Log.i(TAG, "verifyLoadedProviders: unload ${info.metadata.clockId}")
|
|
||||||
manager.unloadPlugin()
|
manager.unloadPlugin()
|
||||||
} else {
|
|
||||||
Log.i(TAG, "verifyLoadedProviders: skip unload of ${info.metadata.clockId}")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
isVerifying.set(false)
|
isVerifying.set(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user