Commit Graph

4 Commits

Author SHA1 Message Date
Alex Salo
2b7dbe85a2 Remove the disableSelf() api
No longer needed, the logic will be handled in AttentionDetector which
implements the feature. Settings app makes sure to grey out the setting
if does not have sufficient permissions.

Bug: 130350903, 130246574
Test: manually confirmed, atest AttentionDetectorTests, make RunSettingsRoboTests
Change-Id: I324223af01b5198e3af0b84d47120f307f3aa71a
2019-04-15 16:02:41 -07:00
Alex Salo
eeba023303 Simplify the AttentionService API
Remove the request code as the callback identifies itself

Bug: 128134941
Test: manully verified the lifecycle
Change-Id: I1f92a6bcd48f9780072ed444cc73ab8a4d2aad77
2019-03-21 22:12:44 -07:00
Alex Salo
b4a617767b Add disableSelf() and more failure codes
disableSelf() allows the implementer of the service to notify the system
about the intent to disable self, e.g. in case it does not have sufficient
permissions to perform the task.

New failure codes are introduced to communicate the absense of the
camera permission and a cancellation event.

Bug: 128921381, 111939367
Test: manually
Change-Id: Id9a2a8e8d51d422e966a5858c85f8a73ca37ded7
2019-03-21 14:43:51 -07:00
Alex Salo
b81472f7e2 Add skeleton implementation for Attention API
This service will let the system know whether the user is paying attention to
the device. This may be useful in certain scenarios - like keeping the screen
on, even when there has been no touch related user activity.

New permission BIND_ATTENTION_SERVICE is added to ensure that only the system
can bind to the attention service.

Test: manually tested the lifecycle is as expected
Bug: 111939367
Change-Id: I2dab9c69f3d0c6efb0db572f797f517dc6efcc72
2019-01-16 21:21:51 -08:00