summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherAppWidgetHostView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/LauncherAppWidgetHostView.java')
-rw-r--r--src/com/android/launcher3/LauncherAppWidgetHostView.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetHostView.java b/src/com/android/launcher3/LauncherAppWidgetHostView.java
index c18408607..a4ea44916 100644
--- a/src/com/android/launcher3/LauncherAppWidgetHostView.java
+++ b/src/com/android/launcher3/LauncherAppWidgetHostView.java
@@ -22,6 +22,7 @@ import android.content.Context;
import android.graphics.Rect;
import android.os.Handler;
import android.os.SystemClock;
+import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -36,13 +37,17 @@ import android.widget.RemoteViews;
import com.android.launcher3.dragndrop.DragLayer.TouchCompleteListener;
+import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.concurrent.Executor;
/**
* {@inheritDoc}
*/
public class LauncherAppWidgetHostView extends AppWidgetHostView implements TouchCompleteListener {
+ private static final String TAG = "LauncherWidgetHostView";
+
// Related to the auto-advancing of widgets
private static final long ADVANCE_INTERVAL = 20000;
private static final long ADVANCE_STAGGER = 250;
@@ -75,6 +80,16 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView implements Touc
mInflater = LayoutInflater.from(context);
setAccessibilityDelegate(Launcher.getLauncher(context).getAccessibilityDelegate());
setBackgroundResource(R.drawable.widget_internal_focus_bg);
+
+ if (Utilities.isAtLeastO()) {
+ try {
+ Method asyncMethod = AppWidgetHostView.class
+ .getMethod("setAsyncExecutor", Executor.class);
+ asyncMethod.invoke(this, Utilities.THREAD_POOL_EXECUTOR);
+ } catch (Exception e) {
+ Log.e(TAG, "Unable to set async executor", e);
+ }
+ }
}
@Override