Allow overlays to be notified about theme changes
Overlays should override onOverlaysApplied() in order to act upon theme changes. Test: manual Bug: 190093578 Change-Id: Ie52b8c55a046d150dd30aae5fabb279b53a959f5 Merged-In:Ie52b8c55a046d150dd30aae5fabb279b53a959f5
This commit is contained in:
@@ -34,7 +34,7 @@ import javax.inject.Inject
|
|||||||
* See [DumpHandler] for more information on how and when this information is dumped.
|
* See [DumpHandler] for more information on how and when this information is dumped.
|
||||||
*/
|
*/
|
||||||
@SysUISingleton
|
@SysUISingleton
|
||||||
class DumpManager @Inject constructor() {
|
open class DumpManager @Inject constructor() {
|
||||||
private val dumpables: MutableMap<String, RegisteredDumpable<Dumpable>> = ArrayMap()
|
private val dumpables: MutableMap<String, RegisteredDumpable<Dumpable>> = ArrayMap()
|
||||||
private val buffers: MutableMap<String, RegisteredDumpable<LogBuffer>> = ArrayMap()
|
private val buffers: MutableMap<String, RegisteredDumpable<LogBuffer>> = ArrayMap()
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,12 @@ import javax.inject.Inject
|
|||||||
* Proxy to make {@link SystemProperties} easily testable.
|
* Proxy to make {@link SystemProperties} easily testable.
|
||||||
*/
|
*/
|
||||||
@SysUISingleton
|
@SysUISingleton
|
||||||
class SystemPropertiesHelper @Inject constructor() {
|
open class SystemPropertiesHelper @Inject constructor() {
|
||||||
fun getBoolean(name: String, default: Boolean): Boolean {
|
fun getBoolean(name: String, default: Boolean): Boolean {
|
||||||
return SystemProperties.getBoolean(name, default)
|
return SystemProperties.getBoolean(name, default)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun set(name: String, value: Int) {
|
||||||
|
SystemProperties.set(name, value.toString())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -530,6 +530,10 @@ public class ThemeOverlayController extends SystemUI implements Dumpable {
|
|||||||
mThemeManager.applyCurrentUserOverlays(categoryToPackage, null, currentUser,
|
mThemeManager.applyCurrentUserOverlays(categoryToPackage, null, currentUser,
|
||||||
managedProfiles);
|
managedProfiles);
|
||||||
}
|
}
|
||||||
|
onOverlaysApplied();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onOverlaysApplied() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user