From 26acafbe67565a9cc6aeb7d6c43a1c6d1cb9b73c Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 5 Sep 2013 21:47:39 +0200 Subject: Fix crash when setting wallpaper Also clean up some unused code Change-Id: Ibef8d3d594cc859a993640fd6ee578e9eeb633d1 --- src/com/android/launcher3/AppsCustomizeCellLayout.java | 5 ----- src/com/android/launcher3/AppsCustomizePagedView.java | 1 - src/com/android/launcher3/InstallShortcutReceiver.java | 4 ++-- src/com/android/launcher3/LauncherAppWidgetHostView.java | 3 --- src/com/android/launcher3/LauncherModel.java | 2 -- src/com/android/launcher3/PageIndicator.java | 6 ------ src/com/android/launcher3/PagedViewCellLayout.java | 2 -- src/com/android/launcher3/ShortcutAndWidgetContainer.java | 3 --- src/com/android/launcher3/Utilities.java | 3 --- src/com/android/launcher3/WallpaperPickerActivity.java | 3 --- 10 files changed, 2 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher3/AppsCustomizeCellLayout.java b/src/com/android/launcher3/AppsCustomizeCellLayout.java index a2acb6459..3c8bda9db 100644 --- a/src/com/android/launcher3/AppsCustomizeCellLayout.java +++ b/src/com/android/launcher3/AppsCustomizeCellLayout.java @@ -17,12 +17,7 @@ package com.android.launcher3; import android.content.Context; -import android.content.res.Resources; -import android.util.AttributeSet; -import android.view.MotionEvent; import android.view.View; -import android.view.ViewDebug; -import android.view.ViewGroup; public class AppsCustomizeCellLayout extends CellLayout implements Page { public AppsCustomizeCellLayout(Context context) { diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java index 0d5d4fc43..ee33f3a3f 100644 --- a/src/com/android/launcher3/AppsCustomizePagedView.java +++ b/src/com/android/launcher3/AppsCustomizePagedView.java @@ -25,7 +25,6 @@ import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; -import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; diff --git a/src/com/android/launcher3/InstallShortcutReceiver.java b/src/com/android/launcher3/InstallShortcutReceiver.java index 3ab3a68ba..b31f45d57 100644 --- a/src/com/android/launcher3/InstallShortcutReceiver.java +++ b/src/com/android/launcher3/InstallShortcutReceiver.java @@ -225,11 +225,11 @@ public class InstallShortcutReceiver extends BroadcastReceiver { String duplicateName = ""; while (iter.hasNext()) { final PendingInstallShortcutInfo pendingInfo = iter.next(); - final Intent data = pendingInfo.data; + //final Intent data = pendingInfo.data; final Intent intent = pendingInfo.launchIntent; final String name = pendingInfo.name; final boolean exists = LauncherModel.shortcutExists(context, name, intent); - final boolean allowDuplicate = data.getBooleanExtra(Launcher.EXTRA_SHORTCUT_DUPLICATE, true); + //final boolean allowDuplicate = data.getBooleanExtra(Launcher.EXTRA_SHORTCUT_DUPLICATE, true); // TODO-XXX: Disable duplicates for now if (!exists /* && allowDuplicate */) { diff --git a/src/com/android/launcher3/LauncherAppWidgetHostView.java b/src/com/android/launcher3/LauncherAppWidgetHostView.java index 90587f9c5..59bd307f2 100644 --- a/src/com/android/launcher3/LauncherAppWidgetHostView.java +++ b/src/com/android/launcher3/LauncherAppWidgetHostView.java @@ -18,15 +18,12 @@ package com.android.launcher3; import android.appwidget.AppWidgetHostView; import android.content.Context; -import android.graphics.Canvas; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.RemoteViews; -import com.android.launcher3.R; - /** * {@inheritDoc} */ diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 9081e23b2..a76378ebf 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -2835,7 +2835,6 @@ public class LauncherModel extends BroadcastReceiver { } private ArrayList getItemInfoForPackageName(final String pn) { - HashSet infos = new HashSet(); ItemInfoFilter filter = new ItemInfoFilter() { @Override public boolean filterItem(ItemInfo parent, ItemInfo info, ComponentName cn) { @@ -2846,7 +2845,6 @@ public class LauncherModel extends BroadcastReceiver { } private ArrayList getItemInfoForComponentName(final ComponentName cname) { - HashSet infos = new HashSet(); ItemInfoFilter filter = new ItemInfoFilter() { @Override public boolean filterItem(ItemInfo parent, ItemInfo info, ComponentName cn) { diff --git a/src/com/android/launcher3/PageIndicator.java b/src/com/android/launcher3/PageIndicator.java index 110d6d9c3..a9016d5ea 100644 --- a/src/com/android/launcher3/PageIndicator.java +++ b/src/com/android/launcher3/PageIndicator.java @@ -49,12 +49,6 @@ public class PageIndicator extends LinearLayout { new ArrayList(); private int mActiveMarkerIndex; - private TimeInterpolator mAlphaInterpolator = new TimeInterpolator() { - public float getInterpolation(float t) { - return t; - } - }; - public PageIndicator(Context context) { this(context, null); } diff --git a/src/com/android/launcher3/PagedViewCellLayout.java b/src/com/android/launcher3/PagedViewCellLayout.java index 75d3aeef8..2d9e10b9d 100644 --- a/src/com/android/launcher3/PagedViewCellLayout.java +++ b/src/com/android/launcher3/PagedViewCellLayout.java @@ -17,7 +17,6 @@ package com.android.launcher3; import android.content.Context; -import android.content.res.Resources; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; @@ -60,7 +59,6 @@ public class PagedViewCellLayout extends ViewGroup implements Page { // setup default cell parameters LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); - Resources resources = context.getResources(); mOriginalCellWidth = mCellWidth = grid.cellWidthPx; mOriginalCellHeight = mCellHeight = grid.cellHeightPx; mCellCountX = (int) grid.numColumns; diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java index 6c3360126..5ce557192 100644 --- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java +++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java @@ -161,9 +161,6 @@ public class ShortcutAndWidgetContainer extends ViewGroup { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { - LauncherAppState app = LauncherAppState.getInstance(); - DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); - int count = getChildCount(); for (int i = 0; i < count; i++) { final View child = getChildAt(i); diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 90db5ab85..4a8a237d6 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -44,7 +44,6 @@ import java.util.ArrayList; * Various utilities shared amongst the Launcher's classes. */ final class Utilities { - @SuppressWarnings("unused") private static final String TAG = "Launcher.Utilities"; private static int sIconWidth = -1; @@ -215,8 +214,6 @@ final class Utilities { int count = ancestorChain.size(); for (int i = 0; i < count; i++) { View v0 = ancestorChain.get(i); - View v1 = i < count -1 ? ancestorChain.get(i + 1) : null; - // For TextViews, scroll has a meaning which relates to the text position // which is very strange... ignore the scroll. if (v0 != descendant || includeRootScroll) { diff --git a/src/com/android/launcher3/WallpaperPickerActivity.java b/src/com/android/launcher3/WallpaperPickerActivity.java index 674c597d7..6c093471a 100644 --- a/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/src/com/android/launcher3/WallpaperPickerActivity.java @@ -31,7 +31,6 @@ import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.graphics.drawable.LevelListDrawable; import android.net.Uri; -import android.os.Bundle; import android.util.Log; import android.util.Pair; import android.view.LayoutInflater; @@ -41,7 +40,6 @@ import android.view.SubMenu; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.view.WindowManager; import android.view.animation.DecelerateInterpolator; import android.widget.BaseAdapter; import android.widget.FrameLayout; @@ -67,7 +65,6 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { private Resources mWallpaperResources; private View mSelectedThumb; - private CropView mCropView; private boolean mIgnoreNextTap; private OnClickListener mThumbnailOnClickListener; -- cgit v1.2.3