frameworks/base
Revision | 283159d157371d21d1296acd7c2ea66c16fe4a8e (tree) |
---|---|
Time | 2017-12-17 21:25:08 |
Author | Michael W <baddaemon87@gmai...> |
Commiter | Michael W |
SystemUI: KeyGuardMonitor: Prevent ConcurrentModificationException
* Instead of accessing the original ArrayList, which might be modified
* This ensures that no exception is thrown when some other part unregisters
BUGBASH-1289
Change-Id: Ie8404d88c7c87c4ec8fcd64fdd5218b25806f24f
@@ -1,5 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | * Copyright (C) 2014 The Android Open Source Project |
3 | + * Copyright (C) 2017 The LineageOS Project | |
3 | 4 | * |
4 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 6 | * you may not use this file except in compliance with the License. |
@@ -127,7 +128,8 @@ public final class KeyguardMonitor extends KeyguardUpdateMonitorCallback { | ||
127 | 128 | } |
128 | 129 | |
129 | 130 | private void notifyKeyguardChanged() { |
130 | - for (Callback callback : mCallbacks) { | |
131 | + ArrayList<Callback> callbacks = new ArrayList<Callback>(mCallbacks); | |
132 | + for (Callback callback : callbacks) { | |
131 | 133 | callback.onKeyguardChanged(); |
132 | 134 | } |
133 | 135 | } |