diff options
author | Michael Jurka <mikejurka@google.com> | 2012-06-25 15:57:05 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-06-28 13:47:41 -0700 |
commit | a600fd9ba76e7916f18521447446671f0e431560 (patch) | |
tree | 90e0b629003cf9c66699e92b6168e41e1968e8f4 /packages/SystemUI/src/com | |
parent | 041c36686dd986834990d85f7f93fe2ee4e5fca5 (diff) | |
download | frameworks_base-a600fd9ba76e7916f18521447446671f0e431560.zip frameworks_base-a600fd9ba76e7916f18521447446671f0e431560.tar.gz frameworks_base-a600fd9ba76e7916f18521447446671f0e431560.tar.bz2 |
Fix warnings and remove dead code
Change-Id: Ifd1bcd8f5be181b115910f2f8918e1e50975a790
Diffstat (limited to 'packages/SystemUI/src/com')
9 files changed, 12 insertions, 228 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java b/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java index 296b640..18ad682 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java +++ b/packages/SystemUI/src/com/android/systemui/recent/Choreographer.java @@ -25,7 +25,6 @@ import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.util.Slog; import android.view.View; -import android.view.ViewRootImpl; import com.android.systemui.R; diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java index f5894ea..fefd0e8 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java @@ -53,7 +53,6 @@ public class RecentTasksLoader { private AsyncTask<Void, ArrayList<TaskDescription>, Void> mTaskLoader; private AsyncTask<Void, TaskDescription, Void> mThumbnailLoader; - private final Handler mHandler; private int mIconDpi; private Bitmap mDefaultThumbnailBackground; @@ -96,8 +95,6 @@ public class RecentTasksLoader { // updated thumbnails final ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); - - mHandler = new Handler(); } public void setRecentsPanel(RecentsPanelView recentsPanel) { @@ -225,8 +222,6 @@ public class RecentTasksLoader { cancelLoadingThumbnailsAndIcons(); final LinkedBlockingQueue<TaskDescription> tasksWaitingForThumbnails = new LinkedBlockingQueue<TaskDescription>(); - final ArrayList<TaskDescription> taskDescriptionsWaitingToLoad = - new ArrayList<TaskDescription>(); mTaskLoader = new AsyncTask<Void, ArrayList<TaskDescription>, Void>() { @Override protected void onProgressUpdate(ArrayList<TaskDescription>... values) { diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java index f85007e..e9c2ecb7 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java @@ -27,10 +27,6 @@ import android.util.FloatMath; import android.util.Log; import android.view.MotionEvent; import android.view.View; -import android.view.View.MeasureSpec; -import android.view.View.OnClickListener; -import android.view.View.OnLongClickListener; -import android.view.View.OnTouchListener; import android.view.ViewConfiguration; import android.view.ViewTreeObserver; import android.view.ViewTreeObserver.OnGlobalLayoutListener; diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsScrollViewPerformanceHelper.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsScrollViewPerformanceHelper.java index 9bc54cb..71cc1e4 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsScrollViewPerformanceHelper.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsScrollViewPerformanceHelper.java @@ -16,7 +16,6 @@ package com.android.systemui.recent; -import android.animation.LayoutTransition; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; @@ -24,11 +23,9 @@ import android.graphics.LinearGradient; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Shader; -import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.view.ViewConfiguration; -import android.view.ViewGroup; import android.widget.LinearLayout; import com.android.systemui.R; @@ -37,13 +34,10 @@ public class RecentsScrollViewPerformanceHelper { public static final boolean OPTIMIZE_SW_RENDERED_RECENTS = true; public static final boolean USE_DARK_FADE_IN_HW_ACCELERATED_MODE = true; private View mScrollView; - private RecentsCallback mCallback; private int mFadingEdgeLength; - private Context mContext; private boolean mIsVertical; private boolean mSoftwareRendered = false; - private boolean mAttachedToWindow = false; public static RecentsScrollViewPerformanceHelper create(Context context, AttributeSet attrs, View scrollView, boolean isVertical) { @@ -59,7 +53,6 @@ public class RecentsScrollViewPerformanceHelper { public RecentsScrollViewPerformanceHelper(Context context, AttributeSet attrs, View scrollView, boolean isVertical) { mScrollView = scrollView; - mContext = context; TypedArray a = context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.View); mFadingEdgeLength = a.getDimensionPixelSize(android.R.styleable.View_fadingEdgeLength, ViewConfiguration.get(context).getScaledFadingEdgeLength()); diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java index e802985..ba08775 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java @@ -27,10 +27,6 @@ import android.util.FloatMath; import android.util.Log; import android.view.MotionEvent; import android.view.View; -import android.view.View.MeasureSpec; -import android.view.View.OnClickListener; -import android.view.View.OnLongClickListener; -import android.view.View.OnTouchListener; import android.view.ViewConfiguration; import android.view.ViewTreeObserver; import android.view.ViewTreeObserver.OnGlobalLayoutListener; diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java index c09e4c4..5c4108a 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -38,7 +38,6 @@ import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PixelFormat; import android.graphics.PointF; -import android.graphics.RectF; import android.media.MediaActionSound; import android.net.Uri; import android.os.AsyncTask; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 08016df..1feb3fa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -16,11 +16,8 @@ package com.android.systemui.statusbar; -import java.util.ArrayList; - import android.app.ActivityManagerNative; import android.app.KeyguardManager; -import android.app.Notification; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; @@ -51,25 +48,26 @@ import android.view.WindowManager; import android.view.WindowManagerImpl; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.RemoteViews; import android.widget.PopupMenu; +import android.widget.RemoteViews; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIconList; import com.android.internal.statusbar.StatusBarNotification; import com.android.internal.widget.SizeAdaptiveLayout; +import com.android.systemui.R; import com.android.systemui.SearchPanelView; import com.android.systemui.SystemUI; -import com.android.systemui.recent.RecentsPanelView; import com.android.systemui.recent.RecentTasksLoader; +import com.android.systemui.recent.RecentsPanelView; import com.android.systemui.recent.TaskDescription; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationData.Entry; import com.android.systemui.statusbar.policy.NotificationRowLayout; import com.android.systemui.statusbar.tablet.StatusBarPanel; -import com.android.systemui.R; +import java.util.ArrayList; public abstract class BaseStatusBar extends SystemUI implements CommandQueue.Callbacks, RecentsPanelView.OnRecentsPanelVisibilityChangedListener { 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 eff6061..fa4448d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.phone; import android.animation.Animator; -import android.animation.Animator.AnimatorListener; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; @@ -72,14 +71,15 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ScrollView; import android.widget.TextView; + import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarNotification; import com.android.systemui.R; import com.android.systemui.recent.RecentTasksLoader; import com.android.systemui.statusbar.BaseStatusBar; +import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationData.Entry; -import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.RotationToggle; import com.android.systemui.statusbar.SignalClusterView; import com.android.systemui.statusbar.StatusBarIconView; @@ -87,9 +87,9 @@ import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.DateView; import com.android.systemui.statusbar.policy.IntruderAlertView; import com.android.systemui.statusbar.policy.LocationController; -import com.android.systemui.statusbar.policy.OnSizeChangedListener; import com.android.systemui.statusbar.policy.NetworkController; import com.android.systemui.statusbar.policy.NotificationRowLayout; +import com.android.systemui.statusbar.policy.OnSizeChangedListener; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -203,7 +203,6 @@ public class PhoneStatusBar extends BaseStatusBar { // the tracker view int mTrackingPosition; // the position of the top of the tracking view. - private boolean mPanelSlightlyVisible; // ticker private Ticker mTicker; @@ -286,25 +285,6 @@ public class PhoneStatusBar extends BaseStatusBar { } }; - private class ExpandedDialog extends Dialog { - ExpandedDialog(Context context) { - super(context, com.android.internal.R.style.Theme_Translucent_NoTitleBar); - } - - @Override - public boolean dispatchKeyEvent(KeyEvent event) { - boolean down = event.getAction() == KeyEvent.ACTION_DOWN; - switch (event.getKeyCode()) { - case KeyEvent.KEYCODE_BACK: - if (!down) { - animateCollapse(); - } - return true; - } - return super.dispatchKeyEvent(event); - } - } - @Override public void start() { mDisplay = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) @@ -673,8 +653,6 @@ public class PhoneStatusBar extends BaseStatusBar { } private void addIntruderView() { - final int height = getStatusBarHeight(); - WindowManager.LayoutParams lp = new WindowManager.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, @@ -859,12 +837,6 @@ public class PhoneStatusBar extends BaseStatusBar { mSettingsButton.setEnabled(isDeviceProvisioned()); } - private void reloadAllNotificationIcons() { - if (mNotificationIcons == null) return; - mNotificationIcons.removeAllViews(); - updateNotificationIcons(); - } - @Override protected void updateNotificationIcons() { if (mNotificationIcons == null) return; @@ -1789,64 +1761,6 @@ public class PhoneStatusBar extends BaseStatusBar { @Override public void setHardKeyboardStatus(boolean available, boolean enabled) { } - private class NotificationClicker implements View.OnClickListener { - private PendingIntent mIntent; - private String mPkg; - private String mTag; - private int mId; - - NotificationClicker(PendingIntent intent, String pkg, String tag, int id) { - mIntent = intent; - mPkg = pkg; - mTag = tag; - mId = id; - } - - public void onClick(View v) { - try { - // The intent we are sending is for the application, which - // won't have permission to immediately start an activity after - // the user switches to home. We know it is safe to do at this - // point, so make sure new activity switches are now allowed. - ActivityManagerNative.getDefault().resumeAppSwitches(); - // Also, notifications can be launched from the lock screen, - // so dismiss the lock screen when the activity starts. - ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity(); - } catch (RemoteException e) { - } - - if (mIntent != null) { - int[] pos = new int[2]; - v.getLocationOnScreen(pos); - Intent overlay = new Intent(); - overlay.setSourceBounds( - new Rect(pos[0], pos[1], pos[0]+v.getWidth(), pos[1]+v.getHeight())); - try { - mIntent.send(mContext, 0, overlay); - } catch (PendingIntent.CanceledException e) { - // the stack trace isn't very helpful here. Just log the exception message. - Slog.w(TAG, "Sending contentIntent failed: " + e); - } - - KeyguardManager kgm = - (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE); - if (kgm != null) kgm.exitKeyguardSecurely(null); - } - - try { - mBarService.onNotificationClick(mPkg, mTag, mId); - } catch (RemoteException ex) { - // system process is dead if we're here. - } - - // close the shade if it was open - animateCollapse(); - - // If this click was on the intruder alert, hide that instead - mHandler.sendEmptyMessage(MSG_HIDE_INTRUDER); - } - } - @Override protected void tick(IBinder key, StatusBarNotification n, boolean firstTime) { // no ticking in lights-out mode @@ -2061,7 +1975,6 @@ public class PhoneStatusBar extends BaseStatusBar { } // tracking view... - int pos; if (expandedPosition == EXPANDED_FULL_OPEN) { panelh = disph; } @@ -2148,9 +2061,6 @@ public class PhoneStatusBar extends BaseStatusBar { } private View.OnClickListener mClearButtonListener = new View.OnClickListener() { - final int mini(int a, int b) { - return (b>a?a:b); - } public void onClick(View v) { synchronized (mNotificationData) { // animate-swipe all dismissable notifications, then animate the shade closed diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 29d8c98..f2dbc1f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -57,7 +57,6 @@ import android.view.WindowManagerImpl; import android.view.accessibility.AccessibilityEvent; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.RemoteViews; import android.widget.ScrollView; import android.widget.TextView; @@ -70,9 +69,9 @@ import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.DoNotDisturb; import com.android.systemui.statusbar.NotificationData; +import com.android.systemui.statusbar.NotificationData.Entry; import com.android.systemui.statusbar.SignalClusterView; import com.android.systemui.statusbar.StatusBarIconView; -import com.android.systemui.statusbar.NotificationData.Entry; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BluetoothController; import com.android.systemui.statusbar.policy.CompatModeButton; @@ -495,8 +494,7 @@ public class TabletStatusBar extends BaseStatusBar implements // where the icons go mIconLayout = (NotificationIconArea.IconLayout) sb.findViewById(R.id.icons); - ViewConfiguration vc = ViewConfiguration.get(context); - mNotificationPeekTapDuration = vc.getTapTimeout(); + mNotificationPeekTapDuration = ViewConfiguration.getTapTimeout(); mNotificationFlingVelocity = 300; // px/s mTicker = new TabletTicker(this); @@ -1294,7 +1292,7 @@ public class TabletStatusBar extends BaseStatusBar implements mNotificationArea.postDelayed(mHiliteOnR, 100); } else { mNotificationArea.removeCallbacks(mHiliteOnR); - mNotificationArea.setBackgroundDrawable(null); + mNotificationArea.setBackground(null); } } @@ -1368,106 +1366,6 @@ public class TabletStatusBar extends BaseStatusBar implements NOTIFICATION_PEEK_FADE_DELAY); } - private class NotificationIconTouchListener implements View.OnTouchListener { - VelocityTracker mVT; - int mPeekIndex; - float mInitialTouchX, mInitialTouchY; - int mTouchSlop; - - public NotificationIconTouchListener() { - mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); - } - - public boolean onTouch(View v, MotionEvent event) { - boolean peeking = mNotificationPeekWindow.getVisibility() != View.GONE; - boolean panelShowing = mNotificationPanel.isShowing(); - if (panelShowing) return false; - - int numIcons = mIconLayout.getChildCount(); - int newPeekIndex = (int)(event.getX() * numIcons / mIconLayout.getWidth()); - if (newPeekIndex > numIcons - 1) newPeekIndex = numIcons - 1; - else if (newPeekIndex < 0) newPeekIndex = 0; - - final int action = event.getAction(); - switch (action) { - case MotionEvent.ACTION_DOWN: - mVT = VelocityTracker.obtain(); - mInitialTouchX = event.getX(); - mInitialTouchY = event.getY(); - mPeekIndex = -1; - - // fall through - case MotionEvent.ACTION_OUTSIDE: - case MotionEvent.ACTION_MOVE: - // peek and switch icons if necessary - - if (newPeekIndex != mPeekIndex) { - mPeekIndex = newPeekIndex; - - if (DEBUG) Slog.d(TAG, "will peek at notification #" + mPeekIndex); - Message peekMsg = mHandler.obtainMessage(MSG_OPEN_NOTIFICATION_PEEK); - peekMsg.arg1 = mPeekIndex; - - mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); - - if (peeking) { - // no delay if we're scrubbing left-right - mHandler.sendMessage(peekMsg); - } else { - // wait for fling - mHandler.sendMessageDelayed(peekMsg, NOTIFICATION_PEEK_HOLD_THRESH); - } - } - - // check for fling - if (mVT != null) { - mVT.addMovement(event); - mVT.computeCurrentVelocity(1000); // pixels per second - // require a little more oomph once we're already in peekaboo mode - if (!panelShowing && ( - (peeking && mVT.getYVelocity() < -mNotificationFlingVelocity*3) - || (mVT.getYVelocity() < -mNotificationFlingVelocity))) { - mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); - mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PANEL); - mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK); - mHandler.sendEmptyMessage(MSG_OPEN_NOTIFICATION_PANEL); - } - } - return true; - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_CANCEL: - mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); - if (!peeking) { - if (action == MotionEvent.ACTION_UP - // was this a sloppy tap? - && Math.abs(event.getX() - mInitialTouchX) < mTouchSlop - && Math.abs(event.getY() - mInitialTouchY) < (mTouchSlop / 3) - // dragging off the bottom doesn't count - && (int)event.getY() < v.getBottom()) { - Message peekMsg = mHandler.obtainMessage(MSG_OPEN_NOTIFICATION_PEEK); - peekMsg.arg1 = mPeekIndex; - mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK); - mHandler.sendMessage(peekMsg); - - v.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); - v.playSoundEffect(SoundEffectConstants.CLICK); - - peeking = true; // not technically true yet, but the next line will run - } - } - - if (peeking) { - resetNotificationPeekFadeTimer(); - } - - mVT.recycle(); - mVT = null; - return true; - } - return false; - } - } - private void reloadAllNotificationIcons() { if (mIconLayout == null) return; mIconLayout.removeAllViews(); @@ -1609,9 +1507,9 @@ public class TabletStatusBar extends BaseStatusBar implements if (!(bgd instanceof LayerDrawable)) return; LayerDrawable d = (LayerDrawable) bgd; - v.setBackgroundDrawable(null); + v.setBackground(null); d.setOpacity(PixelFormat.TRANSLUCENT); - v.setBackgroundDrawable(d); + v.setBackground(d); } public void clearAll() { |