SST - Remove Double-Cached Previous SubId
For reasons that are a little unclear, a change of subId was causing an atomic integer to be set, presumably because the only OnSubscriptionsChangedListener didn't allow callbacks on a particular thread, which created races. This patch serializes updates to the subId caching, removing the atomic in the middle entirely, and ensuring that updates to the current and previous subId values in the SST class are done on the Handler (and consequently thread) of the SST. Logic is accordingly refactored slightly to simplify the cascading assignment of curSubId -> prevSubId and then newSubId -> curSubId. Bug: 160681475 Test: atest ServiceStateTrackerTest Test: manual (steps from b/160681475) 1) selected a forbidden PLMN 2) waited for a notification 3) removed SIM and verified notification gone Change-Id: Ic310a216c64f8f2f9c18c26f4300d9d100327a6c
Loading
Please register or sign in to comment