Loading core/java/android/app/ActivityManager.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,19 @@ public class ActivityManager { */ */ public static final String META_HOME_ALTERNATE = "android.app.home.alternate"; public static final String META_HOME_ALTERNATE = "android.app.home.alternate"; /** * Result for IActivityManager.startVoiceActivity: active session is currently hidden. * @hide */ public static final int START_VOICE_HIDDEN_SESSION = -10; /** * Result for IActivityManager.startVoiceActivity: active session does not match * the requesting token. * @hide */ public static final int START_VOICE_NOT_ACTIVE_SESSION = -9; /** /** * Result for IActivityManager.startActivity: trying to start a background user * Result for IActivityManager.startActivity: trying to start a background user * activity that shouldn't be displayed for all users. * activity that shouldn't be displayed for all users. Loading core/java/android/app/Instrumentation.java +10 −1 Original line number Original line Diff line number Diff line Loading @@ -1820,6 +1820,15 @@ public class Instrumentation { case ActivityManager.START_NOT_VOICE_COMPATIBLE: case ActivityManager.START_NOT_VOICE_COMPATIBLE: throw new SecurityException( throw new SecurityException( "Starting under voice control not allowed for: " + intent); "Starting under voice control not allowed for: " + intent); case ActivityManager.START_VOICE_NOT_ACTIVE_SESSION: throw new IllegalStateException( "Session calling startVoiceActivity does not match active session"); case ActivityManager.START_VOICE_HIDDEN_SESSION: throw new IllegalStateException( "Cannot start voice activity on a hidden session"); case ActivityManager.START_CANCELED: throw new AndroidRuntimeException("Activity could not be started for " + intent); default: default: throw new AndroidRuntimeException("Unknown error code " throw new AndroidRuntimeException("Unknown error code " + res + " when starting " + intent); + res + " when starting " + intent); Loading services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -183,11 +183,11 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne try { try { if (mActiveSession == null || token != mActiveSession.mToken) { if (mActiveSession == null || token != mActiveSession.mToken) { Slog.w(TAG, "startVoiceActivity does not match active session"); Slog.w(TAG, "startVoiceActivity does not match active session"); return ActivityManager.START_CANCELED; return ActivityManager.START_VOICE_NOT_ACTIVE_SESSION; } } if (!mActiveSession.mShown) { if (!mActiveSession.mShown) { Slog.w(TAG, "startVoiceActivity not allowed on hidden session"); Slog.w(TAG, "startVoiceActivity not allowed on hidden session"); return ActivityManager.START_CANCELED; return ActivityManager.START_VOICE_HIDDEN_SESSION; } } intent = new Intent(intent); intent = new Intent(intent); intent.addCategory(Intent.CATEGORY_VOICE); intent.addCategory(Intent.CATEGORY_VOICE); Loading Loading
core/java/android/app/ActivityManager.java +13 −0 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,19 @@ public class ActivityManager { */ */ public static final String META_HOME_ALTERNATE = "android.app.home.alternate"; public static final String META_HOME_ALTERNATE = "android.app.home.alternate"; /** * Result for IActivityManager.startVoiceActivity: active session is currently hidden. * @hide */ public static final int START_VOICE_HIDDEN_SESSION = -10; /** * Result for IActivityManager.startVoiceActivity: active session does not match * the requesting token. * @hide */ public static final int START_VOICE_NOT_ACTIVE_SESSION = -9; /** /** * Result for IActivityManager.startActivity: trying to start a background user * Result for IActivityManager.startActivity: trying to start a background user * activity that shouldn't be displayed for all users. * activity that shouldn't be displayed for all users. Loading
core/java/android/app/Instrumentation.java +10 −1 Original line number Original line Diff line number Diff line Loading @@ -1820,6 +1820,15 @@ public class Instrumentation { case ActivityManager.START_NOT_VOICE_COMPATIBLE: case ActivityManager.START_NOT_VOICE_COMPATIBLE: throw new SecurityException( throw new SecurityException( "Starting under voice control not allowed for: " + intent); "Starting under voice control not allowed for: " + intent); case ActivityManager.START_VOICE_NOT_ACTIVE_SESSION: throw new IllegalStateException( "Session calling startVoiceActivity does not match active session"); case ActivityManager.START_VOICE_HIDDEN_SESSION: throw new IllegalStateException( "Cannot start voice activity on a hidden session"); case ActivityManager.START_CANCELED: throw new AndroidRuntimeException("Activity could not be started for " + intent); default: default: throw new AndroidRuntimeException("Unknown error code " throw new AndroidRuntimeException("Unknown error code " + res + " when starting " + intent); + res + " when starting " + intent); Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -183,11 +183,11 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne try { try { if (mActiveSession == null || token != mActiveSession.mToken) { if (mActiveSession == null || token != mActiveSession.mToken) { Slog.w(TAG, "startVoiceActivity does not match active session"); Slog.w(TAG, "startVoiceActivity does not match active session"); return ActivityManager.START_CANCELED; return ActivityManager.START_VOICE_NOT_ACTIVE_SESSION; } } if (!mActiveSession.mShown) { if (!mActiveSession.mShown) { Slog.w(TAG, "startVoiceActivity not allowed on hidden session"); Slog.w(TAG, "startVoiceActivity not allowed on hidden session"); return ActivityManager.START_CANCELED; return ActivityManager.START_VOICE_HIDDEN_SESSION; } } intent = new Intent(intent); intent = new Intent(intent); intent.addCategory(Intent.CATEGORY_VOICE); intent.addCategory(Intent.CATEGORY_VOICE); Loading