Unifying activity tracker callback

> Using a common class for both Launcher and RecentsActivity
> Removing static refenrece to LauncherModel and using a common pattern for
  tracking activities

Bug: 141376165
Bug: 137568159
Change-Id: Ic1897abe6913ec78e25725118eedf5b468d5ec70
This commit is contained in:
Sunny Goyal
2019-09-26 17:05:31 -07:00
parent f7a2971530
commit e84c5b82be
24 changed files with 239 additions and 349 deletions
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.launcher3.util;
import android.os.Binder;
import android.os.IBinder;
/**
* Utility class to pass non-parcealable objects within same process using parcealable payload.
*
* It wraps the object in a binder as binders are singleton within a process
*/
public class ObjectWrapper<T> extends Binder {
private final T mObject;
public ObjectWrapper(T object) {
mObject = object;
}
public T get() {
return mObject;
}
public static IBinder wrap(Object obj) {
return new ObjectWrapper<>(obj);
}
}