"Manager" is a little vague and "Copier" is clearer with the class's
purpose.
Bug: 258323047
Test: None with this change; simple refactoring
Change-Id: I43a24b27983838e0ef9798eef2f45d1d4b1c9ac8
android.media.permission.Identity is not needed for AppOpsManager calls
and is an unnecessary coupling.
Bug: 258323047
Test: None with this change; pure refactoring
Change-Id: I1c70f95a73e36c2793e87116b426d55ce359b74b
A HotwordDetectionService can specify a buffer length for each
HotwordAudioStream in the HotwordDetectedResult by adding an int in the
HotwordAudioStream's metadata PersistableBundle, with the key
HotwordAudioStream.KEY_AUDIO_STREAM_COPY_BUFFER_LENGTH_BYTES.
If the value is not specified or is an invalid value, the default buffer
length is 2,560 bytes.
Bug: 257509629
Test: Manually with test app, verified with logs
Test: atest CtsVoiceInteractionTestCases
Change-Id: I28c7f21bdf7c00b62c9cc6c29153d79ce9d85286
The HotwordDetectionConnection controls the communication
with the HotwordDetectionService and handles the detection
of trusted hotword detector. We separate the detection of
trusted hotword detector into TrustedHotwordDetectorSession.
In order to make the code review easier, we copy the all
content of HotwordDetectionConnection class into the new
TrustedHotwordDetectorSession class.
Test: atest CtsVoiceInteractionTestCases
Bug: 241041976
Change-Id: I0943fdec5979440aaab23642caa5677470002466
It doesn't pass the right value into trusted hotword
metrics when creating trusted hotword detector.
Test: Build pass
Bug: 259212509
Change-Id: I5ab23ccc88c0c1221a2b2843f90f787346df41b7
Bug: 244595867
Test: TODO - Manual E2E test for now, CTS tests later
Change-Id: I02050cc39146e93e9dca1f3db6e0b5b894e85dd6
Merged-In: I02050cc39146e93e9dca1f3db6e0b5b894e85dd6
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:
BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower
See https://errorprone.info/bugpatterns for more
information on the checks.
Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
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 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
(cherry picked from commit 29bb3a3428)
Merged-In: Ie439ff3706dab35e875c1eb995a67fa73aec4d76
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
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
(cherry picked from commit 0d7aa31d35)
Merged-In: Id7db3a0dc9c2a17276ae213223fa3dd6ae572b9f
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
Fixes: 242254421
Merged-In: Id933b2bc4f887da8b2f4959955bd174ed5879a47
Change-Id: Id933b2bc4f887da8b2f4959955bd174ed5879a47
(cherry picked from commit 63da68c191)
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