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) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -422,21 +420,16 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user