DataSaverController currently used in 2 pages,
- Network & internet > Data Saver
- Apps > Special app access
This helps unify the logic, and instead of showing on "Special app
access", this summary shows on "Unrestricted data" is make more sense.
Bug: 280280596
Test: Manually on above pages
Test: Unit test
Change-Id: Ia151ed8179a250f8f20cc5041f9383fffebdab10
Use AppListRepository instead of ApplicationsState can achieve better
performance.
Fix: 280280596
Test: Manually on Data Saver page
Test: Unit test
Change-Id: I98cbae50500b90e7e7f6101fb064003339b082c1
This is because before fix mLoadAppRunnable is async run. And the
getContext() within it will return null when the Fragment in some not
ready lifecycle.
Use viewLifecycleOwner.lifecycleScope.launch to ensure the async
function will only be run when the view is ready, and automatically
canceled when out of scope.
Since this requires Kotlin Coroutine so migrate DataSaverSummary to
Kotlin, other functionality are keep no change.
Fix: 279863347
Test: Manual
Change-Id: I2e97a071c103e63b3306b801fc38f4704e3be0d2