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

Commit bba378e8 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Restricting the shared lib to java 7

Bug: 112849320
Test: Verified launcher works fine with the new jar
Change-Id: Ibfbc4e53f879894ada134c227e212e3e23c49ea6
parent ab4c55f6
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,9 @@ android_library {
        "src/**/I*.aidl",
        "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 {
android_app {
+18 −6
Original line number Original line Diff line number Diff line
@@ -110,11 +110,19 @@ class BackgroundTaskLoader implements Runnable {
                    synchronized(mLoadQueue) {
                    synchronized(mLoadQueue) {
                        try {
                        try {
                            mWaitingOnLoadQueue = true;
                            mWaitingOnLoadQueue = true;
                            mMainThreadHandler.post(
                            mMainThreadHandler.post(new Runnable() {
                                    () -> mOnIdleChangedListener.onIdleChanged(true));
                                @Override
                                public void run() {
                                    mOnIdleChangedListener.onIdleChanged(true);
                                }
                            });
                            mLoadQueue.wait();
                            mLoadQueue.wait();
                            mMainThreadHandler.post(
                            mMainThreadHandler.post(new Runnable() {
                                    () -> mOnIdleChangedListener.onIdleChanged(false));
                                @Override
                                public void run() {
                                    mOnIdleChangedListener.onIdleChanged(false);
                                }
                            });
                            mWaitingOnLoadQueue = false;
                            mWaitingOnLoadQueue = false;
                        } catch (InterruptedException ie) {
                        } catch (InterruptedException ie) {
                            ie.printStackTrace();
                            ie.printStackTrace();
@@ -142,8 +150,12 @@ class BackgroundTaskLoader implements Runnable {


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


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


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

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


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


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


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


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


    public TaskStack() {
    public TaskStack() {
        // Ensure that we only show stack tasks
        // 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. */
    /** Sets the callbacks for this task stack. */
Loading