SetupWizard: Use the system property mobile data page visibility
Change-Id: I3a3301bcdbc2200ba62067188e59c886a0891788
This commit is contained in:
parent
b076a55991
commit
4d08b90df3
@ -20,6 +20,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.SystemProperties;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
|
||||
@ -34,6 +35,8 @@ public class CMSetupWizardData extends AbstractSetupData {
|
||||
|
||||
private boolean mTimeSet = false;
|
||||
private boolean mTimeZoneSet = false;
|
||||
private boolean mMobileDataEnabled = SystemProperties
|
||||
.getBoolean("ro.com.android.mobiledata", true);
|
||||
|
||||
public CMSetupWizardData(Context context) {
|
||||
super(context);
|
||||
@ -57,7 +60,7 @@ public class CMSetupWizardData extends AbstractSetupData {
|
||||
}
|
||||
if (SetupWizardUtils.hasTelephony(mContext)) {
|
||||
pages.add(new MobileDataPage(mContext, this)
|
||||
.setHidden(!isSimInserted() || SetupWizardUtils.isMobileDataEnabled(mContext)));
|
||||
.setHidden(!isSimInserted() || mMobileDataEnabled));
|
||||
}
|
||||
if (SetupWizardUtils.hasGMS(mContext)) {
|
||||
pages.add(new GmsAccountPage(mContext, this).setHidden(true));
|
||||
@ -83,6 +86,7 @@ public class CMSetupWizardData extends AbstractSetupData {
|
||||
.equals(ConnectivityManager.CONNECTIVITY_ACTION) ||
|
||||
intent.getAction()
|
||||
.equals(ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE)) {
|
||||
showHideMobileDataPage();
|
||||
showHideAccountPages();
|
||||
} else if (intent.getAction()
|
||||
.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
|
||||
@ -136,7 +140,7 @@ public class CMSetupWizardData extends AbstractSetupData {
|
||||
MobileDataPage mobileDataPage =
|
||||
(MobileDataPage) getPage(MobileDataPage.TAG);
|
||||
if (mobileDataPage != null) {
|
||||
mobileDataPage.setHidden(!isSimInserted());
|
||||
mobileDataPage.setHidden(!isSimInserted() || mMobileDataEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user