summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-08-27 15:42:35 +0200
committerMichael Jurka <mikejurka@google.com>2013-08-28 15:06:31 +0200
commit414300a79d140f8c2c8760d9adab750f69ffeafd (patch)
treed2fabfc1e29d66d23ba273f768504819895f48a2 /src
parent9e6a0a20d40675ef98c7fdb8892cf34b90152f7a (diff)
downloadandroid_packages_apps_Trebuchet-414300a79d140f8c2c8760d9adab750f69ffeafd.tar.gz
android_packages_apps_Trebuchet-414300a79d140f8c2c8760d9adab750f69ffeafd.tar.bz2
android_packages_apps_Trebuchet-414300a79d140f8c2c8760d9adab750f69ffeafd.zip
Clean up unused code
Change-Id: Ie1e927aa0b5304f62cfffaab449abb3133870f80
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/AppWidgetResizeFrame.java2
-rw-r--r--src/com/android/launcher3/AppsCustomizePagedView.java3
-rw-r--r--src/com/android/launcher3/CellLayout.java2
-rw-r--r--src/com/android/launcher3/DynamicGrid.java1
-rw-r--r--src/com/android/launcher3/Folder.java8
-rw-r--r--src/com/android/launcher3/HolographicImageView.java2
-rw-r--r--src/com/android/launcher3/HolographicLinearLayout.java2
-rw-r--r--src/com/android/launcher3/Hotseat.java10
-rw-r--r--src/com/android/launcher3/InstallWidgetReceiver.java7
-rw-r--r--src/com/android/launcher3/LauncherAppState.java3
-rw-r--r--src/com/android/launcher3/LauncherModel.java17
-rw-r--r--src/com/android/launcher3/MemoryTracker.java1
-rw-r--r--src/com/android/launcher3/UninstallShortcutReceiver.java3
-rw-r--r--src/com/android/launcher3/UserInitializeReceiver.java7
14 files changed, 9 insertions, 59 deletions
diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java
index 346c0c39f..02958d060 100644
--- a/src/com/android/launcher3/AppWidgetResizeFrame.java
+++ b/src/com/android/launcher3/AppWidgetResizeFrame.java
@@ -19,7 +19,6 @@ public class AppWidgetResizeFrame extends FrameLayout {
private LauncherAppWidgetHostView mWidgetView;
private CellLayout mCellLayout;
private DragLayer mDragLayer;
- private Workspace mWorkspace;
private ImageView mLeftHandle;
private ImageView mRightHandle;
private ImageView mTopHandle;
@@ -83,7 +82,6 @@ public class AppWidgetResizeFrame extends FrameLayout {
mWidgetView = widgetView;
mResizeMode = widgetView.getAppWidgetInfo().resizeMode;
mDragLayer = dragLayer;
- mWorkspace = (Workspace) dragLayer.findViewById(R.id.workspace);
final AppWidgetProviderInfo info = widgetView.getAppWidgetInfo();
int[] result = Launcher.getMinSpanForWidget(mLauncher, info);
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index 899b1f224..09a57120a 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -355,9 +355,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mWidgetPreviewLoader = new WidgetPreviewLoader(mLauncher);
}
- // Note that we transpose the counts in portrait so that we get a similar layout
- boolean isLandscape = getResources().getConfiguration().orientation ==
- Configuration.ORIENTATION_LANDSCAPE;
int maxCellCountX = Integer.MAX_VALUE;
int maxCellCountY = Integer.MAX_VALUE;
if (mMaxAppCellCountX > -1) {
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 3c4180464..0a0452daf 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -622,8 +622,6 @@ public class CellLayout extends ViewGroup {
// Hotseat icons - remove text
if (child instanceof BubbleTextView) {
BubbleTextView bubbleChild = (BubbleTextView) child;
-
- Resources res = getResources();
bubbleChild.setTextVisibility(!mIsHotseat);
}
diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java
index 0a56117ed..3fbb40c6b 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -205,7 +205,6 @@ class DeviceProfile {
void updateFromConfiguration(Resources resources, int wPx, int hPx,
int awPx, int ahPx) {
- DisplayMetrics dm = resources.getDisplayMetrics();
isLandscape = (resources.getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE);
isTablet = resources.getBoolean(R.bool.is_tablet);
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 3aa91333c..f57ff07a9 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -85,8 +85,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
private FolderIcon mFolderIcon;
private int mMaxCountX;
private int mMaxCountY;
- private int mMaxVisibleX;
- private int mMaxVisibleY;
private int mMaxNumItems;
private ArrayList<View> mItemsInReadingOrder = new ArrayList<View>();
private Drawable mIconDrawable;
@@ -145,8 +143,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mIconCache = app.getIconCache();
Resources res = getResources();
- mMaxCountX = mMaxVisibleX = (int) grid.numColumns;
- mMaxVisibleY = (int) grid.numRows;
+ mMaxCountX = (int) grid.numColumns;
mMaxCountY = mMaxNumItems = Integer.MAX_VALUE;
mInputMethodManager = (InputMethodManager)
@@ -175,9 +172,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- Rect padding = grid.getWorkspacePadding(grid.isLandscape ?
- CellLayout.LANDSCAPE : CellLayout.PORTRAIT);
- DisplayMetrics dm = getResources().getDisplayMetrics();
mContent.setCellDimensions(grid.folderCellWidthPx, grid.folderCellHeightPx);
mContent.setGridSize(0, 0);
diff --git a/src/com/android/launcher3/HolographicImageView.java b/src/com/android/launcher3/HolographicImageView.java
index ce50db104..18ac092e6 100644
--- a/src/com/android/launcher3/HolographicImageView.java
+++ b/src/com/android/launcher3/HolographicImageView.java
@@ -24,8 +24,6 @@ import android.graphics.drawable.StateListDrawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
-import android.view.View.OnFocusChangeListener;
-import android.view.View.OnTouchListener;
import android.widget.ImageView;
public class HolographicImageView extends ImageView {
diff --git a/src/com/android/launcher3/HolographicLinearLayout.java b/src/com/android/launcher3/HolographicLinearLayout.java
index cdf43812a..5344a7ee9 100644
--- a/src/com/android/launcher3/HolographicLinearLayout.java
+++ b/src/com/android/launcher3/HolographicLinearLayout.java
@@ -24,8 +24,6 @@ import android.graphics.drawable.StateListDrawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
-import android.view.View.OnFocusChangeListener;
-import android.view.View.OnTouchListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index d28e96f2d..2d3adf64d 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -18,23 +18,16 @@ package com.android.launcher3;
import android.content.ComponentName;
import android.content.Context;
-import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.content.res.TypedArray;
import android.util.AttributeSet;
-import android.view.LayoutInflater;
import android.util.Log;
-import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
-import com.android.launcher3.R;
-
import java.util.ArrayList;
public class Hotseat extends FrameLayout {
- @SuppressWarnings("unused")
private static final String TAG = "Hotseat";
private CellLayout mContent;
@@ -55,8 +48,6 @@ public class Hotseat extends FrameLayout {
public Hotseat(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- TypedArray a = context.obtainStyledAttributes(attrs,
- R.styleable.Hotseat, defStyle, 0);
Resources r = context.getResources();
mTransposeLayoutWithOrientation =
r.getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
@@ -155,7 +146,6 @@ public class Hotseat extends FrameLayout {
FolderInfo info = fi.getFolderInfo();
for (ApplicationInfo a: apps) {
- ComponentName cn = a.intent.getComponent();
ShortcutInfo si = a.makeShortcut();
info.add(si);
}
diff --git a/src/com/android/launcher3/InstallWidgetReceiver.java b/src/com/android/launcher3/InstallWidgetReceiver.java
index d802df279..0ef478074 100644
--- a/src/com/android/launcher3/InstallWidgetReceiver.java
+++ b/src/com/android/launcher3/InstallWidgetReceiver.java
@@ -77,18 +77,15 @@ public class InstallWidgetReceiver {
private String mMimeType;
private ClipData mClipData;
private List<WidgetMimeTypeHandlerData> mActivities;
- private CellLayout mTargetLayout;
private int mTargetLayoutScreen;
private int[] mTargetLayoutPos;
public WidgetListAdapter(Launcher l, String mimeType, ClipData data,
- List<WidgetMimeTypeHandlerData> list, CellLayout target,
- int targetScreen, int[] targetPos) {
+ List<WidgetMimeTypeHandlerData> list, int targetScreen, int[] targetPos) {
mLauncher = l;
mMimeType = mimeType;
mClipData = data;
mActivities = list;
- mTargetLayout = target;
mTargetLayoutScreen = targetScreen;
mTargetLayoutPos = targetPos;
}
@@ -149,7 +146,7 @@ public class InstallWidgetReceiver {
// Set the text
final CharSequence component = resolveInfo.loadLabel(packageManager);
final int[] widgetSpan = new int[2];
- mTargetLayout.rectToCell(widgetInfo.minWidth, widgetInfo.minHeight, widgetSpan);
+ CellLayout.rectToCell(widgetInfo.minWidth, widgetInfo.minHeight, widgetSpan);
TextView t = (TextView) convertView.findViewById(R.id.provider);
t.setText(context.getString(R.string.external_drop_widget_pick_format,
component, widgetSpan[0], widgetSpan[1]));
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index c8b208b28..ed96310ac 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -42,7 +42,6 @@ public class LauncherAppState {
private static WeakReference<LauncherProvider> sLauncherProvider;
private static Context sContext;
- private static Object mLock = new Object();
private static LauncherAppState INSTANCE;
private DynamicGrid mDynamicGrid;
@@ -167,12 +166,10 @@ public class LauncherAppState {
DeviceProfile initDynamicGrid(Context context, int minWidth, int minHeight,
int width, int height,
int availableWidth, int availableHeight) {
- boolean created = false;
if (mDynamicGrid == null) {
mDynamicGrid = new DynamicGrid(context.getResources(),
minWidth, minHeight, width, height,
availableWidth, availableHeight);
- created = true;
}
// Update the icon size
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index c1754b437..c76b55332 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -318,8 +318,7 @@ public class LauncherModel extends BroadcastReceiver {
Pair<Long, int[]> coords = LauncherModel.findNextAvailableIconSpace(context,
name, launchIntent, startSearchPageIndex, workspaceScreens);
if (coords == null) {
- LauncherAppState appState = LauncherAppState.getInstance();
- LauncherProvider lp = appState.getLauncherProvider();
+ LauncherProvider lp = LauncherAppState.getLauncherProvider();
// If we can't find a valid position, then just add a new screen.
// This takes time so we need to re-queue the add until the new
@@ -864,8 +863,7 @@ public class LauncherModel extends BroadcastReceiver {
final ContentResolver cr = context.getContentResolver();
item.onAddToDatabase(values);
- LauncherAppState app = LauncherAppState.getInstance();
- item.id = app.getLauncherProvider().generateNewItemId();
+ item.id = LauncherAppState.getLauncherProvider().generateNewItemId();
values.put(LauncherSettings.Favorites._ID, item.id);
item.updateValuesWithCoordinates(values, item.cellX, item.cellY);
@@ -1427,7 +1425,6 @@ public class LauncherModel extends BroadcastReceiver {
// Optimize for end-user experience: if the Launcher is up and // running with the
// All Apps interface in the foreground, load All Apps first. Otherwise, load the
// workspace first (default).
- final Callbacks cbk = mCallbacks.get();
keep_running: {
// Elevate priority when Home launches for the first time to avoid
// starving at boot time. Staring at a blank home is not cool.
@@ -1636,10 +1633,10 @@ public class LauncherModel extends BroadcastReceiver {
int countY = (int) grid.numRows;
// Make sure the default workspace is loaded, if needed
- mApp.getLauncherProvider().loadDefaultFavoritesIfNecessary(0);
+ LauncherAppState.getLauncherProvider().loadDefaultFavoritesIfNecessary(0);
// Check if we need to do any upgrade-path logic
- boolean loadedOldDb = mApp.getLauncherProvider().justLoadedOldDb();
+ boolean loadedOldDb = LauncherAppState.getLauncherProvider().justLoadedOldDb();
synchronized (sBgLock) {
sBgWorkspaceItems.clear();
@@ -1812,7 +1809,6 @@ public class LauncherModel extends BroadcastReceiver {
// Skip loading items that are out of bounds
if (container == LauncherSettings.Favorites.CONTAINER_DESKTOP) {
- int iconSpan = 1;
if (checkItemDimensions(folderInfo)) {
Log.d(TAG, "Skipped loading out of bounds folder");
continue;
@@ -1938,7 +1934,7 @@ public class LauncherModel extends BroadcastReceiver {
Log.w(TAG, "10249126\t- " + l);
}
- mApp.getLauncherProvider().updateMaxScreenId(maxScreenId);
+ LauncherAppState.getLauncherProvider().updateMaxScreenId(maxScreenId);
updateWorkspaceScreenOrder(context, sBgWorkspaceScreens);
// Update the max item id after we load an old db
@@ -1947,7 +1943,7 @@ public class LauncherModel extends BroadcastReceiver {
for (ItemInfo item: sBgItemsIdMap.values()) {
maxItemId = Math.max(maxItemId, item.id);
}
- app.getLauncherProvider().updateMaxItemId(maxItemId);
+ LauncherAppState.getLauncherProvider().updateMaxItemId(maxItemId);
} else {
Log.w(TAG, "10249126 - loadWorkspace - !loadedOldDb");
TreeMap<Integer, Long> orderedScreens = loadWorkspaceScreensDb(mContext);
@@ -2422,7 +2418,6 @@ public class LauncherModel extends BroadcastReceiver {
}
// Create the ApplicationInfos
- final long addTime = DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;
for (int i = 0; i < apps.size(); i++) {
// This builds the icon bitmaps.
mBgAllAppsList.add(new ApplicationInfo(packageManager, apps.get(i),
diff --git a/src/com/android/launcher3/MemoryTracker.java b/src/com/android/launcher3/MemoryTracker.java
index 0a796a261..2d37c809e 100644
--- a/src/com/android/launcher3/MemoryTracker.java
+++ b/src/com/android/launcher3/MemoryTracker.java
@@ -20,7 +20,6 @@ import android.app.ActivityManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
-import android.net.Uri;
import android.os.*;
import android.util.Log;
import android.util.LongSparseArray;
diff --git a/src/com/android/launcher3/UninstallShortcutReceiver.java b/src/com/android/launcher3/UninstallShortcutReceiver.java
index 2e1ed6967..d92963abe 100644
--- a/src/com/android/launcher3/UninstallShortcutReceiver.java
+++ b/src/com/android/launcher3/UninstallShortcutReceiver.java
@@ -20,16 +20,13 @@ import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
-import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
import android.widget.Toast;
import java.net.URISyntaxException;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.Iterator;
-import java.util.Set;
public class UninstallShortcutReceiver extends BroadcastReceiver {
private static final String ACTION_UNINSTALL_SHORTCUT =
diff --git a/src/com/android/launcher3/UserInitializeReceiver.java b/src/com/android/launcher3/UserInitializeReceiver.java
index 9ccefe492..d8e17b12f 100644
--- a/src/com/android/launcher3/UserInitializeReceiver.java
+++ b/src/com/android/launcher3/UserInitializeReceiver.java
@@ -16,16 +16,9 @@
package com.android.launcher3;
-import java.io.IOException;
-import java.util.ArrayList;
-
-import com.android.launcher3.R;
-
-import android.app.WallpaperManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import android.content.res.Resources;
/**
* Takes care of setting initial wallpaper for a user, by selecting the