Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7160d4de authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Restricting the shared lib to java 7"

parents 9ea623ca bba378e8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -20,6 +20,9 @@ android_library {
        "src/**/I*.aidl",
    ],

    // Enforce that the library is build agains java 7 so that there are
    // no compatibility issues with launcher
    java_version: "1.7",
}

android_app {
+18 −6
Original line number Diff line number Diff line
@@ -110,11 +110,19 @@ class BackgroundTaskLoader implements Runnable {
                    synchronized(mLoadQueue) {
                        try {
                            mWaitingOnLoadQueue = true;
                            mMainThreadHandler.post(
                                    () -> mOnIdleChangedListener.onIdleChanged(true));
                            mMainThreadHandler.post(new Runnable() {
                                @Override
                                public void run() {
                                    mOnIdleChangedListener.onIdleChanged(true);
                                }
                            });
                            mLoadQueue.wait();
                            mMainThreadHandler.post(
                                    () -> mOnIdleChangedListener.onIdleChanged(false));
                            mMainThreadHandler.post(new Runnable() {
                                @Override
                                public void run() {
                                    mOnIdleChangedListener.onIdleChanged(false);
                                }
                            });
                            mWaitingOnLoadQueue = false;
                        } catch (InterruptedException ie) {
                            ie.printStackTrace();
@@ -142,8 +150,12 @@ class BackgroundTaskLoader implements Runnable {

            if (!mCancelled) {
                // Notify that the task data has changed
                mMainThreadHandler.post(
                        () -> t.notifyTaskDataLoaded(thumbnailData, icon));
                mMainThreadHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        t.notifyTaskDataLoaded(thumbnailData, icon);
                    }
                });
            }
        }
    }
+18 −9
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@ import java.util.ArrayList;
/**
 * Loader class that loads full-resolution thumbnails when appropriate.
 */
public class HighResThumbnailLoader implements TaskCallbacks {
public class HighResThumbnailLoader implements
        TaskCallbacks, BackgroundTaskLoader.OnIdleChangedListener {

    private final ActivityManagerWrapper mActivityManager;

@@ -80,6 +81,11 @@ public class HighResThumbnailLoader implements TaskCallbacks {
        updateLoading();
    }

    @Override
    public void onIdleChanged(boolean idle) {
        setTaskLoadQueueIdle(idle);
    }

    /**
     * Sets whether the other task load queue is idling. Avoid double-loading bitmaps by not
     * starting this queue until the other queue is idling.
@@ -220,16 +226,19 @@ public class HighResThumbnailLoader implements TaskCallbacks {
            }
        }

        private void loadTask(Task t) {
            ThumbnailData thumbnail = mActivityManager.getTaskThumbnail(t.key.id,
        private void loadTask(final Task t) {
            final ThumbnailData thumbnail = mActivityManager.getTaskThumbnail(t.key.id,
                    false /* reducedResolution */);
            mMainThreadHandler.post(() -> {
            mMainThreadHandler.post(new Runnable() {
                @Override
                public void run() {
                    synchronized (mLoadQueue) {
                        mLoadingTasks.remove(t);
                    }
                    if (mVisibleTasks.contains(t)) {
                        t.notifyTaskDataLoaded(thumbnail, t.icon);
                    }
                }
            });
        }
    };
+1 −2
Original line number Diff line number Diff line
@@ -110,8 +110,7 @@ public class RecentsTaskLoader {
        mActivityInfoCache = new LruCache<>(numRecentTasks);

        mIconLoader = createNewIconLoader(context, mIconCache, mActivityInfoCache);
        mLoader = new BackgroundTaskLoader(mLoadQueue, mIconLoader,
                mHighResThumbnailLoader::setTaskLoadQueueIdle);
        mLoader = new BackgroundTaskLoader(mLoadQueue, mIconLoader, mHighResThumbnailLoader);
    }

    protected IconLoader createNewIconLoader(Context context,TaskKeyLruCache<Drawable> iconCache,
+7 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.shared.recents.model;
import android.content.ComponentName;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.SparseArray;

import com.android.systemui.shared.recents.model.Task.TaskKey;
import com.android.systemui.shared.recents.utilities.AnimationProps;
@@ -67,7 +68,12 @@ public class TaskStack {

    public TaskStack() {
        // Ensure that we only show stack tasks
        mStackTaskList.setFilter((taskIdMap, t, index) -> t.isStackTask);
        mStackTaskList.setFilter(new TaskFilter() {
            @Override
            public boolean acceptTask(SparseArray<Task> taskIdMap, Task t, int index) {
                return  t.isStackTask;
            }
        });
    }

    /** Sets the callbacks for this task stack. */
Loading