Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java +6 −0 Original line number Diff line number Diff line Loading @@ -400,6 +400,12 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks mDateView = (DateView)sb.findViewById(R.id.date); mCmBatteryMiniIcon = (CmBatteryMiniIcon)sb.findViewById(R.id.CmBatteryMiniIcon); /* Destroy any existing widgets before recreating the expanded dialog * to ensure there are no lost context issues */ if (mPowerWidget != null) { mPowerWidget.destroyWidget(); } mExpandedDialog = new ExpandedDialog(context); mExpandedView = expanded; mExpandedContents = expanded.findViewById(R.id.notificationLinearLayout); Loading packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/PowerWidget.java +8 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ public class PowerWidget extends FrameLayout { updateVisibility(); } public void setupWidget() { public void destroyWidget() { Log.i(TAG, "Clearing any old widget stuffs"); // remove all views from the layout removeAllViews(); Loading @@ -92,14 +92,21 @@ public class PowerWidget extends FrameLayout { // unregister our content receiver if(mBroadcastReceiver != null) { mContext.unregisterReceiver(mBroadcastReceiver); mBroadcastReceiver = null; } // unobserve our content if(mObserver != null) { mObserver.unobserve(); mObserver = null; } // clear the button instances PowerButton.unloadAllButtons(); } public void setupWidget() { destroyWidget(); Log.i(TAG, "Setting up widget"); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java +6 −0 Original line number Diff line number Diff line Loading @@ -400,6 +400,12 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks mDateView = (DateView)sb.findViewById(R.id.date); mCmBatteryMiniIcon = (CmBatteryMiniIcon)sb.findViewById(R.id.CmBatteryMiniIcon); /* Destroy any existing widgets before recreating the expanded dialog * to ensure there are no lost context issues */ if (mPowerWidget != null) { mPowerWidget.destroyWidget(); } mExpandedDialog = new ExpandedDialog(context); mExpandedView = expanded; mExpandedContents = expanded.findViewById(R.id.notificationLinearLayout); Loading
packages/SystemUI/src/com/android/systemui/statusbar/powerwidget/PowerWidget.java +8 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ public class PowerWidget extends FrameLayout { updateVisibility(); } public void setupWidget() { public void destroyWidget() { Log.i(TAG, "Clearing any old widget stuffs"); // remove all views from the layout removeAllViews(); Loading @@ -92,14 +92,21 @@ public class PowerWidget extends FrameLayout { // unregister our content receiver if(mBroadcastReceiver != null) { mContext.unregisterReceiver(mBroadcastReceiver); mBroadcastReceiver = null; } // unobserve our content if(mObserver != null) { mObserver.unobserve(); mObserver = null; } // clear the button instances PowerButton.unloadAllButtons(); } public void setupWidget() { destroyWidget(); Log.i(TAG, "Setting up widget"); Loading