Loading apex/appsearch/framework/java/android/app/appsearch/AppSearchSession.java +8 −1 Original line number Diff line number Diff line Loading @@ -353,6 +353,7 @@ public final class AppSearchSession implements Closeable { new ArrayList<>(request.getIds()), request.getProjectionsInternal(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchBatchResultCallback.Stub() { @Override public void onResult(AppSearchBatchResultParcel resultParcel) { Loading Loading @@ -566,6 +567,7 @@ public final class AppSearchSession implements Closeable { try { mService.removeByDocumentId(mPackageName, mDatabaseName, request.getNamespace(), new ArrayList<>(request.getIds()), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchBatchResultCallback.Stub() { @Override public void onResult(AppSearchBatchResultParcel resultParcel) { Loading Loading @@ -616,6 +618,7 @@ public final class AppSearchSession implements Closeable { try { mService.removeByQuery(mPackageName, mDatabaseName, queryExpression, searchSpec.getBundle(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchResultCallback.Stub() { @Override public void onResult(AppSearchResultParcel resultParcel) { Loading Loading @@ -675,7 +678,8 @@ public final class AppSearchSession implements Closeable { public void close() { if (mIsMutated && !mIsClosed) { try { mService.persistToDisk(mUserId); mService.persistToDisk(mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime()); mIsClosed = true; } catch (RemoteException e) { Log.e(TAG, "Unable to close the AppSearchSession", e); Loading Loading @@ -705,6 +709,7 @@ public final class AppSearchSession implements Closeable { request.isForceOverride(), request.getVersion(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchResultCallback.Stub() { @Override public void onResult(AppSearchResultParcel resultParcel) { Loading Loading @@ -792,6 +797,7 @@ public final class AppSearchSession implements Closeable { /*forceOverride=*/ false, request.getVersion(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchResultCallback.Stub() { @Override public void onResult(AppSearchResultParcel resultParcel) { Loading Loading @@ -843,6 +849,7 @@ public final class AppSearchSession implements Closeable { /*forceOverride=*/ true, request.getVersion(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchResultCallback.Stub() { @Override public void onResult(AppSearchResultParcel resultParcel) { Loading apex/appsearch/framework/java/android/app/appsearch/GlobalSearchSession.java +2 −1 Original line number Diff line number Diff line Loading @@ -186,7 +186,8 @@ public class GlobalSearchSession implements Closeable { public void close() { if (mIsMutated && !mIsClosed) { try { mService.persistToDisk(mUserId); mService.persistToDisk(mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime()); mIsClosed = true; } catch (RemoteException e) { Log.e(TAG, "Unable to close the GlobalSearchSession", e); Loading apex/appsearch/framework/java/android/app/appsearch/aidl/IAppSearchManager.aidl +10 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ interface IAppSearchManager { * incompatible documents will be deleted. * @param schemaVersion The overall schema version number of the request. * @param userId Id 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}<{@link Bundle}>, where the value are * {@link SetSchemaResponse} bundle. Loading @@ -50,6 +51,7 @@ interface IAppSearchManager { boolean forceOverride, in int schemaVersion, in int userId, in long binderCallStartTimeMillis, in IAppSearchResultCallback callback); /** Loading Loading @@ -115,6 +117,7 @@ interface IAppSearchManager { * @param typePropertyPaths A map of schema type to a list of property paths to return in the * result. * @param userId Id of the calling user * @param binderCallStartTimeMillis start timestamp of binder call in Millis * @param callback * If the call fails to start, {@link IAppSearchBatchResultCallback#onSystemError} * will be called with the cause throwable. Otherwise, Loading @@ -129,6 +132,7 @@ interface IAppSearchManager { in List<String> ids, in Map<String, List<String>> typePropertyPaths, in int userId, in long binderCallStartTimeMillis, in IAppSearchBatchResultCallback callback); /** Loading Loading @@ -273,6 +277,7 @@ interface IAppSearchManager { * @param namespace Namespace of the document to remove. * @param ids The IDs of the documents to delete * @param userId Id of the calling user * @param binderCallStartTimeMillis start timestamp of binder call in Millis * @param callback * If the call fails to start, {@link IAppSearchBatchResultCallback#onSystemError} * will be called with the cause throwable. Otherwise, Loading @@ -287,6 +292,7 @@ interface IAppSearchManager { in String namespace, in List<String> ids, in int userId, in long binderCallStartTimeMillis, in IAppSearchBatchResultCallback callback); /** Loading @@ -297,6 +303,7 @@ interface IAppSearchManager { * @param queryExpression String to search for * @param searchSpecBundle SearchSpec bundle * @param userId Id 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}<{@link Void}>. */ Loading @@ -306,6 +313,7 @@ interface IAppSearchManager { in String queryExpression, in Bundle searchSpecBundle, in int userId, in long binderCallStartTimeMillis, in IAppSearchResultCallback callback); /** Loading @@ -328,8 +336,9 @@ interface IAppSearchManager { * Persists all update/delete requests to the disk. * * @param userId Id of the calling user * @param binderCallStartTimeMillis start timestamp of binder call in Millis */ void persistToDisk(in int userId); void persistToDisk(in int userId, in long binderCallStartTimeMillis); /** * Creates and initializes AppSearchImpl for the calling app. Loading apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java +168 −4 File changed.Preview size limit exceeded, changes collapsed. Show changes services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java +9 −4 Original line number Diff line number Diff line Loading @@ -661,7 +661,8 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { public void setSchema(String packageName, String databaseName, List<Bundle> schemaBundles, List<String> schemasNotPlatformSurfaceable, Map<String, List<Bundle>> schemasPackageAccessibleBundles, boolean forceOverride, int userId, int version, IAppSearchResultCallback callback) throws RemoteException { int userId, int version, long binderCallStartTimeMillis, IAppSearchResultCallback callback) throws RemoteException { for (Map.Entry<String, List<Bundle>> entry : schemasPackageAccessibleBundles.entrySet()) { final String key = entry.getKey(); Loading Loading @@ -721,6 +722,7 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { @Override public void getDocuments(String packageName, String databaseName, String namespace, List<String> ids, Map<String, List<String>> typePropertyPaths, int userId, long binderCallStartTimeMillis, IAppSearchBatchResultCallback callback) throws RemoteException { final AppSearchBatchResult.Builder<String, Bundle> builder = new AppSearchBatchResult.Builder<>(); Loading Loading @@ -822,7 +824,8 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { @Override public void removeByDocumentId(String packageName, String databaseName, String namespace, List<String> ids, int userId, IAppSearchBatchResultCallback callback) List<String> ids, int userId, long binderCallStartTimeMillis, IAppSearchBatchResultCallback callback) throws RemoteException { final AppSearchBatchResult.Builder<String, Void> builder = new AppSearchBatchResult.Builder<>(); Loading @@ -849,7 +852,8 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { @Override public void removeByQuery(String packageName, String databaseName, String queryExpression, Bundle searchSpecBundle, int userId, IAppSearchResultCallback callback) Bundle searchSpecBundle, int userId, long binderCallStartTimeMillis, IAppSearchResultCallback callback) throws RemoteException { final String key = getKey(userId, databaseName); if (!mDocumentMap.containsKey(key)) { Loading @@ -869,7 +873,8 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { } @Override public void persistToDisk(int userId) throws RemoteException { public void persistToDisk(int userId, long binderCallStartTimeMillis) throws RemoteException { } Loading Loading
apex/appsearch/framework/java/android/app/appsearch/AppSearchSession.java +8 −1 Original line number Diff line number Diff line Loading @@ -353,6 +353,7 @@ public final class AppSearchSession implements Closeable { new ArrayList<>(request.getIds()), request.getProjectionsInternal(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchBatchResultCallback.Stub() { @Override public void onResult(AppSearchBatchResultParcel resultParcel) { Loading Loading @@ -566,6 +567,7 @@ public final class AppSearchSession implements Closeable { try { mService.removeByDocumentId(mPackageName, mDatabaseName, request.getNamespace(), new ArrayList<>(request.getIds()), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchBatchResultCallback.Stub() { @Override public void onResult(AppSearchBatchResultParcel resultParcel) { Loading Loading @@ -616,6 +618,7 @@ public final class AppSearchSession implements Closeable { try { mService.removeByQuery(mPackageName, mDatabaseName, queryExpression, searchSpec.getBundle(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchResultCallback.Stub() { @Override public void onResult(AppSearchResultParcel resultParcel) { Loading Loading @@ -675,7 +678,8 @@ public final class AppSearchSession implements Closeable { public void close() { if (mIsMutated && !mIsClosed) { try { mService.persistToDisk(mUserId); mService.persistToDisk(mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime()); mIsClosed = true; } catch (RemoteException e) { Log.e(TAG, "Unable to close the AppSearchSession", e); Loading Loading @@ -705,6 +709,7 @@ public final class AppSearchSession implements Closeable { request.isForceOverride(), request.getVersion(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchResultCallback.Stub() { @Override public void onResult(AppSearchResultParcel resultParcel) { Loading Loading @@ -792,6 +797,7 @@ public final class AppSearchSession implements Closeable { /*forceOverride=*/ false, request.getVersion(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchResultCallback.Stub() { @Override public void onResult(AppSearchResultParcel resultParcel) { Loading Loading @@ -843,6 +849,7 @@ public final class AppSearchSession implements Closeable { /*forceOverride=*/ true, request.getVersion(), mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime(), new IAppSearchResultCallback.Stub() { @Override public void onResult(AppSearchResultParcel resultParcel) { Loading
apex/appsearch/framework/java/android/app/appsearch/GlobalSearchSession.java +2 −1 Original line number Diff line number Diff line Loading @@ -186,7 +186,8 @@ public class GlobalSearchSession implements Closeable { public void close() { if (mIsMutated && !mIsClosed) { try { mService.persistToDisk(mUserId); mService.persistToDisk(mUserId, /*binderCallStartTimeMillis=*/ SystemClock.elapsedRealtime()); mIsClosed = true; } catch (RemoteException e) { Log.e(TAG, "Unable to close the GlobalSearchSession", e); Loading
apex/appsearch/framework/java/android/app/appsearch/aidl/IAppSearchManager.aidl +10 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ interface IAppSearchManager { * incompatible documents will be deleted. * @param schemaVersion The overall schema version number of the request. * @param userId Id 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}<{@link Bundle}>, where the value are * {@link SetSchemaResponse} bundle. Loading @@ -50,6 +51,7 @@ interface IAppSearchManager { boolean forceOverride, in int schemaVersion, in int userId, in long binderCallStartTimeMillis, in IAppSearchResultCallback callback); /** Loading Loading @@ -115,6 +117,7 @@ interface IAppSearchManager { * @param typePropertyPaths A map of schema type to a list of property paths to return in the * result. * @param userId Id of the calling user * @param binderCallStartTimeMillis start timestamp of binder call in Millis * @param callback * If the call fails to start, {@link IAppSearchBatchResultCallback#onSystemError} * will be called with the cause throwable. Otherwise, Loading @@ -129,6 +132,7 @@ interface IAppSearchManager { in List<String> ids, in Map<String, List<String>> typePropertyPaths, in int userId, in long binderCallStartTimeMillis, in IAppSearchBatchResultCallback callback); /** Loading Loading @@ -273,6 +277,7 @@ interface IAppSearchManager { * @param namespace Namespace of the document to remove. * @param ids The IDs of the documents to delete * @param userId Id of the calling user * @param binderCallStartTimeMillis start timestamp of binder call in Millis * @param callback * If the call fails to start, {@link IAppSearchBatchResultCallback#onSystemError} * will be called with the cause throwable. Otherwise, Loading @@ -287,6 +292,7 @@ interface IAppSearchManager { in String namespace, in List<String> ids, in int userId, in long binderCallStartTimeMillis, in IAppSearchBatchResultCallback callback); /** Loading @@ -297,6 +303,7 @@ interface IAppSearchManager { * @param queryExpression String to search for * @param searchSpecBundle SearchSpec bundle * @param userId Id 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}<{@link Void}>. */ Loading @@ -306,6 +313,7 @@ interface IAppSearchManager { in String queryExpression, in Bundle searchSpecBundle, in int userId, in long binderCallStartTimeMillis, in IAppSearchResultCallback callback); /** Loading @@ -328,8 +336,9 @@ interface IAppSearchManager { * Persists all update/delete requests to the disk. * * @param userId Id of the calling user * @param binderCallStartTimeMillis start timestamp of binder call in Millis */ void persistToDisk(in int userId); void persistToDisk(in int userId, in long binderCallStartTimeMillis); /** * Creates and initializes AppSearchImpl for the calling app. Loading
apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java +168 −4 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/tests/servicestests/src/com/android/server/pm/BaseShortcutManagerTest.java +9 −4 Original line number Diff line number Diff line Loading @@ -661,7 +661,8 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { public void setSchema(String packageName, String databaseName, List<Bundle> schemaBundles, List<String> schemasNotPlatformSurfaceable, Map<String, List<Bundle>> schemasPackageAccessibleBundles, boolean forceOverride, int userId, int version, IAppSearchResultCallback callback) throws RemoteException { int userId, int version, long binderCallStartTimeMillis, IAppSearchResultCallback callback) throws RemoteException { for (Map.Entry<String, List<Bundle>> entry : schemasPackageAccessibleBundles.entrySet()) { final String key = entry.getKey(); Loading Loading @@ -721,6 +722,7 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { @Override public void getDocuments(String packageName, String databaseName, String namespace, List<String> ids, Map<String, List<String>> typePropertyPaths, int userId, long binderCallStartTimeMillis, IAppSearchBatchResultCallback callback) throws RemoteException { final AppSearchBatchResult.Builder<String, Bundle> builder = new AppSearchBatchResult.Builder<>(); Loading Loading @@ -822,7 +824,8 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { @Override public void removeByDocumentId(String packageName, String databaseName, String namespace, List<String> ids, int userId, IAppSearchBatchResultCallback callback) List<String> ids, int userId, long binderCallStartTimeMillis, IAppSearchBatchResultCallback callback) throws RemoteException { final AppSearchBatchResult.Builder<String, Void> builder = new AppSearchBatchResult.Builder<>(); Loading @@ -849,7 +852,8 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { @Override public void removeByQuery(String packageName, String databaseName, String queryExpression, Bundle searchSpecBundle, int userId, IAppSearchResultCallback callback) Bundle searchSpecBundle, int userId, long binderCallStartTimeMillis, IAppSearchResultCallback callback) throws RemoteException { final String key = getKey(userId, databaseName); if (!mDocumentMap.containsKey(key)) { Loading @@ -869,7 +873,8 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase { } @Override public void persistToDisk(int userId) throws RemoteException { public void persistToDisk(int userId, long binderCallStartTimeMillis) throws RemoteException { } Loading