Enable Ethernet tab in data usage

mStateSession is not initialized at the time hasEthernet is called to
set mShowEthernet, so Ethernet tab is not shown at the startup.
In this case, if the device doesn't support mobile network, user cannot
even select it from the context menu.

Bug: 8365419
Change-Id: I441971f18346c34a3adf3f18d9355075d9dce3f0
This commit is contained in:
Jaewan Kim
2013-03-19 16:53:45 +09:00
parent ae9ebfd153
commit ffce9c1e9a

View File

@@ -277,13 +277,19 @@ public class DataUsageSummary extends Fragment {
mPolicyEditor = new NetworkPolicyEditor(mPolicyManager);
mPolicyEditor.read();
try {
mStatsSession = mStatsService.openSession();
} catch (RemoteException e) {
throw new RuntimeException(e);
}
mShowWifi = mPrefs.getBoolean(PREF_SHOW_WIFI, false);
mShowEthernet = mPrefs.getBoolean(PREF_SHOW_ETHERNET, false);
// override preferences when no mobile radio
if (!hasReadyMobileRadio(context)) {
mShowWifi = hasWifiRadio(context);
mShowEthernet = hasEthernet(context);
mShowWifi = true;
mShowEthernet = true;
}
setHasOptionsMenu(true);
@@ -298,12 +304,6 @@ public class DataUsageSummary extends Fragment {
mUidDetailProvider = new UidDetailProvider(context);
try {
mStatsSession = mStatsService.openSession();
} catch (RemoteException e) {
throw new RuntimeException(e);
}
mTabHost = (TabHost) view.findViewById(android.R.id.tabhost);
mTabsContainer = (ViewGroup) view.findViewById(R.id.tabs_container);
mTabWidget = (TabWidget) view.findViewById(android.R.id.tabs);