Fixed clock face resetting to default one after rebooting

The root cause is that the initial clock plugin was set before the onPluginConnected() was
called.

Set the clock plugin once the onPluginConnected() is called and it's
current clock plugin.

Bug: 131044332
Test: manual
Change-Id: I133183d66db05620d6da77abb0643e8e5ee60ebc
This commit is contained in:
shawnlin
2019-04-24 14:16:19 +08:00
parent d9919f2750
commit 366d126d06

View File

@@ -289,12 +289,19 @@ public final class ClockManager {
public void onPluginConnected(ClockPlugin plugin, Context pluginContext) {
addClockPlugin(plugin);
reload();
if (plugin == mCurrentClock) {
ClockManager.this.reload();
}
}
@Override
public void onPluginDisconnected(ClockPlugin plugin) {
boolean isCurrentClock = plugin == mCurrentClock;
removeClockPlugin(plugin);
reload();
if (isCurrentClock) {
ClockManager.this.reload();
}
}
/**