The original proximity feature which returned the distance in meters was
determined to be too privacy-invasive. AttentionManagerService continue
to receive proximity in distance from Attention Service, but
HotwordDetectedResult will map it
to different proximity levels, near and far. These proximity levels will be used in HotwordDetectionConnection. Use a RequiredServiceRule to make sure we only run the test if the device has the attention service
Bug: 253326426
Test: atest CtsVoiceInteractionTestCases
Change-Id: I4d55564c39d48dd1869d747beb37f81170c102f6
Migrates all existing java methods annotated with @EnforcePermission
such that they call the super.<methodName>_enforcePermission
method provided by PermissionEnforcer.
This required by the @EnforcePermission annotation, but is currently a no-op, and will be switched on with ag/20325484.
Bug: 234083358
Test: TH
Change-Id: Ib2a5f22cb4558a325cb7f11dd35c453afdb887d2
The class was replaced with EventLogger for deduplication purposes
Bug: b/254234346
Test: I don't think there are any tests for soundtrigger
Change-Id: I1e80a3b31696d010aca8d267af713a9e7ff6a6e6
By trusted hotword design doc, the VALIDATION_TIMEOUT_MILLIS value
should be 3000 ms. We correct the VALIDATION_TIMEOUT_MILLIS.
Test: atest CtsVoiceInteractionTestCases
Bug: 193232191
Change-Id: I4e8f3fbaeb305373e4b964a45e5e26b3e3684bd5
By the original design, we register the activity event in the
ActivityManagerService. After getting the activity event, we will
query current visible activities and report them to Assistant.
Assistant will start to get direct actions of those visible
activities. But sometimes they can not get the direct actions
due to the stage of activity lifecycle before onStart().
We change the logic to make sure that the stage of visible
activity that we reported to the Assistant is after onStart().
Bug: 235296082
Test: atest VoiceInteractionSessionVisibleActivityTest
Test: atest android.app.activity.ActivityThreadClientTest
Test: atest android.view.DisplayTest
Test: atest android.window.ConfigurationHelperTest
Test: atest android.window.SizeConfigurationBucketsTest
Change-Id: Ie439ff3706dab35e875c1eb995a67fa73aec4d76
Previously, when onRoleHoldersChanged() was called in a pre-created
user, VoiceInteractionManagerService (A.K.A. VIMS) would store that
user id and call the method again when the pre-converted user is
converted to a real user (on onPreCreatedUserConversion()), as the
assistant role holders is not available for pre-created users.
But if the system restarts between the user pre-creation and
conversion, onPreCreatedUserConversion() would log a warning and
do nothing.
So, this CL gets rids of the "save the user id" part, and simply
re-call onRoleHoldersChanged() whenever a pre-created user is
converted.
Test: manual verification on automotive builds
Bug: 242254421
Change-Id: Id933b2bc4f887da8b2f4959955bd174ed5879a47
Log the UI latency with UIActionLatencyReported atom. We plan to
calulate the latency from when the SoundTrigger HAL emits an event to
when the VoiceInteraction system UI view is shown.
Test: device_config put latency_tracker enabled true; verify traces
and latency is logged in WW.
Bug: 247879896
Change-Id: I3edb91691e81f8f23660c0823a6388338fe926ad
Introducing a flag to gate the Attention Service usage by Hotword
Detection Service. The Attention Service will be disabled by default.
Bug: 247890608
Test: atest CtsVoiceInteractionTestCases
Change-Id: Ic8a6a11b2a0843a96f135b360f10f7fef5fce274
These test cases failed after this change (ag/19194476).
It uses @android.annotation.EnforcePermission instead
of calling enforceCallingPermission.
When using @android.annotation.EnforcePermission, it
will trigger noteOP, so we can’t use the noteOp
mechanism to fix this bug.
After reverting back to use enforceCallingPermission,
the test cases will pass.
Bug: 242103120
Test: atest HotwordDetectionServiceBasicTest
Change-Id: I5cb6a2a33a3fadd2bcbfc6edece80da743684398
Because it is not clear to understand what these two methods do,
we rename them.
(1)updateVisibleActivitiesLocked()
(2)updateVisibleActivitiesChangedLocked
Bug: 235296082
Test: atest VoiceInteractionSessionVisibleActivityTest
Change-Id: Id7db3a0dc9c2a17276ae213223fa3dd6ae572b9f
Revert submission 19600381-revert-17936037-hotword_proximity-ZZIDPDULZP
Test: atest CtsVoiceInteractionTestCases, atest CtsVoiceInteractionTestCases:android.voiceinteraction.cts.AlwaysOnHotwordDetectorTest#testAlwaysOnHotwordDetector_startRecognitionWithData -- --abi x86_64
Reason for revert: Including the fix for broken tests
Reverted Changes:
Ibfc659015:Revert "Refactor ProximityUpdateCallbackInternal t...
I1a03c21d5:Revert "Verify that proximity key is added to the ...
I6b79d9400:Revert "Add proximity state to the HotwordDetected...
Change-Id: Iee6ab086ccc3f27b95ee601d6be11231f300170c
Merged-In: Iee6ab086ccc3f27b95ee601d6be11231f300170c
Reverting the previous revert commit which was merged to resolve the
broken tests. Adding a fix to the broken tests by surrounding
mAttentionManagerInternal with null checks.
dbe5ad1a72
Test: atest CtsVoiceInteractionTestCases, atest CtsVoiceInteractionTestCases:android.voiceinteraction.cts.AlwaysOnHotwordDetectorTest#testAlwaysOnHotwordDetector_startRecognitionWithData -- --abi x86_64
Change-Id: Ife5fb9220518a32a89494217f56932f290cce5f3
Merged-In: Ife5fb9220518a32a89494217f56932f290cce5f3
Revert submission 19600381-revert-17936037-hotword_proximity-ZZIDPDULZP
Test: atest CtsVoiceInteractionTestCases, atest CtsVoiceInteractionTestCases:android.voiceinteraction.cts.AlwaysOnHotwordDetectorTest#testAlwaysOnHotwordDetector_startRecognitionWithData -- --abi x86_64
Reason for revert: Including the fix for broken tests
Reverted Changes:
Ibfc659015:Revert "Refactor ProximityUpdateCallbackInternal t...
I1a03c21d5:Revert "Verify that proximity key is added to the ...
I6b79d9400:Revert "Add proximity state to the HotwordDetected...
Change-Id: Iee6ab086ccc3f27b95ee601d6be11231f300170c
Reverting the previous revert commit which was merged to resolve the
broken tests. Adding a fix to the broken tests by surrounding
mAttentionManagerInternal with null checks.
dbe5ad1a72
Test: atest CtsVoiceInteractionTestCases, atest CtsVoiceInteractionTestCases:android.voiceinteraction.cts.AlwaysOnHotwordDetectorTest#testAlwaysOnHotwordDetector_startRecognitionWithData -- --abi x86_64
Change-Id: Ife5fb9220518a32a89494217f56932f290cce5f3
Revert submission 17936037-hotword_proximity
Reason for revert: https://buganizer.corp.google.com/issues/242223069
Reverted Changes:
If8c23a9c6:Refactor ProximityUpdateCallbackInternal to interf...
Ib0ad1da25:Verify that proximity key is added to the hotword ...
I71e9d3da9:Add proximity state to the HotwordDetectedResult
Change-Id: I6b79d9400671362dd63be1e2a0d05280003587d3
Revert submission 17936037-hotword_proximity
Reason for revert: https://buganizer.corp.google.com/issues/242223069
Reverted Changes:
If8c23a9c6:Refactor ProximityUpdateCallbackInternal to interf...
Ib0ad1da25:Verify that proximity key is added to the hotword ...
I71e9d3da9:Add proximity state to the HotwordDetectedResult
Change-Id: Ibfc65901547d74d6fcfafc257653f49a17a98662
Refactor ProximityUpdateCallbackInternal to interface. Also making sure
that the service unbinding happens when clear Attention Service command
is received.
Bug: 214395649
Test: atest CtsVoiceInteractionTestCases, atest CtsAttentionServiceDeviceTestCases
Change-Id: If8c23a9c68952e323fcb8eeb681e86b0e6119b18
HotwordDetectionConnection will interact with AttentionService to
receive updated proximity state. Then it will fill the
HotwordDetectedResult returned from Hotword service to set
proximity state.
Bug: 214395649
Test: atest CtsVoiceInteractionTestCases
Change-Id: I71e9d3da999cda2d9b17e3abc900fa42e4364c90
RoleService should not be calling onRoleHoldersChanged() on
pre-created users, but that behavior cannot be changed because its
implemented by a system app, and pre-created users APIs are hidden.
To test it:
$ adb shell pm create-user --pre-create-only --guest
Success: created user id 12
$ adb shell pm create-user --guest ElGuesto
Success: created user id 12
$ adb shell cmd user list --all -v
4 users:
0: id=0, name=Driver, type=system.HEADLESS, flags=ADMIN|INITIALIZED|PRIMARY|SYSTEM (running)
1: id=10, name=Driver, type=full.SECONDARY, flags=ADMIN|FULL|INITIALIZED (running) (current)
2: id=11, name=null, type=full.SECONDARY, flags=FULL|INITIALIZED (pre-created)
3: id=12, name=ElGuesto, type=full.GUEST, flags=EPHEMERAL|FULL|GUEST|INITIALIZED (converted)
$ adb shell am switch-user 12
$ adb shell dumpsys voiceinteraction |egrep '(mBound|implementation)'
mBound=true mService=android.service.voice.IVoiceInteractionService$Stub$Proxy@77da1bc
$ adb shell cmd voiceinteraction show
Test: see bove
Bug: 216141085
Bug: 226201975
Merged-In: I12d9bb32e144ecf91ee4b452affea0dcea546127
Change-Id: I12d9bb32e144ecf91ee4b452affea0dcea546127
(cherry picked from commit 39acca1d72)
RoleService should not be calling onRoleHoldersChanged() on
pre-created users, but that behavior cannot be changed because its
implemented by a system app, and pre-created users APIs are hidden.
To test it:
$ adb shell pm create-user --pre-create-only --guest
Success: created user id 12
$ adb shell pm create-user --guest ElGuesto
Success: created user id 12
$ adb shell cmd user list --all -v
4 users:
0: id=0, name=Driver, type=system.HEADLESS, flags=ADMIN|INITIALIZED|PRIMARY|SYSTEM (running)
1: id=10, name=Driver, type=full.SECONDARY, flags=ADMIN|FULL|INITIALIZED (running) (current)
2: id=11, name=null, type=full.SECONDARY, flags=FULL|INITIALIZED (pre-created)
3: id=12, name=ElGuesto, type=full.GUEST, flags=EPHEMERAL|FULL|GUEST|INITIALIZED (converted)
$ adb shell am switch-user 12
$ adb shell dumpsys voiceinteraction |egrep '(mBound|implementation)'
mBound=true mService=android.service.voice.IVoiceInteractionService$Stub$Proxy@77da1bc
$ adb shell cmd voiceinteraction show
Test: see bove
Bug: 216141085
Bug: 226201975
Change-Id: I12d9bb32e144ecf91ee4b452affea0dcea546127
To audit data access and verify the uid and package are consistent,
use noteOpNoThrow instead of checkOpNoThrow.
Bug: 187439908
Test: atest AssistDataRequesterTest
Test: atest CtsVoiceInteractionTestCases
Test: atest CtsAssistTestCases
Change-Id: Ib48040b5b55be09958da4398f4d663908573568c
Also remove separate detectFromDspSourceForTest() method. It originally
was serving different results for testing, but now it is practically
identical to the non-test method. Removing it allows us to exercise the
same code path in CTS tests as in production.
Bug: 212744476
Test: atest CtsVoiceInteractionTestCases
Test: Verify hotword detection works on Pixel 6 Pro
Change-Id: Ibb0c4f49fbfa64ed6c7362d355466a480c5979e2
We add more metrics for software detection and
external source detection.
Android Metrics Design Review : eldar/276723226
Verify the metrics logs manually as below:
Step 1: m statsd_testdrive
Step 2: statsd_testdrive 434
Step 3: run the test
Step 4: We can see the log as below after 1 minutes from Step 2.
hotword_detector_events {
event: EXTERNAL_SOURCE_DETECTED
}
hotword_detector_events {
event: ON_DISCONNECTED
}
hotword_detector_events {
event: START_EXTERNAL_SOURCE_DETECTION
}
Bug: 207717787
Bug: 233704035
Test: build pass
Test: manual. The logs are expected after following test steps
Change-Id: Ib268902d63c580cec9cbd65a3816fd5ba003eaff
(cherry picked from commit 37f8b3ec2b)
We add more metrics for software detection and
external source detection.
Android Metrics Design Review : eldar/276723226
Verify the metrics logs manually as below:
Step 1: m statsd_testdrive
Step 2: statsd_testdrive 434
Step 3: run the test
Step 4: We can see the log as below after 1 minutes from Step 2.
hotword_detector_events {
event: EXTERNAL_SOURCE_DETECTED
}
hotword_detector_events {
event: ON_DISCONNECTED
}
hotword_detector_events {
event: START_EXTERNAL_SOURCE_DETECTION
}
Bug: 207717787
Bug: 233704035
Test: build pass
Test: manual. The logs are expected after following test steps
Change-Id: Ib268902d63c580cec9cbd65a3816fd5ba003eaff
this also fixes an NPE b/234828308
Bug: 226167520
Test: atest android.voiceinteraction.cts
Change-Id: Ibe20fb4da91fa80f8539bb19c90515167bf6e85b
Merged-In: Ibe20fb4da91fa80f8539bb19c90515167bf6e85b
By the original design, we register the activity event in the
ActivityManagerService. After getting the activity event, we will
query current visible activities and report them to Assistant.
Assistant will start to get direct actions of those visible
activities. But sometimes they can not get the direct actions
due to the stage of activity lifecycle before onStart().
We will postpone the request direct actions a few times
before onStart().
Bug: 224789902
Test: atest CtsVoiceInteractionTestCases
Change-Id: If7cd52c5ba749523e575c0be5595e8f20704c4f2