Merge "sysui: small refactor and delete dead code"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 6c0c0ae..efa8f5b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -231,6 +231,10 @@
return mCurrentView;
}
+ public View[] getAllViews() {
+ return mRotatedViews;
+ }
+
public KeyButtonView getRecentsButton() {
return (KeyButtonView) getCurrentView().findViewById(R.id.recent_apps);
}
@@ -341,7 +345,6 @@
// Update menu button in case the IME state has changed.
setMenuVisibility(mShowMenu, true);
-
setDisabledFlags(mDisabledFlags, true);
}
@@ -398,12 +401,6 @@
}
}
- private void setVisibleOrGone(View view, boolean visible) {
- if (view != null) {
- view.setVisibility(visible ? VISIBLE : GONE);
- }
- }
-
public void setLayoutTransitionsEnabled(boolean enabled) {
mLayoutTransitionsEnabled = enabled;
updateLayoutTransitionsEnabled();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 78497ab..c853fb4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -495,7 +495,6 @@
private final ShadeUpdates mShadeUpdates = new ShadeUpdates();
- private int mDrawCount;
private Runnable mLaunchTransitionEndRunnable;
private boolean mLaunchTransitionFadingAway;
private ExpandableNotificationRow mDraggedDownRow;
@@ -670,8 +669,6 @@
protected PhoneStatusBarView makeStatusBarView() {
final Context context = mContext;
- Resources res = context.getResources();
-
updateDisplaySize(); // populates mDisplayMetrics
updateResources();
@@ -835,23 +832,11 @@
mZenModeController = mVolumeComponent.getZenController();
}
mCastController = new CastControllerImpl(mContext);
- final SignalClusterView signalCluster =
- (SignalClusterView) mStatusBarView.findViewById(R.id.signal_cluster);
- final SignalClusterView signalClusterKeyguard =
- (SignalClusterView) mKeyguardStatusBar.findViewById(R.id.signal_cluster);
- final SignalClusterView signalClusterQs =
- (SignalClusterView) mHeader.findViewById(R.id.signal_cluster);
- mNetworkController.addSignalCallback(signalCluster);
- mNetworkController.addSignalCallback(signalClusterKeyguard);
- signalCluster.setSecurityController(mSecurityController);
- signalCluster.setNetworkController(mNetworkController);
- signalClusterKeyguard.setSecurityController(mSecurityController);
- signalClusterKeyguard.setNetworkController(mNetworkController);
- if (signalClusterQs != null) {
- mNetworkController.addSignalCallback(signalClusterQs);
- signalClusterQs.setSecurityController(mSecurityController);
- signalClusterQs.setNetworkController(mNetworkController);
- }
+
+ initSignalCluster(mStatusBarView);
+ initSignalCluster(mKeyguardStatusBar);
+ initSignalCluster(mHeader);
+
final boolean isAPhone = mNetworkController.hasVoiceCallingFeature();
if (isAPhone) {
mNetworkController.addEmergencyListener(mHeader);
@@ -977,6 +962,16 @@
}});
}
+ private void initSignalCluster(View containerView) {
+ SignalClusterView signalCluster =
+ (SignalClusterView) containerView.findViewById(R.id.signal_cluster);
+ if (signalCluster != null) {
+ mNetworkController.addSignalCallback(signalCluster);
+ signalCluster.setSecurityController(mSecurityController);
+ signalCluster.setNetworkController(mNetworkController);
+ }
+ }
+
/** Returns true if the app shelf should be shown in the nav bar. */
private boolean shouldShowAppShelf() {
// Allow adb to override the default shelf behavior: