OSDN Git Service

Prevent extra reloads in mobile networking page/controllers
authorAntony Sargent <asargent@google.com>
Mon, 4 Mar 2019 21:21:20 +0000 (13:21 -0800)
committerAntony Sargent <asargent@google.com>
Tue, 5 Mar 2019 00:37:33 +0000 (16:37 -0800)
commitce9a126add91ea26207b55e1734f43b4f44f2a33
tree92c9380d265f0b7d7615274540cbc68a3f4ad3d5
parentca299cf2810dfabdcc3c14193ba24affa9e56041
Prevent extra reloads in mobile networking page/controllers

On the mobile network details page, as well as in several preference
controllers used in various page, we had listeners for the
ACTION_RADIO_TECHNOLOGY_CHANGED broadcast that when fired would cause a
reload. It turns out that this gets broadcast as a sticky intent, so our
callbaks would fire just after registering to listen, resulting in lots
of unnecessary extra reloading. This was particularly noticable on the
mobile network details page because the entire page gets reloaded.

The fix is to make our listeners ignore the broadcast if it's the
initial sticky one.

Bug: 126419558
Test: make RunSettingsRoboTests
Change-Id: I6ab7b43d74b07a839e45ce5368e45809be658b9d
src/com/android/settings/network/SubscriptionsChangeListener.java
src/com/android/settings/network/telephony/MobileNetworkActivity.java
tests/robotests/src/com/android/settings/network/SubscriptionsChangeListenerTest.java
tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java