Loading telephony/java/com/android/internal/telephony/DataConnectionTracker.java +9 −4 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.Messenger; import android.os.SystemProperties; import android.preference.PreferenceManager; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; Loading Loading @@ -219,6 +220,8 @@ public abstract class DataConnectionTracker extends Handler { protected static final String FAIL_DATA_SETUP_FAIL_CAUSE = "fail_data_setup_fail_cause"; protected FailCause mFailDataSetupFailCause = FailCause.ERROR_UNSPECIFIED; protected static final String DEFALUT_DATA_ON_BOOT_PROP = "net.def_data_on_boot"; // member variables protected PhoneBase mPhone; protected Activity mActivity = Activity.NONE; Loading Loading @@ -384,13 +387,15 @@ public abstract class DataConnectionTracker extends Handler { // This preference tells us 1) initial condition for "dataEnabled", // and 2) whether the RIL will setup the baseband to auto-PS attach. SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mPhone.getContext()); dataEnabled[APN_DEFAULT_ID] = !sp.getBoolean(PhoneBase.DATA_DISABLED_ON_BOOT_KEY, false); dataEnabled[APN_DEFAULT_ID] = SystemProperties.getBoolean(DEFALUT_DATA_ON_BOOT_PROP, true); if (dataEnabled[APN_DEFAULT_ID]) { enabledCount++; } mAutoAttachOnCreation = dataEnabled[APN_DEFAULT_ID]; SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mPhone.getContext()); mAutoAttachOnCreation = sp.getBoolean(PhoneBase.DATA_DISABLED_ON_BOOT_KEY, false); } public void dispose() { Loading telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +3 −5 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.database.ContentObserver; import android.database.Cursor; import android.net.ConnectivityManager; Loading Loading @@ -270,8 +269,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { } protected void initApnContextsAndDataConnection() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mPhone.getContext()); boolean defaultEnabled = !sp.getBoolean(PhoneBase.DATA_DISABLED_ON_BOOT_KEY, false); boolean defaultEnabled = SystemProperties.getBoolean(DEFALUT_DATA_ON_BOOT_PROP, true); // Load device network attributes from resources String[] networkConfigStrings = mPhone.getContext().getResources().getStringArray( com.android.internal.R.array.networkAttributes); Loading Loading @@ -585,7 +583,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { boolean desiredPowerState = mPhone.getServiceStateTracker().getDesiredPowerState(); boolean allowed = gprsState == ServiceState.STATE_IN_SERVICE && (gprsState == ServiceState.STATE_IN_SERVICE || mAutoAttachOnCreation) && mPhone.mIccRecords.getRecordsLoaded() && mPhone.getState() == Phone.State.IDLE && mInternalDataEnabled && Loading @@ -594,7 +592,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { desiredPowerState; if (!allowed && DBG) { String reason = ""; if (!(gprsState == ServiceState.STATE_IN_SERVICE)) { if (!((gprsState == ServiceState.STATE_IN_SERVICE) || mAutoAttachOnCreation)) { reason += " - gprs= " + gprsState; } if (!mPhone.mIccRecords.getRecordsLoaded()) reason += " - SIM not loaded"; Loading Loading
telephony/java/com/android/internal/telephony/DataConnectionTracker.java +9 −4 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.Messenger; import android.os.SystemProperties; import android.preference.PreferenceManager; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; Loading Loading @@ -219,6 +220,8 @@ public abstract class DataConnectionTracker extends Handler { protected static final String FAIL_DATA_SETUP_FAIL_CAUSE = "fail_data_setup_fail_cause"; protected FailCause mFailDataSetupFailCause = FailCause.ERROR_UNSPECIFIED; protected static final String DEFALUT_DATA_ON_BOOT_PROP = "net.def_data_on_boot"; // member variables protected PhoneBase mPhone; protected Activity mActivity = Activity.NONE; Loading Loading @@ -384,13 +387,15 @@ public abstract class DataConnectionTracker extends Handler { // This preference tells us 1) initial condition for "dataEnabled", // and 2) whether the RIL will setup the baseband to auto-PS attach. SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mPhone.getContext()); dataEnabled[APN_DEFAULT_ID] = !sp.getBoolean(PhoneBase.DATA_DISABLED_ON_BOOT_KEY, false); dataEnabled[APN_DEFAULT_ID] = SystemProperties.getBoolean(DEFALUT_DATA_ON_BOOT_PROP, true); if (dataEnabled[APN_DEFAULT_ID]) { enabledCount++; } mAutoAttachOnCreation = dataEnabled[APN_DEFAULT_ID]; SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mPhone.getContext()); mAutoAttachOnCreation = sp.getBoolean(PhoneBase.DATA_DISABLED_ON_BOOT_KEY, false); } public void dispose() { Loading
telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +3 −5 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.database.ContentObserver; import android.database.Cursor; import android.net.ConnectivityManager; Loading Loading @@ -270,8 +269,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { } protected void initApnContextsAndDataConnection() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mPhone.getContext()); boolean defaultEnabled = !sp.getBoolean(PhoneBase.DATA_DISABLED_ON_BOOT_KEY, false); boolean defaultEnabled = SystemProperties.getBoolean(DEFALUT_DATA_ON_BOOT_PROP, true); // Load device network attributes from resources String[] networkConfigStrings = mPhone.getContext().getResources().getStringArray( com.android.internal.R.array.networkAttributes); Loading Loading @@ -585,7 +583,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { boolean desiredPowerState = mPhone.getServiceStateTracker().getDesiredPowerState(); boolean allowed = gprsState == ServiceState.STATE_IN_SERVICE && (gprsState == ServiceState.STATE_IN_SERVICE || mAutoAttachOnCreation) && mPhone.mIccRecords.getRecordsLoaded() && mPhone.getState() == Phone.State.IDLE && mInternalDataEnabled && Loading @@ -594,7 +592,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { desiredPowerState; if (!allowed && DBG) { String reason = ""; if (!(gprsState == ServiceState.STATE_IN_SERVICE)) { if (!((gprsState == ServiceState.STATE_IN_SERVICE) || mAutoAttachOnCreation)) { reason += " - gprs= " + gprsState; } if (!mPhone.mIccRecords.getRecordsLoaded()) reason += " - SIM not loaded"; Loading