Loading core/java/android/app/Activity.java +14 −4 Original line number Diff line number Diff line Loading @@ -3498,14 +3498,24 @@ public class Activity extends ContextThemeWrapper * <p>You can override this function to force global search, e.g. in response to a dedicated * search key, or to block search entirely (by simply returning false). * * @return Returns {@code true} if search launched, and {@code false} if activity blocks it. * The default implementation always returns {@code true}. * <p>Note: when running in a {@link Configuration#UI_MODE_TYPE_TELEVISION}, the default * implementation changes to simply return false and you must supply your own custom * implementation if you want to support search.</p> * * @return Returns {@code true} if search launched, and {@code false} if the activity does * not respond to search. The default implementation always returns {@code true}, except * when in {@link Configuration#UI_MODE_TYPE_TELEVISION} mode where it returns false. * * @see android.app.SearchManager */ public boolean onSearchRequested() { if ((getResources().getConfiguration().uiMode&Configuration.UI_MODE_TYPE_MASK) != Configuration.UI_MODE_TYPE_TELEVISION) { startSearch(null, false, null, false); return true; } else { return false; } } /** Loading core/java/android/app/ActivityManagerNative.java +30 −1 Original line number Diff line number Diff line Loading @@ -2102,6 +2102,18 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } case LAUNCH_ASSIST_INTENT_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); Intent intent = Intent.CREATOR.createFromParcel(data); int requestType = data.readInt(); String hint = data.readString(); int userHandle = data.readInt(); boolean res = launchAssistIntent(intent, requestType, hint, userHandle); reply.writeNoException(); reply.writeInt(res ? 1 : 0); return true; } case KILL_UID_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); Loading Loading @@ -5039,6 +5051,23 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); } public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); intent.writeToParcel(data, 0); data.writeInt(requestType); data.writeString(hint); data.writeInt(userHandle); mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); reply.readException(); boolean res = reply.readInt() != 0; data.recycle(); reply.recycle(); return res; } public void killUid(int uid, String reason) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); Loading core/java/android/app/IActivityManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -417,6 +417,9 @@ public interface IActivityManager extends IInterface { public void reportAssistContextExtras(IBinder token, Bundle extras) throws RemoteException; public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle) throws RemoteException; public void killUid(int uid, String reason) throws RemoteException; public void hang(IBinder who, boolean allowRestart) throws RemoteException; Loading Loading @@ -777,4 +780,5 @@ public interface IActivityManager extends IInterface { int RELEASE_SOME_ACTIVITIES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+236; int BOOT_ANIMATION_COMPLETE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+237; int GET_TASK_DESCRIPTION_ICON_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+238; int LAUNCH_ASSIST_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+239; } core/java/android/app/ISearchManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -31,4 +31,5 @@ interface ISearchManager { ComponentName getGlobalSearchActivity(); ComponentName getWebSearchActivity(); ComponentName getAssistIntent(int userHandle); boolean launchAssistAction(int requestType, String hint, int userHandle); } core/java/android/app/SearchManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -989,4 +989,20 @@ public class SearchManager return null; } } /** * Launch an assist action for the current top activity. * @hide */ public boolean launchAssistAction(int requestType, String hint, int userHandle) { try { if (mService == null) { return false; } return mService.launchAssistAction(requestType, hint, userHandle); } catch (RemoteException re) { Log.e(TAG, "launchAssistAction() failed: " + re); return false; } } } Loading
core/java/android/app/Activity.java +14 −4 Original line number Diff line number Diff line Loading @@ -3498,14 +3498,24 @@ public class Activity extends ContextThemeWrapper * <p>You can override this function to force global search, e.g. in response to a dedicated * search key, or to block search entirely (by simply returning false). * * @return Returns {@code true} if search launched, and {@code false} if activity blocks it. * The default implementation always returns {@code true}. * <p>Note: when running in a {@link Configuration#UI_MODE_TYPE_TELEVISION}, the default * implementation changes to simply return false and you must supply your own custom * implementation if you want to support search.</p> * * @return Returns {@code true} if search launched, and {@code false} if the activity does * not respond to search. The default implementation always returns {@code true}, except * when in {@link Configuration#UI_MODE_TYPE_TELEVISION} mode where it returns false. * * @see android.app.SearchManager */ public boolean onSearchRequested() { if ((getResources().getConfiguration().uiMode&Configuration.UI_MODE_TYPE_MASK) != Configuration.UI_MODE_TYPE_TELEVISION) { startSearch(null, false, null, false); return true; } else { return false; } } /** Loading
core/java/android/app/ActivityManagerNative.java +30 −1 Original line number Diff line number Diff line Loading @@ -2102,6 +2102,18 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } case LAUNCH_ASSIST_INTENT_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); Intent intent = Intent.CREATOR.createFromParcel(data); int requestType = data.readInt(); String hint = data.readString(); int userHandle = data.readInt(); boolean res = launchAssistIntent(intent, requestType, hint, userHandle); reply.writeNoException(); reply.writeInt(res ? 1 : 0); return true; } case KILL_UID_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); Loading Loading @@ -5039,6 +5051,23 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); } public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); intent.writeToParcel(data, 0); data.writeInt(requestType); data.writeString(hint); data.writeInt(userHandle); mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0); reply.readException(); boolean res = reply.readInt() != 0; data.recycle(); reply.recycle(); return res; } public void killUid(int uid, String reason) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); Loading
core/java/android/app/IActivityManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -417,6 +417,9 @@ public interface IActivityManager extends IInterface { public void reportAssistContextExtras(IBinder token, Bundle extras) throws RemoteException; public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle) throws RemoteException; public void killUid(int uid, String reason) throws RemoteException; public void hang(IBinder who, boolean allowRestart) throws RemoteException; Loading Loading @@ -777,4 +780,5 @@ public interface IActivityManager extends IInterface { int RELEASE_SOME_ACTIVITIES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+236; int BOOT_ANIMATION_COMPLETE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+237; int GET_TASK_DESCRIPTION_ICON_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+238; int LAUNCH_ASSIST_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+239; }
core/java/android/app/ISearchManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -31,4 +31,5 @@ interface ISearchManager { ComponentName getGlobalSearchActivity(); ComponentName getWebSearchActivity(); ComponentName getAssistIntent(int userHandle); boolean launchAssistAction(int requestType, String hint, int userHandle); }
core/java/android/app/SearchManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -989,4 +989,20 @@ public class SearchManager return null; } } /** * Launch an assist action for the current top activity. * @hide */ public boolean launchAssistAction(int requestType, String hint, int userHandle) { try { if (mService == null) { return false; } return mService.launchAssistAction(requestType, hint, userHandle); } catch (RemoteException re) { Log.e(TAG, "launchAssistAction() failed: " + re); return false; } } }