summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Felipe Leme <felipeal@google.com> 2019-05-14 15:19:52 -0700
committer Felipe Leme <felipeal@google.com> 2019-05-15 22:40:38 +0000
commitada518457491bf6e5074a607eb484fc26d7ee1be (patch)
tree7051fec0aa27ab301bc9ddfc7db0adf65fb5c958
parent8092cdaeda1c81af3f00bbc2931d5bbd11c9d937 (diff)
Minor improvements on voice interaction workflows.
Bug: 131411751 Fixes: 132783948 Test: atest CtsVoiceInteractionTestCases CtsAssistTestCases Change-Id: I28c8577caa35a783863f4313487c6e9b9abc8ff2
-rw-r--r--core/java/android/app/ActivityThread.java3
-rw-r--r--services/core/java/com/android/server/audio/AudioService.java8
2 files changed, 9 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index ca04536af4c0..97dba429595f 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -123,7 +123,6 @@ import android.provider.Settings;
import android.renderscript.RenderScriptCacheDir;
import android.security.NetworkSecurityPolicy;
import android.security.net.config.NetworkSecurityConfigProvider;
-import android.service.voice.VoiceInteractionSession;
import android.system.ErrnoException;
import android.system.OsConstants;
import android.system.StructStat;
@@ -3555,11 +3554,13 @@ public final class ActivityThread extends ClientTransactionHandler {
@NonNull RemoteCallback callback) {
final ActivityClientRecord r = mActivities.get(activityToken);
if (r == null) {
+ Log.w(TAG, "requestDirectActions(): no activity for " + activityToken);
callback.sendResult(null);
return;
}
final int lifecycleState = r.getLifecycleState();
if (lifecycleState < ON_START || lifecycleState >= ON_STOP) {
+ Log.w(TAG, "requestDirectActions(" + r + "): wrong lifecycle: " + lifecycleState);
callback.sendResult(null);
return;
}
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 4cde931d2ef5..355140c75bee 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -1452,7 +1452,13 @@ public class AudioService extends IAudioService.Stub
Settings.Secure.ASSISTANT, UserHandle.USER_CURRENT);
}
if (!TextUtils.isEmpty(assistantName)) {
- packageName = ComponentName.unflattenFromString(assistantName).getPackageName();
+ ComponentName componentName = ComponentName.unflattenFromString(assistantName);
+ if (componentName == null) {
+ Slog.w(TAG, "Invalid service name for "
+ + Settings.Secure.VOICE_INTERACTION_SERVICE + ": " + assistantName);
+ return;
+ }
+ packageName = componentName.getPackageName();
}
}
if (!TextUtils.isEmpty(packageName)) {