mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Also notify the user when a task view fails to launch.
Bug: 78660939 Change-Id: I8041d3bdd6da1caed72affb1e295c416214a92d4
This commit is contained in:
@@ -27,7 +27,6 @@ import android.os.RemoteException;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver.OnPreDrawListener;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
@@ -239,7 +238,7 @@ public class TaskSystemShortcut<T extends SystemShortcut> extends SystemShortcut
|
||||
Log.w(TAG, "Failed to start screen pinning: ", e);
|
||||
}
|
||||
} else {
|
||||
Log.w(TAG, taskView.getLaunchTaskFailedMsg());
|
||||
taskView.notifyTaskLaunchFailed(TAG);
|
||||
}
|
||||
};
|
||||
taskView.launchTask(true, resultCallback, mHandler);
|
||||
|
||||
@@ -1177,7 +1177,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
tv.setVisibility(VISIBLE);
|
||||
getOverlay().remove(drawable);
|
||||
if (!result) {
|
||||
Log.w(TAG, tv.getLaunchTaskFailedMsg());
|
||||
tv.notifyTaskLaunchFailed(TAG);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.quickstep.views;
|
||||
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -36,6 +37,7 @@ import android.view.accessibility.AccessibilityNodeInfo;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import android.widget.Toast;
|
||||
import com.android.launcher3.BaseActivity;
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
import com.android.launcher3.R;
|
||||
@@ -138,7 +140,7 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
|
||||
public void launchTask(boolean animate) {
|
||||
launchTask(animate, (result) -> {
|
||||
if (!result) {
|
||||
Log.w(TAG, getLaunchTaskFailedMsg());
|
||||
notifyTaskLaunchFailed(TAG);
|
||||
}
|
||||
}, getHandler());
|
||||
}
|
||||
@@ -312,11 +314,12 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
|
||||
return super.performAccessibilityAction(action, arguments);
|
||||
}
|
||||
|
||||
public String getLaunchTaskFailedMsg() {
|
||||
public void notifyTaskLaunchFailed(String tag) {
|
||||
String msg = "Failed to launch task";
|
||||
if (mTask != null) {
|
||||
msg += " (task=" + mTask.key.baseIntent + " userId=" + mTask.key.userId + ")";
|
||||
}
|
||||
return msg;
|
||||
Log.w(tag, msg);
|
||||
Toast.makeText(getContext(), R.string.activity_not_available, LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user