summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorTim Kilbourn <tkilbourn@google.com>2015-06-08 16:46:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-08 16:46:42 +0000
commit159f558a39d200e08e06245d64ec1df9a08e7d93 (patch)
tree3bc7299e40c9c153df85768871a37e425afd59dc /core/java
parent20ac61b8c0abd5af4ce32707e01cc1a501cbb7f0 (diff)
parent0e5f110fc915a9b044eb04cd07ae7ac588eacc8f (diff)
downloadframeworks_base-159f558a39d200e08e06245d64ec1df9a08e7d93.zip
frameworks_base-159f558a39d200e08e06245d64ec1df9a08e7d93.tar.gz
frameworks_base-159f558a39d200e08e06245d64ec1df9a08e7d93.tar.bz2
Merge "Pass an args bundle to launchAssistAction." into mnc-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ActivityManagerNative.java8
-rw-r--r--core/java/android/app/IActivityManager.java4
-rw-r--r--core/java/android/app/ISearchManager.aidl2
-rw-r--r--core/java/android/app/SearchManager.java4
-rw-r--r--core/java/android/content/Intent.java7
-rw-r--r--core/java/com/android/internal/policy/PhoneWindow.java5
6 files changed, 21 insertions, 9 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 44e47f8..bb553e4 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -2208,7 +2208,8 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
int requestType = data.readInt();
String hint = data.readString();
int userHandle = data.readInt();
- boolean res = launchAssistIntent(intent, requestType, hint, userHandle);
+ Bundle args = data.readBundle();
+ boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
reply.writeNoException();
reply.writeInt(res ? 1 : 0);
return true;
@@ -5389,8 +5390,8 @@ class ActivityManagerProxy implements IActivityManager
reply.recycle();
}
- public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle)
- throws RemoteException {
+ public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
+ Bundle args) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
@@ -5398,6 +5399,7 @@ class ActivityManagerProxy implements IActivityManager
data.writeInt(requestType);
data.writeString(hint);
data.writeInt(userHandle);
+ data.writeBundle(args);
mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
reply.readException();
boolean res = reply.readInt() != 0;
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 2430ccd..e87eabe 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -438,8 +438,8 @@ public interface IActivityManager extends IInterface {
public void reportAssistContextExtras(IBinder token, Bundle extras,
AssistStructure structure, AssistContent content) throws RemoteException;
- public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle)
- throws RemoteException;
+ public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
+ Bundle args) throws RemoteException;
public void killUid(int uid, String reason) throws RemoteException;
diff --git a/core/java/android/app/ISearchManager.aidl b/core/java/android/app/ISearchManager.aidl
index 6d27910..6094012 100644
--- a/core/java/android/app/ISearchManager.aidl
+++ b/core/java/android/app/ISearchManager.aidl
@@ -31,5 +31,5 @@ interface ISearchManager {
ComponentName getGlobalSearchActivity();
ComponentName getWebSearchActivity();
ComponentName getAssistIntent(int userHandle);
- boolean launchAssistAction(String hint, int userHandle);
+ boolean launchAssistAction(String hint, int userHandle, in Bundle args);
}
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index fa27631..45799a1 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -985,12 +985,12 @@ public class SearchManager
* Launch an assist action for the current top activity.
* @hide
*/
- public boolean launchAssistAction(String hint, int userHandle) {
+ public boolean launchAssistAction(String hint, int userHandle, Bundle args) {
try {
if (mService == null) {
return false;
}
- return mService.launchAssistAction(hint, userHandle);
+ return mService.launchAssistAction(hint, userHandle, args);
} catch (RemoteException re) {
Log.e(TAG, "launchAssistAction() failed: " + re);
return false;
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index c01ce4f..5c23204 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1274,6 +1274,13 @@ public class Intent implements Parcelable, Cloneable {
"android.intent.extra.ASSIST_INPUT_HINT_KEYBOARD";
/**
+ * An optional field on {@link #ACTION_ASSIST} containing the InputDevice id
+ * that was used to invoke the assist.
+ */
+ public static final String EXTRA_ASSIST_INPUT_DEVICE_ID =
+ "android.intent.extra.ASSIST_INPUT_DEVICE_ID";
+
+ /**
* Activity Action: List all available applications
* <p>Input: Nothing.
* <p>Output: nothing.
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java
index 14065b1..c010dfe 100644
--- a/core/java/com/android/internal/policy/PhoneWindow.java
+++ b/core/java/com/android/internal/policy/PhoneWindow.java
@@ -75,6 +75,7 @@ import com.android.internal.widget.SwipeDismissLayout;
import android.app.ActivityManager;
import android.app.KeyguardManager;
import android.content.Context;
+import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources.Theme;
@@ -4319,8 +4320,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
if (!result && (getContext().getResources().getConfiguration().uiMode
& Configuration.UI_MODE_TYPE_MASK) == Configuration.UI_MODE_TYPE_TELEVISION) {
// On TVs, if the app doesn't implement search, we want to launch assist.
+ Bundle args = new Bundle();
+ args.putInt(Intent.EXTRA_ASSIST_INPUT_DEVICE_ID, event.getDeviceId());
return ((SearchManager)getContext().getSystemService(Context.SEARCH_SERVICE))
- .launchAssistAction(null, UserHandle.myUserId());
+ .launchAssistAction(null, UserHandle.myUserId(), args);
}
return result;
}