Merge "Refresh icon cache for recents when rro overrides the adaptive icon path" into ub-launcher3-master
This commit is contained in:
commit
1d3e37ecf2
|
@ -17,6 +17,7 @@
|
||||||
package com.android.quickstep.views;
|
package com.android.quickstep.views;
|
||||||
|
|
||||||
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
|
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
|
||||||
|
import static com.android.launcher3.InvariantDeviceProfile.CHANGE_FLAG_ICON_PARAMS;
|
||||||
import static com.android.launcher3.anim.Interpolators.ACCEL;
|
import static com.android.launcher3.anim.Interpolators.ACCEL;
|
||||||
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
|
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
|
||||||
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
|
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
|
||||||
|
@ -69,6 +70,7 @@ import androidx.annotation.Nullable;
|
||||||
import com.android.launcher3.BaseActivity;
|
import com.android.launcher3.BaseActivity;
|
||||||
import com.android.launcher3.DeviceProfile;
|
import com.android.launcher3.DeviceProfile;
|
||||||
import com.android.launcher3.Insettable;
|
import com.android.launcher3.Insettable;
|
||||||
|
import com.android.launcher3.InvariantDeviceProfile;
|
||||||
import com.android.launcher3.PagedView;
|
import com.android.launcher3.PagedView;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
|
@ -105,7 +107,8 @@ import java.util.function.Consumer;
|
||||||
*/
|
*/
|
||||||
@TargetApi(Build.VERSION_CODES.P)
|
@TargetApi(Build.VERSION_CODES.P)
|
||||||
public abstract class RecentsView<T extends BaseActivity> extends PagedView implements Insettable,
|
public abstract class RecentsView<T extends BaseActivity> extends PagedView implements Insettable,
|
||||||
TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback {
|
TaskThumbnailCache.HighResLoadingState.HighResLoadingStateChangedCallback,
|
||||||
|
InvariantDeviceProfile.OnIDPChangeListener {
|
||||||
|
|
||||||
private static final String TAG = RecentsView.class.getSimpleName();
|
private static final String TAG = RecentsView.class.getSimpleName();
|
||||||
|
|
||||||
|
@ -151,6 +154,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
// Keeps track of the previously known visible tasks for purposes of loading/unloading task data
|
// Keeps track of the previously known visible tasks for purposes of loading/unloading task data
|
||||||
private final SparseBooleanArray mHasVisibleTaskData = new SparseBooleanArray();
|
private final SparseBooleanArray mHasVisibleTaskData = new SparseBooleanArray();
|
||||||
|
|
||||||
|
private final InvariantDeviceProfile mIdp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Call reloadIdNeeded in onTaskStackChanged.
|
* TODO: Call reloadIdNeeded in onTaskStackChanged.
|
||||||
*/
|
*/
|
||||||
|
@ -293,6 +298,8 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
mActivity = (T) BaseActivity.fromContext(context);
|
mActivity = (T) BaseActivity.fromContext(context);
|
||||||
mQuickScrubController = new QuickScrubController(mActivity, this);
|
mQuickScrubController = new QuickScrubController(mActivity, this);
|
||||||
mModel = RecentsModel.INSTANCE.get(context);
|
mModel = RecentsModel.INSTANCE.get(context);
|
||||||
|
mIdp = InvariantDeviceProfile.INSTANCE.get(context);
|
||||||
|
|
||||||
mClearAllButton = (ClearAllButton) LayoutInflater.from(context)
|
mClearAllButton = (ClearAllButton) LayoutInflater.from(context)
|
||||||
.inflate(R.layout.overview_clear_all_button, this, false);
|
.inflate(R.layout.overview_clear_all_button, this, false);
|
||||||
mClearAllButton.setOnClickListener(this::dismissAllTasks);
|
mClearAllButton.setOnClickListener(this::dismissAllTasks);
|
||||||
|
@ -334,6 +341,15 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
updateTaskStackListenerState();
|
updateTaskStackListenerState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onIdpChanged(int changeFlags, InvariantDeviceProfile idp) {
|
||||||
|
if ((changeFlags & CHANGE_FLAG_ICON_PARAMS) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mModel.getIconCache().clear();
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onAttachedToWindow() {
|
protected void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
|
@ -342,6 +358,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
mActivity.addMultiWindowModeChangedListener(mMultiWindowModeChangedListener);
|
mActivity.addMultiWindowModeChangedListener(mMultiWindowModeChangedListener);
|
||||||
ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskStackListener);
|
ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskStackListener);
|
||||||
mSyncTransactionApplier = new SyncRtSurfaceTransactionApplierCompat(this);
|
mSyncTransactionApplier = new SyncRtSurfaceTransactionApplierCompat(this);
|
||||||
|
mIdp.addOnChangeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -352,6 +369,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||||
mActivity.removeMultiWindowModeChangedListener(mMultiWindowModeChangedListener);
|
mActivity.removeMultiWindowModeChangedListener(mMultiWindowModeChangedListener);
|
||||||
ActivityManagerWrapper.getInstance().unregisterTaskStackListener(mTaskStackListener);
|
ActivityManagerWrapper.getInstance().unregisterTaskStackListener(mTaskStackListener);
|
||||||
mSyncTransactionApplier = null;
|
mSyncTransactionApplier = null;
|
||||||
|
mIdp.removeOnChangeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -214,6 +214,10 @@ public class InvariantDeviceProfile {
|
||||||
mChangeListeners.add(listener);
|
mChangeListeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeOnChangeListener(OnIDPChangeListener listener) {
|
||||||
|
mChangeListeners.remove(listener);
|
||||||
|
}
|
||||||
|
|
||||||
private void killProcess(Context context) {
|
private void killProcess(Context context) {
|
||||||
Log.e("ConfigMonitor", "restarting launcher");
|
Log.e("ConfigMonitor", "restarting launcher");
|
||||||
android.os.Process.killProcess(android.os.Process.myPid());
|
android.os.Process.killProcess(android.os.Process.myPid());
|
||||||
|
|
Loading…
Reference in New Issue