diff options
Diffstat (limited to 'src/com')
14 files changed, 134 insertions, 119 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index c4e6ed119..f9f8e80ca 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -284,7 +284,8 @@ public class DeviceProfile { Utilities.calculateTextHeight(res.getDimension(R.dimen.folder_child_text_size)); final int folderBottomPanelSize = - 2 * res.getDimensionPixelSize(R.dimen.folder_label_padding) + res.getDimensionPixelSize(R.dimen.folder_label_padding_top) + + res.getDimensionPixelSize(R.dimen.folder_label_padding_bottom) + Utilities.calculateTextHeight(res.getDimension(R.dimen.folder_label_text_size)); // Don't let the folder get too close to the edges of the screen. diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index d3fb38ede..5c86b6b33 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -772,13 +772,15 @@ public class IconCache { public void run() { if (!mAppsToUpdate.isEmpty()) { LauncherActivityInfoCompat app = mAppsToUpdate.pop(); - String cn = app.getComponentName().flattenToString(); - ContentValues values = updateCacheAndGetContentValues(app, true); - mIconDb.update(values, - IconDB.COLUMN_COMPONENT + " = ? AND " + IconDB.COLUMN_USER + " = ?", - new String[]{cn, Long.toString(mUserSerial)}); - mUpdatedPackages.add(app.getComponentName().getPackageName()); - + String pkg = app.getComponentName().getPackageName(); + PackageInfo info = mPkgInfoMap.get(pkg); + if (info != null) { + synchronized (IconCache.this) { + ContentValues values = updateCacheAndGetContentValues(app, true); + addIconToDB(values, app.getComponentName(), info, mUserSerial); + } + mUpdatedPackages.add(pkg); + } if (mAppsToUpdate.isEmpty() && !mUpdatedPackages.isEmpty()) { // No more app to update. Notify model. LauncherAppState.getInstance().getModel().onPackageIconsUpdated( diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 2b64d42d2..c73a7a61d 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -277,9 +277,9 @@ public class Launcher extends Activity private LauncherAccessibilityDelegate mAccessibilityDelegate; private boolean mIsResumeFromActionScreenOff; @Thunk boolean mUserPresent = true; - private boolean mVisible = false; - private boolean mHasFocus = false; - private boolean mAttached = false; + private boolean mVisible; + private boolean mHasFocus; + private boolean mAttached; /** Maps launcher activity components to their list of shortcut ids. */ private MultiHashMap<ComponentKey, String> mDeepShortcutMap = new MultiHashMap<>(); @@ -484,10 +484,33 @@ public class Launcher extends Activity private void loadExtractedColorsAndColorItems() { // TODO: do this in pre-N as well, once the extraction part is complete. - if (mExtractedColors != null && Utilities.isNycOrAbove()) { + if (Utilities.isNycOrAbove()) { mExtractedColors.load(this); mHotseat.updateColor(mExtractedColors, !mPaused); mWorkspace.getPageIndicator().updateColor(mExtractedColors); + // It's possible that All Apps is visible when this is run, + // so always use light status bar in that case. + activateLightStatusBar(isAllAppsVisible()); + } + } + + /** + * Sets the status bar to be light or not. Light status bar means dark icons. + * @param activate if true, make sure the status bar is light, otherwise base on wallpaper. + */ + public void activateLightStatusBar(boolean activate) { + boolean lightStatusBar = activate + || mExtractedColors.getColor(ExtractedColors.STATUS_BAR_INDEX, + ExtractedColors.DEFAULT_DARK) == ExtractedColors.DEFAULT_LIGHT; + int oldSystemUiFlags = getWindow().getDecorView().getSystemUiVisibility(); + int newSystemUiFlags = oldSystemUiFlags; + if (lightStatusBar) { + newSystemUiFlags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; + } else { + newSystemUiFlags &= ~(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + if (newSystemUiFlags != oldSystemUiFlags) { + getWindow().getDecorView().setSystemUiVisibility(newSystemUiFlags); } } @@ -1793,11 +1816,14 @@ public class Launcher extends Activity } super.onNewIntent(intent); - // Close the menu - Folder openFolder = mWorkspace.getOpenFolder(); boolean alreadyOnHome = mHasFocus && ((intent.getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); + + // Check this condition before handling isActionMain, as this will get reset. + boolean shouldMoveToDefaultScreen = alreadyOnHome && + mState == State.WORKSPACE && getTopFloatingView() == null; + boolean isActionMain = Intent.ACTION_MAIN.equals(intent.getAction()); if (isActionMain) { // also will cancel mWaitingForResult. @@ -1852,10 +1878,10 @@ public class Launcher extends Activity // as slow logic in the callbacks eat into the time the scroller expects for the snapToPage // animation. if (isActionMain) { - boolean moveToDefaultScreen = mLauncherCallbacks != null ? + boolean callbackAllowsMoveToDefaultScreen = mLauncherCallbacks != null ? mLauncherCallbacks.shouldMoveToDefaultScreenOnHomeIntent() : true; - if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isTouchActive() && - openFolder == null && moveToDefaultScreen) { + if (shouldMoveToDefaultScreen && !mWorkspace.isTouchActive() + && callbackAllowsMoveToDefaultScreen) { // We use this flag to suppress noisy callbacks above custom content state // from onResume. diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index b8beb9456..340177d38 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -599,6 +599,7 @@ public class Workspace extends PagedView if (shouldConsumeTouch(v)) return true; if (super.onTouch(v, ev)) { mLauncher.startSearch("", false, null, false); + return true; } return false; } @@ -610,6 +611,7 @@ public class Workspace extends PagedView if (shouldConsumeTouch(v)) return true; if (super.onTouch(v, ev)) { mLauncher.startSearch("", false, null, false); + return true; } return false; } @@ -2758,6 +2760,9 @@ public class Workspace extends PagedView } parent.onDropChild(cell); } + if (d.stateAnnouncer != null) { + d.stateAnnouncer.completeAction(R.string.item_moved); + } } /** diff --git a/src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java b/src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java index 8ff82dd4f..99deb7b1c 100644 --- a/src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java +++ b/src/com/android/launcher3/accessibility/DragViewStateAnnouncer.java @@ -21,6 +21,8 @@ import android.view.View; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; +import com.android.launcher3.Launcher; + /** * Periodically sends accessibility events to announce ongoing state changed. Based on the * implementation in ProgressBar. @@ -50,6 +52,12 @@ public class DragViewStateAnnouncer implements Runnable { mTargetView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); } + public void completeAction(int announceResId) { + cancel(); + Launcher launcher = Launcher.getLauncher(mTargetView.getContext()); + launcher.getDragLayer().announceForAccessibility(launcher.getText(announceResId)); + } + public static DragViewStateAnnouncer createFor(View v) { if (((AccessibilityManager) v.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE)) .isEnabled()) { diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 1719b0594..b129bb09d 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -6,12 +6,15 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ArgbEvaluator; import android.animation.ObjectAnimator; +import android.graphics.Color; import android.support.v4.content.ContextCompat; +import android.support.v4.graphics.ColorUtils; import android.support.v4.view.animation.FastOutSlowInInterpolator; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.animation.AccelerateInterpolator; +import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import com.android.launcher3.DeviceProfile; @@ -41,6 +44,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul private static final boolean DBG = false; private final Interpolator mAccelInterpolator = new AccelerateInterpolator(2f); + private final Interpolator mDecelInterpolator = new DecelerateInterpolator(3f); private final Interpolator mFastOutSlowInInterpolator = new FastOutSlowInInterpolator(); private final ScrollInterpolator mScrollInterpolator = new ScrollInterpolator(); @@ -86,8 +90,6 @@ public class AllAppsTransitionController implements TouchController, VerticalPul private AnimatorSet mCurrentAnimation; private boolean mNoIntercept; - private boolean mLightStatusBar; - // Used in discovery bounce animation to provide the transition without workspace changing. private boolean mIsTranslateWithoutWorkspace = false; private AnimatorSet mDiscoBounceAnimation; @@ -273,26 +275,14 @@ public class AllAppsTransitionController implements TouchController, VerticalPul } private void updateLightStatusBar(float shift) { - boolean enable = shift <= mStatusBarHeight / 2; // Do not modify status bar on landscape as all apps is not full bleed. if (mLauncher.getDeviceProfile().isVerticalBarLayout()) { return; } - // Already set correctly - if (mLightStatusBar == enable) { - return; - } - int systemUiFlags = mLauncher.getWindow().getDecorView().getSystemUiVisibility(); - if (enable) { - mLauncher.getWindow().getDecorView().setSystemUiVisibility(systemUiFlags - | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - - } else { - mLauncher.getWindow().getDecorView().setSystemUiVisibility(systemUiFlags - & ~(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR)); - - } - mLightStatusBar = enable; + // Use a light status bar (dark icons) if all apps is behind at least half of the status + // bar. If the status bar is already light due to wallpaper extraction, keep it that way. + boolean forceLight = shift <= mStatusBarHeight / 2; + mLauncher.activateLightStatusBar(forceLight); } /** @@ -305,12 +295,14 @@ public class AllAppsTransitionController implements TouchController, VerticalPul float workspaceHotseatAlpha = Utilities.boundToRange(progress, 0f, 1f); float alpha = 1 - workspaceHotseatAlpha; - float interpolation = mAccelInterpolator.getInterpolation(workspaceHotseatAlpha); - int color = (Integer) mEvaluator.evaluate(alpha, + int color = (Integer) mEvaluator.evaluate(mDecelInterpolator.getInterpolation(alpha), mHotseatBackgroundColor, mAllAppsBackgroundColor); - mAppsView.setRevealDrawableColor(color); + int bgAlpha = Color.alpha((int) mEvaluator.evaluate(alpha, + mHotseatBackgroundColor, mAllAppsBackgroundColor)); + + mAppsView.setRevealDrawableColor(ColorUtils.setAlphaComponent(color, bgAlpha)); mAppsView.getContentView().setAlpha(alpha); mAppsView.setTranslationY(shiftCurrent); diff --git a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java index ec65c3e8a..c7a529d07 100644 --- a/src/com/android/launcher3/compat/AlphabeticIndexCompat.java +++ b/src/com/android/launcher3/compat/AlphabeticIndexCompat.java @@ -1,12 +1,14 @@ package com.android.launcher3.compat; +import android.annotation.TargetApi; import android.content.Context; -import android.content.res.Configuration; +import android.icu.text.AlphabeticIndex; +import android.os.Build; +import android.os.LocaleList; import android.util.Log; import com.android.launcher3.Utilities; -import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.Locale; @@ -157,69 +159,39 @@ public class AlphabeticIndexCompat { } /** - * Reflected android.icu.text.AlphabeticIndex implementation, falls back to the base - * alphabetic index. + * Implementation based on {@link AlphabeticIndex}. */ + @TargetApi(Build.VERSION_CODES.N) private static class AlphabeticIndexVN extends BaseIndex { - private Object mAlphabeticIndex; - private Method mGetBucketIndexMethod; - - private Method mGetBucketMethod; - private Method mGetLabelMethod; - - public AlphabeticIndexVN(Context context) throws Exception { - // TODO: Replace this with locale list once available. - Object locales = Configuration.class.getDeclaredMethod("getLocales").invoke( - context.getResources().getConfiguration()); - int localeCount = (Integer) locales.getClass().getDeclaredMethod("size").invoke(locales); - Method localeGetter = locales.getClass().getDeclaredMethod("get", int.class); - Locale primaryLocale = localeCount == 0 ? Locale.ENGLISH : - (Locale) localeGetter.invoke(locales, 0); + private final AlphabeticIndex.ImmutableIndex mAlphabeticIndex; - Class clazz = Class.forName("android.icu.text.AlphabeticIndex"); - mAlphabeticIndex = clazz.getConstructor(Locale.class).newInstance(primaryLocale); + public AlphabeticIndexVN(Context context) { + LocaleList locales = context.getResources().getConfiguration().getLocales(); + int localeCount = locales.size(); - Method addLocales = clazz.getDeclaredMethod("addLabels", Locale[].class); + Locale primaryLocale = localeCount == 0 ? Locale.ENGLISH : locales.get(0); + AlphabeticIndex indexBuilder = new AlphabeticIndex(primaryLocale); for (int i = 1; i < localeCount; i++) { - Locale l = (Locale) localeGetter.invoke(locales, i); - addLocales.invoke(mAlphabeticIndex, new Object[]{ new Locale[] {l}}); + indexBuilder.addLabels(locales.get(i)); } - addLocales.invoke(mAlphabeticIndex, new Object[]{ new Locale[] {Locale.ENGLISH}}); + indexBuilder.addLabels(Locale.ENGLISH); - mAlphabeticIndex = mAlphabeticIndex.getClass() - .getDeclaredMethod("buildImmutableIndex") - .invoke(mAlphabeticIndex); - - mGetBucketIndexMethod = mAlphabeticIndex.getClass().getDeclaredMethod( - "getBucketIndex", CharSequence.class); - mGetBucketMethod = mAlphabeticIndex.getClass().getDeclaredMethod("getBucket", int.class); - mGetLabelMethod = mGetBucketMethod.getReturnType().getDeclaredMethod("getLabel"); + mAlphabeticIndex = indexBuilder.buildImmutableIndex(); } /** * Returns the index of the bucket in which {@param s} should appear. */ protected int getBucketIndex(String s) { - try { - return (Integer) mGetBucketIndexMethod.invoke(mAlphabeticIndex, s); - } catch (Exception e) { - e.printStackTrace(); - } - return super.getBucketIndex(s); + return mAlphabeticIndex.getBucketIndex(s); } /** * Returns the label for the bucket at the given index */ protected String getBucketLabel(int index) { - try { - return (String) mGetLabelMethod.invoke( - mGetBucketMethod.invoke(mAlphabeticIndex, index)); - } catch (Exception e) { - e.printStackTrace(); - } - return super.getBucketLabel(index); + return mAlphabeticIndex.getBucket(index).getLabel(); } } } diff --git a/src/com/android/launcher3/dynamicui/ColorExtractionService.java b/src/com/android/launcher3/dynamicui/ColorExtractionService.java index 89594f407..c15b71040 100644 --- a/src/com/android/launcher3/dynamicui/ColorExtractionService.java +++ b/src/com/android/launcher3/dynamicui/ColorExtractionService.java @@ -26,6 +26,7 @@ import android.support.v7.graphics.Palette; import com.android.launcher3.LauncherProvider; import com.android.launcher3.LauncherSettings; +import com.android.launcher3.R; /** * Extracts colors from the wallpaper, and saves results to {@link LauncherProvider}. @@ -52,16 +53,21 @@ public class ColorExtractionService extends IntentService { Bitmap wallpaper = ((BitmapDrawable) wallpaperManager.getDrawable()).getBitmap(); Palette palette = Palette.from(wallpaper).generate(); extractedColors.updatePalette(palette); - // We extract colors for the hotseat separately, - // since it only considers the lower part of the wallpaper. - // TODO(twickham): update Palette library to 23.3.1 or higher, - // which fixes a bug with using regions (b/28349435). + // We extract colors for the hotseat and status bar separately, + // since they only consider part of the wallpaper. Palette hotseatPalette = Palette.from(wallpaper) .setRegion(0, (int) (wallpaper.getHeight() * (1f - HOTSEAT_FRACTION)), wallpaper.getWidth(), wallpaper.getHeight()) .clearFilters() .generate(); extractedColors.updateHotseatPalette(hotseatPalette); + + int statusBarHeight = getResources().getDimensionPixelSize(R.dimen.status_bar_height); + Palette statusBarPalette = Palette.from(wallpaper) + .setRegion(0, 0, wallpaper.getWidth(), statusBarHeight) + .clearFilters() + .generate(); + extractedColors.updateStatusBarPalette(statusBarPalette); } // Save the extracted colors and wallpaper id to LauncherProvider. diff --git a/src/com/android/launcher3/dynamicui/ExtractedColors.java b/src/com/android/launcher3/dynamicui/ExtractedColors.java index e545288a0..4db0797c0 100644 --- a/src/com/android/launcher3/dynamicui/ExtractedColors.java +++ b/src/com/android/launcher3/dynamicui/ExtractedColors.java @@ -38,6 +38,7 @@ public class ExtractedColors { // loading extracted colors. New colors should always be added at the end. public static final int VERSION_INDEX = 0; public static final int HOTSEAT_INDEX = 1; + public static final int STATUS_BAR_INDEX = 2; // public static final int VIBRANT_INDEX = 2; // public static final int VIBRANT_DARK_INDEX = 3; // public static final int VIBRANT_LIGHT_INDEX = 4; @@ -45,8 +46,8 @@ public class ExtractedColors { // public static final int MUTED_DARK_INDEX = 6; // public static final int MUTED_LIGHT_INDEX = 7; - public static final int NUM_COLOR_PROFILES = 1; - private static final int VERSION = 1; + public static final int NUM_COLOR_PROFILES = 2; + private static final int VERSION = 2; private static final String COLOR_SEPARATOR = ","; @@ -156,4 +157,9 @@ public class ExtractedColors { } setColorAtIndex(HOTSEAT_INDEX, hotseatColor); } + + public void updateStatusBarPalette(Palette statusBarPalette) { + setColorAtIndex(STATUS_BAR_INDEX, ExtractionUtils.isSuperLight(statusBarPalette) ? + DEFAULT_LIGHT : DEFAULT_DARK); + } } diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index b4c839199..698e5aa04 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -916,7 +916,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList if (mDeleteFolderOnDropCompleted && !mItemAddedBackToSelfViaIcon && target != this) { replaceFolderWithFinalItem(); } - } else { + } else if (!mDragController.isDeferringDrag()) { // The drag failed, we need to return the item to the folder ShortcutInfo info = (ShortcutInfo) d.dragInfo; View icon = (mCurrentDragView != null && mCurrentDragView.getTag() == info) @@ -1346,6 +1346,10 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList // The animation has already been shown while opening the folder. mInfo.setOption(FolderInfo.FLAG_MULTI_PAGE_ANIMATION, true, mLauncher); } + + if (d.stateAnnouncer != null) { + d.stateAnnouncer.completeAction(R.string.item_moved); + } } // This is used so the item doesn't immediately appear in the folder when added. In one case diff --git a/src/com/android/launcher3/logging/LoggerUtils.java b/src/com/android/launcher3/logging/LoggerUtils.java index 845dbc2bc..c2b97eb2d 100644 --- a/src/com/android/launcher3/logging/LoggerUtils.java +++ b/src/com/android/launcher3/logging/LoggerUtils.java @@ -60,6 +60,7 @@ public class LoggerUtils { case LauncherLogProto.WIDGET: typeStr = "WIDGET"; break; case LauncherLogProto.DEEPSHORTCUT: typeStr = "DEEPSHORTCUT"; break; case LauncherLogProto.FOLDER_ICON: typeStr = "FOLDERICON"; break; + case LauncherLogProto.SEARCHBOX: typeStr = "SEARCHBOX"; break; default: typeStr = "UNKNOWN"; } @@ -73,6 +74,9 @@ public class LoggerUtils { if (t.intentHash != 0) { typeStr += ", intentHash=" + t.intentHash; } + if (t.spanX != 0) { + typeStr += ", spanX=" + t.spanX; + } return typeStr += ", grid=(" + t.gridX + "," + t.gridY + "), id=" + t.pageIndex; } diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index 0356a9c7b..56fdce834 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -37,6 +37,9 @@ import java.util.Locale; /** * Manages the creation of {@link LauncherEvent}. + * To debug this class, execute following command before sideloading a new apk. + * + * $ adb shell setprop log.tag.UserEvent VERBOSE */ public class UserEventDispatcher { @@ -137,10 +140,6 @@ public class UserEventDispatcher { new ComponentKey(cn, itemInfo.user)); } } - - // Fill in the duration of time spent navigating in Launcher and the container. - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; return event; } @@ -152,12 +151,17 @@ public class UserEventDispatcher { dispatchUserEvent(ev, intent); } + public void logActionOnItem(int action, int itemType) { + LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, Target.ITEM); + event.action.touch = action; + event.srcTarget[0].itemType = itemType; + dispatchUserEvent(event, null); + } + public void logActionOnControl(int action, int controlType) { LauncherEvent event = LoggerUtils.initLauncherEvent(Action.TOUCH, Target.CONTROL); event.action.touch = action; event.srcTarget[0].controlType = controlType; - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; dispatchUserEvent(event, null); } @@ -166,8 +170,6 @@ public class UserEventDispatcher { event.action.touch = action; event.action.dir = dir; event.srcTarget[0].containerType = containerType; - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; dispatchUserEvent(event, null); } @@ -181,8 +183,6 @@ public class UserEventDispatcher { ItemInfo info = (ItemInfo) icon.getTag(); provider.fillInLaunchSourceData(icon, info, event.srcTarget[0], event.srcTarget[1]); event.action.touch = Action.LONGPRESS; - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; dispatchUserEvent(event, null); } @@ -206,9 +206,6 @@ public class UserEventDispatcher { dragObj.dragInfo, event.destTarget[0], event.destTarget[1]); } - - event.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; - event.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; event.actionDurationMillis = SystemClock.uptimeMillis() - mActionDurationMillis; dispatchUserEvent(event, null); } @@ -230,6 +227,9 @@ public class UserEventDispatcher { } public void dispatchUserEvent(LauncherEvent ev, Intent intent) { + ev.elapsedContainerMillis = SystemClock.uptimeMillis() - mElapsedContainerMillis; + ev.elapsedSessionMillis = SystemClock.uptimeMillis() - mElapsedSessionMillis; + if (!mIsVerbose) { return; } diff --git a/src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java b/src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java index bfdf21f00..3ceba8419 100644 --- a/src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java +++ b/src/com/android/launcher3/pageindicators/PageIndicatorLineCaret.java @@ -143,6 +143,11 @@ public class PageIndicatorLineCaret extends PageIndicator { } @Override + public void setAccessibilityDelegate(AccessibilityDelegate delegate) { + mAllAppsHandle.setAccessibilityDelegate(delegate); + } + + @Override protected void onDraw(Canvas canvas) { if (mTotalScroll == 0 || mNumPagesFloat == 0) { return; diff --git a/src/com/android/launcher3/util/SQLiteCacheHelper.java b/src/com/android/launcher3/util/SQLiteCacheHelper.java index c455791b3..d1cfe4264 100644 --- a/src/com/android/launcher3/util/SQLiteCacheHelper.java +++ b/src/com/android/launcher3/util/SQLiteCacheHelper.java @@ -29,22 +29,6 @@ public abstract class SQLiteCacheHelper { } /** - * @see SQLiteDatabase#update(String, ContentValues, String, String[]) - */ - public void update(ContentValues values, String whereClause, String[] whereArgs) { - if (mIgnoreWrites) { - return; - } - try { - mOpenHelper.getWritableDatabase().update(mTableName, values, whereClause, whereArgs); - } catch (SQLiteFullException e) { - onDiskFull(e); - } catch (SQLiteException e) { - Log.d(TAG, "Ignoring sqlite exception", e); - } - } - - /** * @see SQLiteDatabase#delete(String, String, String[]) */ public void delete(String whereClause, String[] whereArgs) { |