OSDN Git Service

resolve merge conflicts of 148db9dfa669 to oc-mr1-dev
[android-x86/frameworks-base.git] / packages / SystemUI / src / com / android / systemui / statusbar / phone / NavigationBarView.java
index 7451e82..94f8ef8 100644 (file)
@@ -560,22 +560,19 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
     public void onFinishInflate() {
         mNavigationInflaterView = (NavigationBarInflaterView) findViewById(
                 R.id.navigation_inflater);
-        updateRotatedViews();
         mNavigationInflaterView.setButtonDispatchers(mButtonDispatchers);
 
         getImeSwitchButton().setOnClickListener(mImeSwitcherClickListener);
 
         DockedStackExistsListener.register(mDockedListener);
+        updateRotatedViews();
     }
 
-    void updateRotatedViews() {
+    private void updateRotatedViews() {
         mRotatedViews[Surface.ROTATION_0] =
                 mRotatedViews[Surface.ROTATION_180] = findViewById(R.id.rot0);
         mRotatedViews[Surface.ROTATION_270] =
                 mRotatedViews[Surface.ROTATION_90] = findViewById(R.id.rot90);
-
-        mCurrentRotation = -1;
-        reorient();
     }
 
     public boolean needsReorient(int rotation) {
@@ -614,9 +611,9 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
         }
 
         mDeadZone = (DeadZone) mCurrentView.findViewById(R.id.deadzone);
-        if (getRootView() instanceof NavigationBarFrame) {
-            ((NavigationBarFrame) getRootView()).setDeadZone(mDeadZone);
-        }
+
+        ((NavigationBarFrame) getRootView()).setDeadZone(mDeadZone);
+
         mDeadZone.setDisplayRotation(mCurrentRotation);
 
         // force the low profile & disabled states into compliance
@@ -757,6 +754,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
     @Override
     protected void onAttachedToWindow() {
         super.onAttachedToWindow();
+        reorient();
         onPluginDisconnected(null); // Create default gesture helper
         Dependency.get(PluginManager.class).addPluginListener(this,
                 NavGesture.class, false /* Only one */);