Merge "Modify sample apps for API adjustments"
diff --git a/src/com/android/phone/EmergencyDialer.java b/src/com/android/phone/EmergencyDialer.java
index e7b05ce..3559a75 100644
--- a/src/com/android/phone/EmergencyDialer.java
+++ b/src/com/android/phone/EmergencyDialer.java
@@ -93,8 +93,6 @@
     private static final boolean DBG = false;
     private static final String LOG_TAG = "EmergencyDialer";
 
-    private StatusBarManager mStatusBarManager;
-
     /** The length of DTMF tones in milliseconds */
     private static final int TONE_LENGTH_MS = 150;
 
@@ -164,8 +162,6 @@
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
 
-        mStatusBarManager = (StatusBarManager) getSystemService(Context.STATUS_BAR_SERVICE);
-
         // Allow this activity to be displayed in front of the keyguard / lockscreen.
         WindowManager.LayoutParams lp = getWindow().getAttributes();
         lp.flags |= WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
@@ -483,21 +479,11 @@
             }
         }
 
-        // Disable the status bar and set the poke lock timeout to medium.
-        // There is no need to do anything with the wake lock.
-        if (DBG) Log.d(LOG_TAG, "disabling status bar, set to long timeout");
-        mStatusBarManager.disable(StatusBarManager.DISABLE_EXPAND);
-
         updateDialAndDeleteButtonStateEnabledAttr();
     }
 
     @Override
     public void onPause() {
-        // Reenable the status bar and set the poke lock timeout to default.
-        // There is no need to do anything with the wake lock.
-        if (DBG) Log.d(LOG_TAG, "reenabling status bar and closing the dialer");
-        mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);
-
         super.onPause();
 
         synchronized (mToneGeneratorLock) {
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 5639a09..cae9d25 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -47,8 +47,10 @@
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.Log;
+import android.view.LayoutInflater;
 import android.view.MenuItem;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.TabHost;
 
 import com.android.ims.ImsManager;
@@ -296,8 +298,6 @@
                     if (DBG) log("initializeSubscriptions: UPDATE");
                     currentTab = mTabHost != null ? mTabHost.getCurrentTab() : 0;
 
-                    getActivity().setContentView(com.android.internal.R.layout.common_tab_settings);
-
                     mTabHost = (TabHost) getActivity().findViewById(android.R.id.tabhost);
                     mTabHost.setup();
 
@@ -336,7 +336,6 @@
                         mTabHost.clearAllTabs();
                         mTabHost = null;
                     }
-                    getActivity().setContentView(com.android.internal.R.layout.common_tab_settings);
                     break;
                 }
                 case DO_NOTHING: {
@@ -471,10 +470,22 @@
                     TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED);
             getActivity().registerReceiver(mPhoneChangeReceiver, intentFilter);
 
-            initializeSubscriptions();
             Log.i(LOG_TAG, "onCreate:-");
         }
 
+        @Override
+        public View onCreateView(LayoutInflater inflater, ViewGroup container,
+                Bundle savedInstanceState) {
+            return inflater.inflate(com.android.internal.R.layout.common_tab_settings,
+                    container, false);
+        }
+
+        @Override
+        public void onActivityCreated(Bundle savedInstanceState) {
+            super.onActivityCreated(savedInstanceState);
+            initializeSubscriptions();
+        }
+
         private class PhoneChangeReceiver extends BroadcastReceiver {
             @Override
             public void onReceive(Context context, Intent intent) {