fix(spoof): serialize concurrent applyToProps calls
applyToProps reaches Runtime.exec("resetprop", name, value) twice
per call, once for system and once for vendor. Boot-time
initialize, BulletinPoller's handler thread, and the PifObserver
inotify thread can all reach applyToProps independently. Two
concurrent invocations for different dates could interleave such
that system and vendor end up with mismatched values. Synchronize
on the singleton so each apply runs to completion before the
next begins.
This commit is contained in:
@@ -61,6 +61,7 @@ object PatchLevelManager {
|
|||||||
PifObserver.startWatching()
|
PifObserver.startWatching()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Synchronized
|
||||||
private fun applyToProps(date: String) {
|
private fun applyToProps(date: String) {
|
||||||
if (!DATE_PATTERN.matches(date)) {
|
if (!DATE_PATTERN.matches(date)) {
|
||||||
SystemLogger.warning(
|
SystemLogger.warning(
|
||||||
|
|||||||
Reference in New Issue
Block a user