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

Commit 955c8453 authored by Holly Sun's avatar Holly Sun
Browse files

Add IPC latency in extras.

Bug: 255527960
Test: build and flash to phone
Change-Id: I5ad830d96e9aa2f3b285fd7ed59f67e0070c4dcf
parent 00773c6a
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);
            }