Fix the bug of "Connecting" is rarely appearing on Wi-Fi slice

- AccessPoint treats connected and connecting as equal so slice doesn't
refresh in this case
- Add a new method to determine if two lists are the same in SliceBackgroundWorker
- WifiScanWorker overrides this method to check the access point states

Fixes: 123941320
Test: robotest
Change-Id: I78d610da4b6b1d40f5785ba6701fb71b987fe31c
This commit is contained in:
Jason Chiu
2019-03-07 17:42:39 +08:00
parent b5b61b202b
commit 4e42f53896
3 changed files with 78 additions and 7 deletions

View File

@@ -146,7 +146,7 @@ public abstract class SliceBackgroundWorker<E> implements Closeable {
needNotify = true;
}
} else {
needNotify = !results.equals(mCachedResults);
needNotify = !areListsTheSame(results, mCachedResults);
}
if (needNotify) {
@@ -155,6 +155,10 @@ public abstract class SliceBackgroundWorker<E> implements Closeable {
}
}
protected boolean areListsTheSame(List<E> a, List<E> b) {
return a.equals(b);
}
/**
* Notify that data was updated and attempt to sync changes to the Slice.
*/