Adding binder tracking support in tests

- Whitelist specific binder calls when handling touch during swipe up
  gestures
- Only track binding for touch handling and certain launcher lifecycle
  changes for now

Bug: 140246642
Change-Id: I6ba30280dd17da358662870f8719ae851536ad8b
This commit is contained in:
Winson Chung
2019-09-06 12:04:27 -07:00
parent 2e71b8351c
commit a879f9c481
9 changed files with 252 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ import android.os.Looper;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.uioverrides.DejankBinderTracker;
import com.android.launcher3.util.ResourceBasedOverride.Overrides;
import java.util.concurrent.ExecutionException;
@@ -41,7 +42,8 @@ public class MainThreadInitializedObject<T> {
public T get(Context context) {
if (mValue == null) {
if (Looper.myLooper() == Looper.getMainLooper()) {
mValue = mProvider.get(context.getApplicationContext());
mValue = DejankBinderTracker.whitelistIpcs(() ->
mProvider.get(context.getApplicationContext()));
} else {
try {
return MAIN_EXECUTOR.submit(() -> get(context)).get();