b546e977676e83f932e88e6c6d4e6e2710621bc9 |
|
21-Jul-2017 |
Sergey Vasilinets <sergeyv@google.com> |
Introduce ordering invariants in LifecycleRegistry Invariant 1: at any moment of time for observer1 & observer2 in LifecycleRegistry's observers list: if addition_order(observer1) < addition_order(observer2), then state(observer1) >= state(observer2). Invariant 2: Suppose in addition time of observer1 in the current stack there is a function annotated with @OnLifecycleEvent called on an observer2, then observer2 is called a parent of observer1 and observer1 will be brought to state smaller than state(observer2) Note: Usually Invariant 1 covers Invariant 2, except one corner case when parent in addition time is already removed from observers list. bug:63112687 Test: LifecycleRegistryTest Change-Id: I7d197d96647b0307baf4624e5b2ec324133e4ccf
/frameworks/support/app-toolkit/common/src/main/java/android/arch/core/internal/FastSafeIterableMap.java
|