diff options
author | Dianne Hackborn <hackbod@google.com> | 2014-10-08 17:43:48 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2014-10-09 10:37:19 -0700 |
commit | fdf5b35ab46639759d6389a4e2a4d5799cb6814b (patch) | |
tree | 2d8e17d3f7323290237308f40dccd5bdd7890f46 /services/core/java/com/android/server/search | |
parent | 5e5bc4b13cd1fc657da940c14e2333d8d3b18080 (diff) | |
download | frameworks_base-fdf5b35ab46639759d6389a4e2a4d5799cb6814b.zip frameworks_base-fdf5b35ab46639759d6389a4e2a4d5799cb6814b.tar.gz frameworks_base-fdf5b35ab46639759d6389a4e2a4d5799cb6814b.tar.bz2 |
Implement issue #17906468: Allow search request to fall back to global search
Change-Id: I04834b2a9f1ec4a68c6a3fed14da2f8dd93b3be7
Diffstat (limited to 'services/core/java/com/android/server/search')
-rw-r--r-- | services/core/java/com/android/server/search/SearchManagerService.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/search/SearchManagerService.java b/services/core/java/com/android/server/search/SearchManagerService.java index 5deb2b8..ddf02e9 100644 --- a/services/core/java/com/android/server/search/SearchManagerService.java +++ b/services/core/java/com/android/server/search/SearchManagerService.java @@ -17,7 +17,9 @@ package com.android.server.search; import android.app.ActivityManager; +import android.app.ActivityManagerNative; import android.app.AppGlobals; +import android.app.IActivityManager; import android.app.ISearchManager; import android.app.SearchManager; import android.app.SearchableInfo; @@ -32,6 +34,7 @@ import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.database.ContentObserver; import android.os.Binder; +import android.os.Bundle; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; @@ -262,6 +265,25 @@ public class SearchManagerService extends ISearchManager.Stub { } @Override + public boolean launchAssistAction(int requestType, String hint, int userHandle) { + ComponentName comp = getAssistIntent(userHandle); + if (comp == null) { + return false; + } + long ident = Binder.clearCallingIdentity(); + try { + Intent intent = new Intent(Intent.ACTION_ASSIST); + intent.setComponent(comp); + IActivityManager am = ActivityManagerNative.getDefault(); + return am.launchAssistIntent(intent, requestType, hint, userHandle); + } catch (RemoteException e) { + } finally { + Binder.restoreCallingIdentity(ident); + } + return true; + } + + @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG); |