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

Commit 666a30c6 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7490979 from 173286e2 to sc-release

Change-Id: I9a8aa2c1fe35739488479e8f854ba4037d9ccb43
parents f1f10340 173286e2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ public final class AppSearchSession implements Closeable {
            @NonNull Consumer<AppSearchResult<AppSearchSession>> callback) {
        try {
            mService.initialize(
                    mPackageName,
                    mUserHandle,
                    /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(),
                    new IAppSearchResultCallback.Stub() {
@@ -685,7 +686,9 @@ public final class AppSearchSession implements Closeable {
        if (mIsMutated && !mIsClosed) {
            try {
                mService.persistToDisk(
                        mUserHandle, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime());
                        mPackageName,
                        mUserHandle,
                        /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime());
                mIsClosed = true;
            } catch (RemoteException e) {
                Log.e(TAG, "Unable to close the AppSearchSession", e);
+4 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public class GlobalSearchSession implements Closeable {
            @NonNull Consumer<AppSearchResult<GlobalSearchSession>> callback) {
        try {
            mService.initialize(
                    mPackageName,
                    mUserHandle,
                    /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(),
                    new IAppSearchResultCallback.Stub() {
@@ -187,7 +188,9 @@ public class GlobalSearchSession implements Closeable {
        if (mIsMutated && !mIsClosed) {
            try {
                mService.persistToDisk(
                        mUserHandle, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime());
                        mPackageName,
                        mUserHandle,
                        /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime());
                mIsClosed = true;
            } catch (RemoteException e) {
                Log.e(TAG, "Unable to close the GlobalSearchSession", e);
+3 −2
Original line number Diff line number Diff line
@@ -124,7 +124,8 @@ public class SearchResults implements Closeable {
                            wrapCallback(executor, callback));
                }
            } else {
                mService.getNextPage(mNextPageToken, mUserHandle, wrapCallback(executor, callback));
                mService.getNextPage(mPackageName, mNextPageToken, mUserHandle,
                        wrapCallback(executor, callback));
            }
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
@@ -135,7 +136,7 @@ public class SearchResults implements Closeable {
    public void close() {
        if (!mIsClosed) {
            try {
                mService.invalidateNextPageToken(mNextPageToken, mUserHandle);
                mService.invalidateNextPageToken(mPackageName, mNextPageToken, mUserHandle);
                mIsClosed = true;
            } catch (RemoteException e) {
                Log.e(TAG, "Unable to close the SearchResults", e);
+18 −3
Original line number Diff line number Diff line
@@ -181,21 +181,30 @@ interface IAppSearchManager {
     * Fetches the next page of results of a previously executed query. Results can be empty if
     * next-page token is invalid or all pages have been returned.
     *
     * @param packageName The name of the package to persist to disk for.
     * @param nextPageToken The token of pre-loaded results of previously executed query.
     * @param userHandle Handle of the calling user
     * @param callback {@link AppSearchResult}&lt;{@link Bundle}&gt; of performing this
     *                  operation.
     */
    void getNextPage(in long nextPageToken, in UserHandle userHandle, in IAppSearchResultCallback callback);
    void getNextPage(
        in String packageName,
        in long nextPageToken,
        in UserHandle userHandle,
        in IAppSearchResultCallback callback);

    /**
     * Invalidates the next-page token so that no more results of the related query can be returned.
     *
     * @param packageName The name of the package to persist to disk for.
     * @param nextPageToken The token of pre-loaded results of previously executed query to be
     *                      Invalidated.
     * @param userHandle Handle of the calling user
     */
    void invalidateNextPageToken(in long nextPageToken, in UserHandle userHandle);
    void invalidateNextPageToken(
        in String packageName,
        in long nextPageToken,
        in UserHandle userHandle);

    /**
    * Searches a document based on a given specifications.
@@ -336,20 +345,26 @@ interface IAppSearchManager {
    /**
     * Persists all update/delete requests to the disk.
     *
     * @param packageName The name of the package to persist to disk for.
     * @param userHandle Handle of the calling user
     * @param binderCallStartTimeMillis start timestamp of binder call in Millis
     */
    void persistToDisk(in UserHandle userHandle, in long binderCallStartTimeMillis);
    void persistToDisk(
        in String packageName,
        in UserHandle userHandle,
        in long binderCallStartTimeMillis);

    /**
     * Creates and initializes AppSearchImpl for the calling app.
     *
     * @param packageName The name of the package to initialize for.
     * @param userHandle Handle of the calling user
     * @param binderCallStartTimeMillis start timestamp of binder call in Millis
     * @param callback {@link IAppSearchResultCallback#onResult} will be called with an
     *     {@link AppSearchResult}&lt;{@link Void}&gt;.
     */
    void initialize(
        in String packageName,
        in UserHandle userHandle,
        in long binderCallStartTimeMillis,
        in IAppSearchResultCallback callback);
+0 −11
Original line number Diff line number Diff line
@@ -96,17 +96,6 @@ public final class AppSearchBatchResult<KeyType, ValueType> {
        return Collections.unmodifiableMap(mAll);
    }

    /**
     * Asserts that this {@link AppSearchBatchResult} has no failures.
     *
     * @hide
     */
    public void checkSuccess() {
        if (!isSuccess()) {
            throw new IllegalStateException("AppSearchBatchResult has failures: " + this);
        }
    }

    @Override
    @NonNull
    public String toString() {
Loading