Code sanitization

- Removed bad method/class name typos

Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
This commit is contained in:
Hyunyoung Song 2016-10-05 16:27:48 -07:00
parent cc257380fe
commit 0de011705b
26 changed files with 65 additions and 86 deletions

View File

@ -1054,11 +1054,11 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
final int oldDragCellX = mDragCell[0]; final int oldDragCellX = mDragCell[0];
final int oldDragCellY = mDragCell[1]; final int oldDragCellY = mDragCell[1];
if (outlineProvider == null || outlineProvider.gerenatedDragOutline == null) { if (outlineProvider == null || outlineProvider.generatedDragOutline == null) {
return; return;
} }
Bitmap dragOutline = outlineProvider.gerenatedDragOutline; Bitmap dragOutline = outlineProvider.generatedDragOutline;
if (cellX != oldDragCellX || cellY != oldDragCellY) { if (cellX != oldDragCellX || cellY != oldDragCellY) {
Point dragOffset = dragObject.dragView.getDragVisualizeOffset(); Point dragOffset = dragObject.dragView.getDragVisualizeOffset();
Rect dragRegion = dragObject.dragView.getDragRegion(); Rect dragRegion = dragObject.dragView.getDragRegion();

View File

@ -107,17 +107,6 @@ public interface DropTarget {
/** /**
* Handle an object being dropped on the DropTarget * Handle an object being dropped on the DropTarget
*
* @param source DragSource where the drag started
* @param x X coordinate of the drop location
* @param y Y coordinate of the drop location
* @param xOffset Horizontal offset with the object being dragged where the original
* touch happened
* @param yOffset Vertical offset with the object being dragged where the original
* touch happened
* @param dragView The DragView that's being dragged around on screen.
* @param dragInfo Data associated with the object being dragged
*
*/ */
void onDrop(DragObject dragObject); void onDrop(DragObject dragObject);
@ -137,16 +126,6 @@ public interface DropTarget {
/** /**
* Check if a drop action can occur at, or near, the requested location. * Check if a drop action can occur at, or near, the requested location.
* This will be called just before onDrop. * This will be called just before onDrop.
*
* @param source DragSource where the drag started
* @param x X coordinate of the drop location
* @param y Y coordinate of the drop location
* @param xOffset Horizontal offset with the object being dragged where the
* original touch happened
* @param yOffset Vertical offset with the object being dragged where the
* original touch happened
* @param dragView The DragView that's being dragged around on screen.
* @param dragInfo Data associated with the object being dragged
* @return True if the drop will be accepted, false otherwise. * @return True if the drop will be accepted, false otherwise.
*/ */
boolean acceptDrop(DragObject dragObject); boolean acceptDrop(DragObject dragObject);

View File

@ -363,7 +363,7 @@ public class IconCache {
} }
/** /**
* Updates {@param values} to contain versoning information and adds it to the DB. * Updates {@param values} to contain versioning information and adds it to the DB.
* @param values {@link ContentValues} containing icon & title * @param values {@link ContentValues} containing icon & title
*/ */
private void addIconToDB(ContentValues values, ComponentName key, private void addIconToDB(ContentValues values, ComponentName key,

View File

@ -59,7 +59,7 @@ public class ItemInfo {
public long container = NO_ID; public long container = NO_ID;
/** /**
* Iindicates the screen in which the shortcut appears. * Indicates the screen in which the shortcut appears.
*/ */
public long screenId = -1; public long screenId = -1;

View File

@ -1340,7 +1340,7 @@ public class Launcher extends Activity
} }
// Setup the drag controller (drop targets have to be added in reverse order in priority) // Setup the drag controller (drop targets have to be added in reverse order in priority)
mDragController.setDragScoller(mWorkspace); mDragController.setDragScroller(mWorkspace);
mDragController.setScrollView(mDragLayer); mDragController.setScrollView(mDragLayer);
mDragController.setMoveTarget(mWorkspace); mDragController.setMoveTarget(mWorkspace);
mDragController.addDropTarget(mWorkspace); mDragController.addDropTarget(mWorkspace);
@ -2516,7 +2516,7 @@ public class Launcher extends Activity
* on the home screen. * on the home screen.
*/ */
public void onClickWallpaperPicker(View v) { public void onClickWallpaperPicker(View v) {
if (!Utilities.isWallapaperAllowed(this)) { if (!Utilities.isWallpaperAllowed(this)) {
Toast.makeText(this, R.string.msg_disabled_by_admin, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.msg_disabled_by_admin, Toast.LENGTH_SHORT).show();
return; return;
} }
@ -3693,7 +3693,7 @@ public class Launcher extends Activity
if (DEBUG_WIDGETS) { if (DEBUG_WIDGETS) {
Log.d(TAG, "Removing restored widget: id=" + item.appWidgetId Log.d(TAG, "Removing restored widget: id=" + item.appWidgetId
+ " belongs to component " + item.providerName + " belongs to component " + item.providerName
+ ", as the povider is null"); + ", as the provider is null");
} }
LauncherModel.deleteItemFromDatabase(this, item); LauncherModel.deleteItemFromDatabase(this, item);
return; return;

View File

@ -86,10 +86,10 @@ public class LauncherAppState {
private LauncherAppState() { private LauncherAppState() {
if (sContext == null) { if (sContext == null) {
throw new IllegalStateException("LauncherAppState inited before app context set"); throw new IllegalStateException("LauncherAppState initiated before app context set");
} }
Log.v(Launcher.TAG, "LauncherAppState inited"); Log.v(Launcher.TAG, "LauncherAppState initiated");
if (TestingUtils.MEMORY_DUMP_ENABLED) { if (TestingUtils.MEMORY_DUMP_ENABLED) {
TestingUtils.startTrackingMemory(sContext); TestingUtils.startTrackingMemory(sContext);

View File

@ -1082,7 +1082,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
canvas.translate(display.left, display.top); canvas.translate(display.left, display.top);
canvas.rotate(270); canvas.rotate(270);
getEdgeVerticalPostion(sTmpIntPoint); getEdgeVerticalPosition(sTmpIntPoint);
canvas.translate(display.top - sTmpIntPoint[1], 0); canvas.translate(display.top - sTmpIntPoint[1], 0);
mEdgeGlowLeft.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], display.width()); mEdgeGlowLeft.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], display.width());
if (mEdgeGlowLeft.draw(canvas)) { if (mEdgeGlowLeft.draw(canvas)) {
@ -1096,7 +1096,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
canvas.translate(display.left + mPageScrolls[mIsRtl ? 0 : (getPageCount() - 1)], display.top); canvas.translate(display.left + mPageScrolls[mIsRtl ? 0 : (getPageCount() - 1)], display.top);
canvas.rotate(90); canvas.rotate(90);
getEdgeVerticalPostion(sTmpIntPoint); getEdgeVerticalPosition(sTmpIntPoint);
canvas.translate(sTmpIntPoint[0] - display.top, -display.width()); canvas.translate(sTmpIntPoint[0] - display.top, -display.width());
mEdgeGlowRight.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], display.width()); mEdgeGlowRight.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], display.width());
@ -1111,7 +1111,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
/** /**
* Returns the top and bottom position for the edge effect. * Returns the top and bottom position for the edge effect.
*/ */
protected abstract void getEdgeVerticalPostion(int[] pos); protected abstract void getEdgeVerticalPosition(int[] pos);
@Override @Override
public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) { public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) {

View File

@ -20,7 +20,7 @@ import android.content.ComponentName;
/** /**
* Meta data that is used for deferred binding. * Meta data that is used for deferred binding.
* e.g., this object is used to pass information on dragable targets when they are dropped onto * e.g., this object is used to pass information on draggable targets when they are dropped onto
* the workspace from another container. * the workspace from another container.
*/ */
public class PendingAddItemInfo extends ItemInfo { public class PendingAddItemInfo extends ItemInfo {

View File

@ -18,7 +18,7 @@ public class PreloadIconDrawable extends Drawable {
private static final float ANIMATION_PROGRESS_STARTED = 0f; private static final float ANIMATION_PROGRESS_STARTED = 0f;
private static final float ANIMATION_PROGRESS_COMPLETED = 1.0f; private static final float ANIMATION_PROGRESS_COMPLETED = 1.0f;
private static final float MIN_SATUNATION = 0.2f; private static final float MIN_SATURATION = 0.2f;
private static final float MIN_LIGHTNESS = 0.6f; private static final float MIN_LIGHTNESS = 0.6f;
private static final float ICON_SCALE_FACTOR = 0.5f; private static final float ICON_SCALE_FACTOR = 0.5f;
@ -242,7 +242,7 @@ public class PreloadIconDrawable extends Drawable {
// Make sure that the dominant color has enough saturation to be visible properly. // Make sure that the dominant color has enough saturation to be visible properly.
float[] hsv = new float[3]; float[] hsv = new float[3];
Color.colorToHSV(mIndicatorColor, hsv); Color.colorToHSV(mIndicatorColor, hsv);
if (hsv[1] < MIN_SATUNATION) { if (hsv[1] < MIN_SATURATION) {
mIndicatorColor = DEFAULT_COLOR; mIndicatorColor = DEFAULT_COLOR;
return mIndicatorColor; return mIndicatorColor;
} }

View File

@ -618,7 +618,7 @@ public final class Utilities {
return ATLEAST_LOLLIPOP && powerManager.isPowerSaveMode(); return ATLEAST_LOLLIPOP && powerManager.isPowerSaveMode();
} }
public static boolean isWallapaperAllowed(Context context) { public static boolean isWallpaperAllowed(Context context) {
if (isNycOrAbove()) { if (isNycOrAbove()) {
try { try {
WallpaperManager wm = context.getSystemService(WallpaperManager.class); WallpaperManager wm = context.getSystemService(WallpaperManager.class);

View File

@ -56,7 +56,7 @@ import android.widget.TextView;
import com.android.launcher3.Launcher.CustomContentCallbacks; import com.android.launcher3.Launcher.CustomContentCallbacks;
import com.android.launcher3.Launcher.LauncherOverlay; import com.android.launcher3.Launcher.LauncherOverlay;
import com.android.launcher3.UninstallDropTarget.DropTargetSource; import com.android.launcher3.UninstallDropTarget.DropTargetSource;
import com.android.launcher3.accessibility.AccessibileDragListenerAdapter; import com.android.launcher3.accessibility.AccessibleDragListenerAdapter;
import com.android.launcher3.accessibility.OverviewAccessibilityDelegate; import com.android.launcher3.accessibility.OverviewAccessibilityDelegate;
import com.android.launcher3.accessibility.OverviewScreenAccessibilityDelegate; import com.android.launcher3.accessibility.OverviewScreenAccessibilityDelegate;
import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper; import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper;
@ -303,7 +303,7 @@ public class Workspace extends PagedView
LauncherOverlay mLauncherOverlay; LauncherOverlay mLauncherOverlay;
boolean mScrollInteractionBegan; boolean mScrollInteractionBegan;
boolean mStartedSendingScrollEvents; boolean mStartedSendingScrollEvents;
float mLastOverlaySroll = 0; float mLastOverlayScroll = 0;
// Total over scrollX in the overlay direction. // Total over scrollX in the overlay direction.
private int mUnboundedScrollX; private int mUnboundedScrollX;
private boolean mForceDrawAdjacentPages = false; private boolean mForceDrawAdjacentPages = false;
@ -407,7 +407,7 @@ public class Workspace extends PagedView
@Override @Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) {
if (ENFORCE_DRAG_EVENT_ORDER) { if (ENFORCE_DRAG_EVENT_ORDER) {
enfoceDragParity("onDragStart", 0, 0); enforceDragParity("onDragStart", 0, 0);
} }
if (mOutlineProvider != null) { if (mOutlineProvider != null) {
@ -464,7 +464,7 @@ public class Workspace extends PagedView
@Override @Override
public void onDragEnd() { public void onDragEnd() {
if (ENFORCE_DRAG_EVENT_ORDER) { if (ENFORCE_DRAG_EVENT_ORDER) {
enfoceDragParity("onDragEnd", 0, 0); enforceDragParity("onDragEnd", 0, 0);
} }
if (!mDeferRemoveExtraEmptyScreen) { if (!mDeferRemoveExtraEmptyScreen) {
@ -582,7 +582,7 @@ public class Workspace extends PagedView
/** /**
* Initializes and binds the first page * Initializes and binds the first page
* @param qsb an exisitng qsb to recycle or null. * @param qsb an existing qsb to recycle or null.
*/ */
public void bindAndInitFirstWorkspaceScreen(View qsb) { public void bindAndInitFirstWorkspaceScreen(View qsb) {
if (!FeatureFlags.QSB_ON_FIRST_SCREEN) { if (!FeatureFlags.QSB_ON_FIRST_SCREEN) {
@ -1462,7 +1462,7 @@ public class Workspace extends PagedView
boolean shouldScrollOverlay = mLauncherOverlay != null && boolean shouldScrollOverlay = mLauncherOverlay != null &&
((amount <= 0 && !mIsRtl) || (amount >= 0 && mIsRtl)); ((amount <= 0 && !mIsRtl) || (amount >= 0 && mIsRtl));
boolean shouldZeroOverlay = mLauncherOverlay != null && mLastOverlaySroll != 0 && boolean shouldZeroOverlay = mLauncherOverlay != null && mLastOverlayScroll != 0 &&
((amount >= 0 && !mIsRtl) || (amount <= 0 && mIsRtl)); ((amount >= 0 && !mIsRtl) || (amount <= 0 && mIsRtl));
if (shouldScrollOverlay) { if (shouldScrollOverlay) {
@ -1471,8 +1471,8 @@ public class Workspace extends PagedView
mLauncherOverlay.onScrollInteractionBegin(); mLauncherOverlay.onScrollInteractionBegin();
} }
mLastOverlaySroll = Math.abs(amount / getViewportWidth()); mLastOverlayScroll = Math.abs(amount / getViewportWidth());
mLauncherOverlay.onScrollChange(mLastOverlaySroll, mIsRtl); mLauncherOverlay.onScrollChange(mLastOverlayScroll, mIsRtl);
} else if (shouldOverScroll) { } else if (shouldOverScroll) {
dampedOverScroll(amount); dampedOverScroll(amount);
} }
@ -1616,7 +1616,7 @@ public class Workspace extends PagedView
} }
@Override @Override
protected void getEdgeVerticalPostion(int[] pos) { protected void getEdgeVerticalPosition(int[] pos) {
View child = getChildAt(getPageCount() - 1); View child = getChildAt(getPageCount() - 1);
pos[0] = child.getTop(); pos[0] = child.getTop();
pos[1] = child.getBottom(); pos[1] = child.getBottom();
@ -2266,7 +2266,7 @@ public class Workspace extends PagedView
layout.prepareChildForDrag(child); layout.prepareChildForDrag(child);
if (options.isAccessibleDrag) { if (options.isAccessibleDrag) {
mDragController.addDragListener(new AccessibileDragListenerAdapter( mDragController.addDragListener(new AccessibleDragListenerAdapter(
this, CellLayout.WORKSPACE_ACCESSIBILITY_DRAG) { this, CellLayout.WORKSPACE_ACCESSIBILITY_DRAG) {
@Override @Override
protected void enableAccessibleDrag(boolean enable) { protected void enableAccessibleDrag(boolean enable) {
@ -2788,7 +2788,7 @@ public class Workspace extends PagedView
@Override @Override
public void onDragEnter(DragObject d) { public void onDragEnter(DragObject d) {
if (ENFORCE_DRAG_EVENT_ORDER) { if (ENFORCE_DRAG_EVENT_ORDER) {
enfoceDragParity("onDragEnter", 1, 1); enforceDragParity("onDragEnter", 1, 1);
} }
mCreateUserFolderOnDrop = false; mCreateUserFolderOnDrop = false;
@ -2805,7 +2805,7 @@ public class Workspace extends PagedView
@Override @Override
public void onDragExit(DragObject d) { public void onDragExit(DragObject d) {
if (ENFORCE_DRAG_EVENT_ORDER) { if (ENFORCE_DRAG_EVENT_ORDER) {
enfoceDragParity("onDragExit", -1, 0); enforceDragParity("onDragExit", -1, 0);
} }
// Here we store the final page that will be dropped to, if the workspace in fact // Here we store the final page that will be dropped to, if the workspace in fact
@ -2838,14 +2838,14 @@ public class Workspace extends PagedView
mLauncher.getDragLayer().hidePageHints(); mLauncher.getDragLayer().hidePageHints();
} }
private void enfoceDragParity(String event, int update, int expectedValue) { private void enforceDragParity(String event, int update, int expectedValue) {
enfoceDragParity(this, event, update, expectedValue); enforceDragParity(this, event, update, expectedValue);
for (int i = 0; i < getChildCount(); i++) { for (int i = 0; i < getChildCount(); i++) {
enfoceDragParity(getChildAt(i), event, update, expectedValue); enforceDragParity(getChildAt(i), event, update, expectedValue);
} }
} }
private void enfoceDragParity(View v, String event, int update, int expectedValue) { private void enforceDragParity(View v, String event, int update, int expectedValue) {
Object tag = v.getTag(R.id.drag_event_parity); Object tag = v.getTag(R.id.drag_event_parity);
int value = tag == null ? 0 : (Integer) tag; int value = tag == null ? 0 : (Integer) tag;
value += update; value += update;
@ -2966,7 +2966,7 @@ public class Workspace extends PagedView
mTempXY[0] = (int) xy[0]; mTempXY[0] = (int) xy[0];
mTempXY[1] = (int) xy[1]; mTempXY[1] = (int) xy[1];
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, mTempXY, true); mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, mTempXY, true);
mLauncher.getDragLayer().mapCoordInSelfToDescendent(hotseat.getLayout(), mTempXY); mLauncher.getDragLayer().mapCoordInSelfToDescendant(hotseat.getLayout(), mTempXY);
xy[0] = mTempXY[0]; xy[0] = mTempXY[0];
xy[1] = mTempXY[1]; xy[1] = mTempXY[1];

View File

@ -28,7 +28,7 @@ import com.android.launcher3.dragndrop.DragOptions;
* Utility listener to enable/disable accessibility drag flags for a ViewGroup * Utility listener to enable/disable accessibility drag flags for a ViewGroup
* containing CellLayouts * containing CellLayouts
*/ */
public class AccessibileDragListenerAdapter implements DragListener { public class AccessibleDragListenerAdapter implements DragListener {
private final ViewGroup mViewGroup; private final ViewGroup mViewGroup;
private final int mDragType; private final int mDragType;
@ -38,7 +38,7 @@ public class AccessibileDragListenerAdapter implements DragListener {
* @param dragType either {@link CellLayout#WORKSPACE_ACCESSIBILITY_DRAG} or * @param dragType either {@link CellLayout#WORKSPACE_ACCESSIBILITY_DRAG} or
* {@link CellLayout#FOLDER_ACCESSIBILITY_DRAG} * {@link CellLayout#FOLDER_ACCESSIBILITY_DRAG}
*/ */
public AccessibileDragListenerAdapter(ViewGroup parent, int dragType) { public AccessibleDragListenerAdapter(ViewGroup parent, int dragType) {
mViewGroup = parent; mViewGroup = parent;
mDragType = dragType; mDragType = dragType;
} }

View File

@ -44,7 +44,7 @@ public class OverviewAccessibilityDelegate extends AccessibilityDelegate {
Context context = host.getContext(); Context context = host.getContext();
info.addAction(new AccessibilityAction(OVERVIEW, context.getText(OVERVIEW))); info.addAction(new AccessibilityAction(OVERVIEW, context.getText(OVERVIEW)));
if (Utilities.isWallapaperAllowed(context)) { if (Utilities.isWallpaperAllowed(context)) {
info.addAction(new AccessibilityAction(WALLPAPERS, context.getText(WALLPAPERS))); info.addAction(new AccessibilityAction(WALLPAPERS, context.getText(WALLPAPERS)));
} }
info.addAction(new AccessibilityAction(WIDGETS, context.getText(WIDGETS))); info.addAction(new AccessibilityAction(WIDGETS, context.getText(WIDGETS)));

View File

@ -34,7 +34,7 @@ public class AllAppsFastScrollHelper implements AllAppsGridAdapter.BindViewCallb
private AllAppsRecyclerView mRv; private AllAppsRecyclerView mRv;
private AlphabeticalAppsList mApps; private AlphabeticalAppsList mApps;
// Keeps track of the current and targetted fast scroll section (the section to scroll to after // Keeps track of the current and targeted fast scroll section (the section to scroll to after
// the initial delay) // the initial delay)
int mTargetFastScrollPosition = -1; int mTargetFastScrollPosition = -1;
@Thunk String mCurrentFastScrollSection; @Thunk String mCurrentFastScrollSection;

View File

@ -149,7 +149,7 @@ public class AlphabeticalAppsList {
return item; return item;
} }
public static AdapterItem asSearchDivder(int pos) { public static AdapterItem asSearchDivider(int pos) {
AdapterItem item = new AdapterItem(); AdapterItem item = new AdapterItem();
item.viewType = AllAppsGridAdapter.VIEW_TYPE_SEARCH_DIVIDER; item.viewType = AllAppsGridAdapter.VIEW_TYPE_SEARCH_DIVIDER;
item.position = pos; item.position = pos;
@ -429,7 +429,7 @@ public class AlphabeticalAppsList {
} }
// Add the search divider // Add the search divider
mAdapterItems.add(AdapterItem.asSearchDivder(position++)); mAdapterItems.add(AdapterItem.asSearchDivider(position++));
// Process the predicted app components // Process the predicted app components
mPredictedApps.clear(); mPredictedApps.clear();

View File

@ -230,7 +230,7 @@ public class VerticalPullDetector {
private void reportDragEnd() { private void reportDragEnd() {
if (DBG) { if (DBG) {
Log.d(TAG, String.format("onScrolEnd disp=%.1f, velocity=%.1f", Log.d(TAG, String.format("onScrollEnd disp=%.1f, velocity=%.1f",
mDisplacementY, mVelocity)); mDisplacementY, mVelocity));
} }
mListener.onDragEnd(mVelocity, Math.abs(mVelocity) > RELEASE_VELOCITY_PX_MS); mListener.onDragEnd(mVelocity, Math.abs(mVelocity) > RELEASE_VELOCITY_PX_MS);

View File

@ -54,7 +54,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat {
HashMap<String, Integer> activePackages = new HashMap<>(); HashMap<String, Integer> activePackages = new HashMap<>();
UserHandleCompat user = UserHandleCompat.myUserHandle(); UserHandleCompat user = UserHandleCompat.myUserHandle();
for (SessionInfo info : mInstaller.getAllSessions()) { for (SessionInfo info : mInstaller.getAllSessions()) {
addSessionInfoToCahce(info, user); addSessionInfoToCache(info, user);
if (info.getAppPackageName() != null) { if (info.getAppPackageName() != null) {
activePackages.put(info.getAppPackageName(), (int) (info.getProgress() * 100)); activePackages.put(info.getAppPackageName(), (int) (info.getProgress() * 100));
mActiveSessions.put(info.getSessionId(), info.getAppPackageName()); mActiveSessions.put(info.getSessionId(), info.getAppPackageName());
@ -63,7 +63,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat {
return activePackages; return activePackages;
} }
@Thunk void addSessionInfoToCahce(SessionInfo info, UserHandleCompat user) { @Thunk void addSessionInfoToCache(SessionInfo info, UserHandleCompat user) {
String packageName = info.getAppPackageName(); String packageName = info.getAppPackageName();
if (packageName != null) { if (packageName != null) {
mCache.cachePackageInstallInfo(packageName, user, info.getAppIcon(), mCache.cachePackageInstallInfo(packageName, user, info.getAppIcon(),
@ -124,7 +124,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat {
private void pushSessionDisplayToLauncher(int sessionId) { private void pushSessionDisplayToLauncher(int sessionId) {
SessionInfo session = mInstaller.getSessionInfo(sessionId); SessionInfo session = mInstaller.getSessionInfo(sessionId);
if (session != null && session.getAppPackageName() != null) { if (session != null && session.getAppPackageName() != null) {
addSessionInfoToCahce(session, UserHandleCompat.myUserHandle()); addSessionInfoToCache(session, UserHandleCompat.myUserHandle());
LauncherAppState app = LauncherAppState.getInstanceNoCreate(); LauncherAppState app = LauncherAppState.getInstanceNoCreate();
if (app != null) { if (app != null) {

View File

@ -775,7 +775,7 @@ public class DragController implements DragDriver.EventListener, TouchController
dropCoordinates[0] = x; dropCoordinates[0] = x;
dropCoordinates[1] = y; dropCoordinates[1] = y;
mLauncher.getDragLayer().mapCoordInSelfToDescendent((View) target, dropCoordinates); mLauncher.getDragLayer().mapCoordInSelfToDescendant((View) target, dropCoordinates);
return target; return target;
} }
@ -783,7 +783,7 @@ public class DragController implements DragDriver.EventListener, TouchController
return null; return null;
} }
public void setDragScoller(DragScroller scroller) { public void setDragScroller(DragScroller scroller) {
mDragScroller = scroller; mDragScroller = scroller;
} }
@ -792,7 +792,7 @@ public class DragController implements DragDriver.EventListener, TouchController
} }
/** /**
* Sets the drag listner which will be notified when a drag starts or ends. * Sets the drag listener which will be notified when a drag starts or ends.
*/ */
public void addDragListener(DragListener l) { public void addDragListener(DragListener l) {
mListeners.add(l); mListeners.add(l);

View File

@ -499,7 +499,7 @@ public class DragLayer extends InsettableFrameLayout {
/** /**
* Inverse of {@link #getDescendantCoordRelativeToSelf(View, int[])}. * Inverse of {@link #getDescendantCoordRelativeToSelf(View, int[])}.
*/ */
public float mapCoordInSelfToDescendent(View descendant, int[] coord) { public float mapCoordInSelfToDescendant(View descendant, int[] coord) {
return Utilities.mapCoordInSelfToDescendent(descendant, this, coord); return Utilities.mapCoordInSelfToDescendent(descendant, this, coord);
} }

View File

@ -71,7 +71,7 @@ import com.android.launcher3.ShortcutInfo;
import com.android.launcher3.UninstallDropTarget.DropTargetSource; import com.android.launcher3.UninstallDropTarget.DropTargetSource;
import com.android.launcher3.Utilities; import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace.ItemOperator; import com.android.launcher3.Workspace.ItemOperator;
import com.android.launcher3.accessibility.AccessibileDragListenerAdapter; import com.android.launcher3.accessibility.AccessibleDragListenerAdapter;
import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragController;
import com.android.launcher3.dragndrop.DragController.DragListener; import com.android.launcher3.dragndrop.DragController.DragListener;
@ -297,7 +297,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mDragController.addDragListener(this); mDragController.addDragListener(this);
if (options.isAccessibleDrag) { if (options.isAccessibleDrag) {
mDragController.addDragListener(new AccessibileDragListenerAdapter( mDragController.addDragListener(new AccessibleDragListenerAdapter(
mContent, CellLayout.FOLDER_ACCESSIBILITY_DRAG) { mContent, CellLayout.FOLDER_ACCESSIBILITY_DRAG) {
@Override @Override

View File

@ -679,7 +679,7 @@ public class FolderPagedView extends PagedView {
} }
@Override @Override
protected void getEdgeVerticalPostion(int[] pos) { protected void getEdgeVerticalPosition(int[] pos) {
pos[0] = 0; pos[0] = 0;
pos[1] = getViewportHeight(); pos[1] = getViewportHeight();
} }

View File

@ -44,7 +44,7 @@ public class DragPreviewProvider {
// The padding added to the drag view during the preview generation. // The padding added to the drag view during the preview generation.
public final int previewPadding; public final int previewPadding;
public Bitmap gerenatedDragOutline; public Bitmap generatedDragOutline;
public DragPreviewProvider(View view) { public DragPreviewProvider(View view) {
mView = view; mView = view;
@ -120,11 +120,11 @@ public class DragPreviewProvider {
} }
public final void generateDragOutline(Canvas canvas) { public final void generateDragOutline(Canvas canvas) {
if (ProviderConfig.IS_DOGFOOD_BUILD && gerenatedDragOutline != null) { if (ProviderConfig.IS_DOGFOOD_BUILD && generatedDragOutline != null) {
throw new RuntimeException("Drag outline generated twice"); throw new RuntimeException("Drag outline generated twice");
} }
gerenatedDragOutline = createDragOutline(canvas); generatedDragOutline = createDragOutline(canvas);
} }
/** /**

View File

@ -186,16 +186,16 @@ public class IconNormalizer {
} }
/** /**
* Modifies {@param xCordinates} to represent a convex border. Fills in all missing values * Modifies {@param xCoordinates} to represent a convex border. Fills in all missing values
* (except on either ends) with appropriate values. * (except on either ends) with appropriate values.
* @param xCordinates map of x coordinate per y. * @param xCoordinates map of x coordinate per y.
* @param direction 1 for left border and -1 for right border. * @param direction 1 for left border and -1 for right border.
* @param topY the first Y position (inclusive) with a valid value. * @param topY the first Y position (inclusive) with a valid value.
* @param bottomY the last Y position (inclusive) with a valid value. * @param bottomY the last Y position (inclusive) with a valid value.
*/ */
private static void convertToConvexArray( private static void convertToConvexArray(
float[] xCordinates, int direction, int topY, int bottomY) { float[] xCoordinates, int direction, int topY, int bottomY) {
int total = xCordinates.length; int total = xCoordinates.length;
// The tangent at each pixel. // The tangent at each pixel.
float[] angles = new float[total - 1]; float[] angles = new float[total - 1];
@ -205,7 +205,7 @@ public class IconNormalizer {
float lastAngle = Float.MAX_VALUE; float lastAngle = Float.MAX_VALUE;
for (int i = topY + 1; i <= bottomY; i++) { for (int i = topY + 1; i <= bottomY; i++) {
if (xCordinates[i] <= -1) { if (xCoordinates[i] <= -1) {
continue; continue;
} }
int start; int start;
@ -213,14 +213,14 @@ public class IconNormalizer {
if (lastAngle == Float.MAX_VALUE) { if (lastAngle == Float.MAX_VALUE) {
start = first; start = first;
} else { } else {
float currentAngle = (xCordinates[i] - xCordinates[last]) / (i - last); float currentAngle = (xCoordinates[i] - xCoordinates[last]) / (i - last);
start = last; start = last;
// If this position creates a concave angle, keep moving up until we find a // If this position creates a concave angle, keep moving up until we find a
// position which creates a convex angle. // position which creates a convex angle.
if ((currentAngle - lastAngle) * direction < 0) { if ((currentAngle - lastAngle) * direction < 0) {
while (start > first) { while (start > first) {
start --; start --;
currentAngle = (xCordinates[i] - xCordinates[start]) / (i - start); currentAngle = (xCoordinates[i] - xCoordinates[start]) / (i - start);
if ((currentAngle - angles[start]) * direction >= 0) { if ((currentAngle - angles[start]) * direction >= 0) {
break; break;
} }
@ -229,11 +229,11 @@ public class IconNormalizer {
} }
// Reset from last check // Reset from last check
lastAngle = (xCordinates[i] - xCordinates[start]) / (i - start); lastAngle = (xCoordinates[i] - xCoordinates[start]) / (i - start);
// Update all the points from start. // Update all the points from start.
for (int j = start; j < i; j++) { for (int j = start; j < i; j++) {
angles[j] = lastAngle; angles[j] = lastAngle;
xCordinates[j] = xCordinates[start] + lastAngle * (j - start); xCoordinates[j] = xCoordinates[start] + lastAngle * (j - start);
} }
last = i; last = i;
} }

View File

@ -37,7 +37,7 @@ import java.util.Locale;
/** /**
* Manages the creation of {@link LauncherEvent}. * Manages the creation of {@link LauncherEvent}.
* To debug this class, execute following command before sideloading a new apk. * To debug this class, execute following command before side loading a new apk.
* *
* $ adb shell setprop log.tag.UserEvent VERBOSE * $ adb shell setprop log.tag.UserEvent VERBOSE
*/ */

View File

@ -56,7 +56,7 @@ public class LauncherDbUtils {
if (screenIds.get(0) != 0) { if (screenIds.get(0) != 0) {
// First screen is not 0, we need to rename screens // First screen is not 0, we need to rename screens
if (screenIds.indexOf(0L) > -1) { if (screenIds.indexOf(0L) > -1) {
// There is already a screen 0. First rename it to a differen screen. // There is already a screen 0. First rename it to a different screen.
long newScreenId = 1; long newScreenId = 1;
while (screenIds.indexOf(newScreenId) > -1) newScreenId++; while (screenIds.indexOf(newScreenId) > -1) newScreenId++;
renameScreen(db, 0, newScreenId); renameScreen(db, 0, newScreenId);

View File

@ -139,7 +139,7 @@ public class WidgetsContainerView extends BaseContainerView
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
if (LOGD) { if (LOGD) {
Log.d(TAG, String.format("onLonglick [v=%s]", v)); Log.d(TAG, String.format("onLongClick [v=%s]", v));
} }
// Return early if this is not initiated from a touch // Return early if this is not initiated from a touch
if (!v.isInTouchMode()) return false; if (!v.isInTouchMode()) return false;