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

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

Merge "Add IPC latency in extras." into tm-qpr-dev

parents 455985f9 955c8453
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -23,9 +23,11 @@ import android.app.search.ISearchCallback.Stub;
import android.content.Context;
import android.content.pm.ParceledListSlice;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.util.Log;

import dalvik.system.CloseGuard;
@@ -229,7 +231,14 @@ public final class SearchSession implements AutoCloseable{
                if (DEBUG) {
                    Log.d(TAG, "CallbackWrapper.onResult result=" + result.getList());
                }
                mExecutor.execute(() -> mCallback.accept(result.getList()));
                List<SearchTarget> list = result.getList();
                if (list.size() > 0) {
                    Bundle bundle = list.get(0).getExtras();
                    if (bundle != null) {
                        bundle.putLong("key_ipc_start", SystemClock.elapsedRealtime());
                    }
                }
                mExecutor.execute(() -> mCallback.accept(list));
            } finally {
                Binder.restoreCallingIdentity(identity);
            }