Add more preference controllers to network page.

- To support Mobile plan preference controller, extended
  LifecycleObserver pattern to also observe onCreate and onSaveInstance.

Bug: 31799836
Test: RunSettingsRoboTests
Change-Id: Ie98db7efa91f0a8b4c8a06a784d3351237e59fe0
This commit is contained in:
Fan Zhang
2016-10-13 09:53:38 -07:00
parent fdca235dc5
commit f1acdd3a51
14 changed files with 698 additions and 235 deletions

View File

@@ -46,9 +46,9 @@ public class MobileNetworkPreferenceController extends PreferenceController {
@Override
protected boolean isAvailable() {
return mIsSecondaryUser
|| Utils.isWifiOnly(mContext)
|| hasBaseUserRestriction(mContext, DISALLOW_CONFIG_MOBILE_NETWORKS, myUserId());
return !mIsSecondaryUser
&& !Utils.isWifiOnly(mContext)
&& !hasBaseUserRestriction(mContext, DISALLOW_CONFIG_MOBILE_NETWORKS, myUserId());
}
@Override