时间:2021/04/19
之前公司不允许csdn,笔记写在其它地方。最近整理过来
Bug描述
1、长按setting添加widget,在widget选择界面点击recentUI键返回launcher,桌面图标无法再次长按
修复方案
packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
public boolean isWorkspaceLocked() {
- return mWorkspaceLoading || mPendingRequestArgs != null;
+ return mWorkspaceLoading;// || mPendingRequestArgs != null;
}
bug描述
2、长按Gmail,选择第一个插件拖到桌面,在选择文件夹界面点击recentUI键,返回launcher桌面Gmail 残影无法消除
修复方案
--- a/alps/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
+++ b/alps/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
@@ -676,7 +676,11 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
Runnable exitSpringLoaded = new Runnable() {
@Override
public void run() {
- mStateManager.goToState(NORMAL, SPRING_LOADED_EXIT_DELAY);
+ if(changeState){
+ mStateManager.goToState(NORMAL, SPRING_LOADED_EXIT_DELAY);
+ }else{
+ changeState = true;
+ }
}
};
@@ -720,7 +724,11 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
final Runnable onComplete = new Runnable() {
@Override
public void run() {
- getStateManager().goToState(NORMAL);
+ if(changeState){
+ getStateManager().goToState(NORMAL);
+ }else{
+ changeState = true;
+ }
}
};
@@ -901,6 +909,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
mAppWidgetHost.setListenIfResumed(true);
RaceConditionTracker.onEvent(ON_START_EVT, EXIT);
}
+ boolean changeState = true;
private void handleDeferredResume() {
if (hasBeenResumed() && !mStateManager.getState().disableInteraction) {
@@ -923,8 +932,22 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
DiscoveryBounce.showForHomeIfNeeded(this);
- if (mPendingActivityRequestCode != -1 && isInState(NORMAL)) {
- UiFactory.resetPendingActivityResults(this, mPendingActivityRequestCode);
+ if (mPendingActivityRequestCode != -1) {
+ if(isInState(NORMAL)) {
+ //changeState
+ //clear widget data and flag
+ //clearAnimatedView and start Launcher to clearTask
+ changeState = true;
+ UiFactory.resetPendingActivityResults(this, mPendingActivityRequestCode);
+ }else{
+ //it's google issue from the recent ui
+ //widget-->recent-->normal/allapp
+ //i should clear widget data and flag
+ //don't changeState
+ //don't start Launcher to clearTask
+ changeState = false;
+ onActivityResult(mPendingActivityRequestCode, RESULT_CANCELED, null);
+ }
}
mDeferredResumePending = false;
} else {