Commit Graph

742 Commits

Author SHA1 Message Date
Julia Reynolds
4b82f6ddb0 Wait 100 ms for assistant response before posting.
Test: make cts-verifier
Change-Id: Idf04c2d24f02a32634e2308da6d1599c9ea29bd4
2017-01-05 20:26:23 +00:00
Julia Reynolds
d5261e1d0a Use userid of sender, not notification target.
When trying to find a package.

Bug: 33178040
Test: manual, ./vendor/google/tools/fake-ota on
Change-Id: I0b69c37f16e7e1763bff4df1650911fe3435bc77
2016-12-19 14:14:25 -05:00
Julia Reynolds
52e64d0162 Give assistant ability to modify channels.
Test: cts on same topic
Change-Id: Ia0db73d4d81a89e0821ba6a06f12823605dbea73
2016-12-13 14:00:01 +00:00
TreeHugger Robot
d4f08a007d Merge "AutoFill Framework refactoring." 2016-12-13 04:05:51 +00:00
Felipe Leme
1ca634a544 AutoFill Framework refactoring.
The AutoFill Framework uses the same AssitStructure provided by the Assist API
and so far it was using the same methods as well, both internally and externally
(public API).

Sharing that internal code internally is fine, but the public APIs must distinguish between the 2 cases so they can fill the assist structures accordingly (although the initial implementation still shares the same logic).

This CL also splits the original 'auto-fill' request in 2 types of requests,
which are set by View flags:

- ASSIST_FLAG_SANITIZED_TEXT
- ASSIST_FLAG_NON_SANITIZED_TEXT

It also added new methods and callbacks to handle save requests.

Bug: 31001899
Test: manual verification

Change-Id:  I4eb09099dc19a43cb7e053e64d939aed3704b410
2016-12-12 18:22:45 -08:00
Julia Reynolds
22f02b3e4a Accept adjustments from notification assistant.
Test: runtest systemui-notification & cts in same topic.
Change-Id: Icff1f89eac32b82d583eca24b0a15f67795912a1
2016-12-07 12:51:16 -05:00
Charles He
ad7268724d Merge "Remove IPersistentDataBlockService from system-api." 2016-12-02 14:02:00 +00:00
Charles He
c86c88f76f Remove IPersistentDataBlockService from system-api.
Change-Id: I55e46c0815e4ef84b4d7a752cc72407f893ab569
Test: manual
Bug: 33238174
2016-12-01 17:42:17 +00:00
Amith Yamasani
f81df2d5e5 Merge "Secure MATCH_UNINSTALLED_PACKAGES across users" 2016-12-01 17:01:07 +00:00
Charles He
df09da04be Merge "Prevent writing to FRP partition during factory reset." 2016-12-01 14:07:38 +00:00
Charles He
a629c772f4 Prevent writing to FRP partition during factory reset.
Avoid potential race condition between FRP wipe and write operations
during factory reset by making the FRP partition unwritable after
wipe.

Bug: 30352311
Test: manual
Change-Id: If3f024a1611366c0677a996705724458094fcfad
2016-12-01 09:30:45 +00:00
Amith Yamasani
0d1fd8d091 Secure MATCH_UNINSTALLED_PACKAGES across users
Introduce a new internal flag MATCH_ANY_USER for genuine uses
of searching through all apps on the device.

Some temporary accommodations for Launchers that reach across
to the work profile until we have a new LauncherApps API to do
that officially.

Bug: 31000380
Test: CTS tests added
Change-Id: I2e43dc49d6c2e11814a8f8d1eb07ef557f31af34
2016-11-30 13:24:53 -08:00
Julia Reynolds
7e1ffd737e Shorten log tag.
Bug: 32437842
Test: manual
Change-Id: Id6f77a2dec30a4da695232d70e441398285f14d0
2016-11-30 14:00:52 +00:00
Julia Reynolds
b6c1f99bd9 Allow listeners more snoozing options.
(snooze indeterminately and unsnooze)

Test: runtest systemui-notification and cts tests in same topic.
Change-Id: I5ce74638f55ed796bc6b26af167b32b0040f4222
2016-11-28 08:53:14 -05:00
TreeHugger Robot
e83e197931 Merge "Added 'oneway' flags on AIDL where appliable." 2016-11-21 23:00:44 +00:00
Felipe Leme
254c2c99dd Added 'oneway' flags on AIDL where appliable.
Not only if fixes warning about outgoing transactions from system_server
not having the FLAG, but it fixes system crashes when the service
doesn't behave well (for example, if it does not call super.onCreate()
on onCreate().

BUG: 31001899
Test: manually built and ran it

Change-Id: I829ee501edb84bd02a60e8df92f9a0e0d2157887
2016-11-21 13:21:43 -08:00
Jeff Davidson
8e1a4931bd Fix Javadoc errors in CarrierService.
Test: Verified in IntelliJ's Javadoc viewer.
Change-Id: I449a57648b0aa89ba2a9360bfc9b5bad2f9b0d51
2016-11-18 13:07:01 -08:00
Felipe Leme
dfa7fbc870 Bind AutoFillService on demand.
BUG: 31001899
Test: manually built and ran it

Change-Id: Ied7028e41c273f5e30f88fc92f919249046877eb
2016-11-11 16:13:09 -08:00
Felipe Leme
29a5b0d0f1 Added a callback for AutoFillService.
So far AutoFillService only received the assist data from framework; in
this CL, it also offers a method where the auto-fill provider can send
the auto-fill data back to framework.

The workflow is:

- AFMSI calls a new AM method (requestAutoFillData(), instead
  of requestAssistContextExtras()).
- The assist receiver is located in the app, not on system service.
- AM uses a new request type (ASSIST_CONTEXT_AUTOFILL) to request the
  assist data to the activity.
- ViewStructure has a new setAutoFillId() method which is used to set an
  unique id for the view.
- View uses the accessibility id to implement the auto-fill id.
- When the activity fullfills the request, it creates an IAutoFillCallback
  remote object - that will be used to set the auto-fill fields - and
  returns it in the assist bundle (using the
  VoiceInteractionSession.KEY_AUTO_FILL_CALLBACK key).
- The app-visible AutoFillService class offers an onFillRequest() method,
  which contains the assist data and a FillCallback used to handle it.

BUG: 31001899
Test: manually built and ran it

Change-Id: I3d208c14e81022dc96dd03f38bbe25a778b24a67
2016-11-11 16:02:55 -08:00
Julia Reynolds
05675c80c1 Merge "Expose dismiss reasons to notification listeners." 2016-11-10 20:46:07 +00:00
Julia Reynolds
3aa5f1eec0 Expose dismiss reasons to notification listeners.
Test: see cts tests on same topic
Change-Id: Ibae45e125ebc2aa394fbdb41c00341bf0ac101e5
2016-11-09 15:43:49 -05:00
Julia Reynolds
3775a39e39 Merge "Move notification channel from record to sbn." 2016-11-09 20:40:41 +00:00
Julia Reynolds
67c8e1e61f Merge "Ranker --> Assistant." 2016-11-09 20:38:47 +00:00
Julia Reynolds
423b9fc83d Move notification channel from record to sbn.
So notificationlisteners know about it.

Test: runtest systemui-notification
Change-Id: I28fc86730d3f7ad246a0164f44157594f57430c0
2016-11-09 09:51:08 -05:00
Julia Reynolds
77b2cc920f Ranker --> Assistant.
Rename ranker to assistant and make some of the methods public.
Delete the ext services ranker and restore the listener-type
lifecycle to the assistant.

Test: manual. add a notification assistant and verify it gets
assistant and listener callbacks.

Change-Id: Ia3406c8c14d923426c1b8a6d8b5187efe64c31c3
2016-11-09 09:04:16 -05:00
Felipe Leme
5381aa4b58 Initial implementation of the Auto-Fill Framework classes.
This CL provides the initial, skeleton implementation of the Auto-Fill
Framework classes:

- Defines the system service and app-based
  AIDL (IAutoFillManagerService.aidl and IAutoFillService.aidl respectively).
- Defines the 'adb shell cmd' interface.
- Defines the permission required to access the service.
- Registers the service on SystemServer.
- Adds the code to bind the app-specified service to system_server.
- Defines the service class (AutoFillService) required by providers.
- Implements the initial startSession() method.

This is still a very early, "work-in-progress" change:
- It has many TODOs.
- It does not have unit or CTS tests yet.
- It does not provide a callback method to auto-fill the fields.
- In fact, it has a lot of TODOs.

Despite these adversities, it can be tested by following the steps
below:

1.Create an app with a service extending AutoFillService

2.Implement the onNewSession() method

3.In the manifest:
 - Listen to android.service.autofill.AutoFillService intents.
 - Require the android.permission.BIND_AUTO_FILL permission.

4.Explicitly set the app as an autofill-service by running:
  adb shell settings put secure auto_fill_service MY_APP/.MY_SERVICE

5.Start a session against the top activity:
  adb shell cmd autofill start session

BUG: 31001899
Test: manually built and ran it

Change-Id: I00f4822159b31ddddba8f513e57c4474bc74eb89
2016-11-08 14:40:56 -08:00
Julia Reynolds
73481c8837 Merge "Some channel model updates" 2016-11-02 01:20:20 +00:00
Julia Reynolds
85769915e7 Some channel model updates
- Apps cannot update their channel settings after creation.
- Importance is required when creating a channel.
- Some method name changes.
- Ranker can't modify fields a user has changed.
- High and Max importance mean the same thing.
- The default channel adopts app wide settings on creation.
- The default channel is limited to importance low once target api is post n mr1
  unless the user changed it.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/notification

Change-Id: I73c449a6abe6d709046de79c5c54339cb2edf0b8
2016-11-01 19:31:34 +00:00
John Reck
6bc7014210 Add SurfaceHolder#lockHardwareCanvas()
Bug: 26988043
Test: SurfaceViewTests#testSurfaceHolderHardwareCanvas CTS test
Change-Id: I3e5352d498dbe2fc56a18ca27360d129a14c7784
2016-10-27 14:13:44 -07:00
Julia Reynolds
8f488d3f2f Move autogrouping into framework.
Test: runtest systemui, and post and dismiss notifications, checking that they
are grouped (or not) appropriately.

Change-Id: I8f3ec497cebcb14a7853fac98b844a3fd4503141
2016-10-19 22:30:58 +00:00
Julia Reynolds
72f1cbb3b9 Add support for snoozing notifications
To a notification listener, snoozing will appear as a cancel
(with reason snoozed) followed by a post (when the snooze period
ends).

Apps can repost a snoozed notification, but the updates will not be shown
to the user until the snooze period ends.

Snoozing is canceled if the posting app or a notification listener
cancels the notification.

Any notification listener can snooze a notification. Technically apps
can snooze their own notifications also, though that's not public.

In this iteration snoozed notifications will be lost on device reboot.

Test: included. Also, various post, snooze, update, cancel tests with
a listener.

Bug: 30997603
Change-Id: I568a6448196f0992a17d20a4dac296321ec5092b
2016-10-13 16:18:11 -04:00
Adrian Roos
35afe2d8de Fix wake lock logic during Dream startup am: 9ede1d2602 am: 042c2349c6
am: 4ffff73947

Change-Id: If3c1dd67f402bc549cad76e5072817a1d1104463
2016-09-26 08:59:08 +00:00
Adrian Roos
4ffff73947 Fix wake lock logic during Dream startup am: 9ede1d2602
am: 042c2349c6

Change-Id: I6c8a9119fd841b071dfb9f0e54680eb3dd7a1ef1
2016-09-23 22:24:32 +00:00
Adrian Roos
9ede1d2602 Fix wake lock logic during Dream startup
Fixes a crash that would happen in all dreams
that did not have permission to acquire wake locks.
Instead moves the wake lock logic into the system
process. Also fixes a bug in DozeService where the
wake lock was not held until dozing was actually
properly initialized.

Fixes: 31612287
Bug: 31044352
Related-CL: I85955a2b7d6bad5171accbc336117a9660b1b198
Test: adb shell settings put secure screensaver_components com.android.dreams.basic/.Colors; adb shell service call dreams 1

Change-Id: Idb3f921ee71b6da6c2ab0c44c332ef91f93ddbc0
2016-09-23 15:11:15 -07:00
Adrian Roos
8cbd52be80 Hold WakeLock while DreamService starts am: 7445c0bb86 am: 5e18c826f3
am: f71c33a6ae

Change-Id: I4e404bbf3fd1995c0899883a6d9cf12210329a1c
2016-09-21 04:12:48 +00:00
Adrian Roos
f71c33a6ae Hold WakeLock while DreamService starts am: 7445c0bb86
am: 5e18c826f3

Change-Id: I4c8d223c8968f554ceabd9dd80bb55e19a5b7e34
2016-09-20 05:24:03 +00:00
Julia Reynolds
90eba6d81c Merge "Add Notification channels" 2016-09-16 15:35:27 +00:00
TreeHugger Robot
84024c1f09 Merge "Allow Condition Providers to bind/unbind themselves" 2016-09-15 21:29:10 +00:00
Julia Reynolds
38e6ca4e74 Allow Condition Providers to bind/unbind themselves
So they only run when needed.

Change-Id: I5cf3a572837cb773dcb4f278a9f86a9d909147e4
Fixes: 30727598
2016-09-15 19:31:29 +00:00
Julia Reynolds
206c7e9d83 Delete L->M upgrade code.
Bug: 25497753
Change-Id: I0ae55e0d49b0aa488b86e336a6246fe57cba8601
2016-09-15 18:06:36 +00:00
Julia Reynolds
b5e44b7966 Add Notification channels
In this iteration:
-Every app gets a default channel that notifications will be posted
to if they don't specify a channel themselves. The default channel
inherits app-wide settings on upgrade.
-Apps can create new channels without user approval, but apps
cannot change the name of a channel once created, nor can they ever
set the importance.
- When a notification is posted:
  - If the channel is marked as 'vibrates', vibration will be
    applied to notifications that lack a vibration. unlike the default
    notification flag, notifications will retain their custom vibration
    if given
  - Same with sound and lights
  - A notification's importance is the min of the app and channel
    importance
  - A notification can bypass dnd if: either the app or channel settings
    say it can
  - A notification's show on lockscreen setting comes from the app first,
    and the channel second if the app has no preference

Tests: in cl. also there's a cl for cts and a test app.

Change-Id: I630f99df655800b00586dcfab538d320d04fe0f0
2016-09-15 08:42:35 -04:00
Adrian Roos
7445c0bb86 Hold WakeLock while DreamService starts
Fixes a bug where DozeService would not properly initialize
because the CPU went to sleep before onDreamingStarted completed,
causing the pickup gesture to not work.

Change-Id: I85955a2b7d6bad5171accbc336117a9660b1b198
Fixes: 31044352
2016-09-08 20:06:48 +00:00
Esteban Talavera
50421f1a38 Do not toggle OEM unlock if bootloader unlocked am: c48b20f8f1 am: 83583bd596
am: b9bef2fb7d

Change-Id: I87ffae46a63f1543b55e075cecffb1d2c2e1c160
2016-08-11 19:11:52 +00:00
Esteban Talavera
b9bef2fb7d Do not toggle OEM unlock if bootloader unlocked am: c48b20f8f1
am: 83583bd596

Change-Id: Ib8293a02ca13587154133a939c4515de1a114bd9
2016-08-11 19:00:37 +00:00
Esteban Talavera
c48b20f8f1 Do not toggle OEM unlock if bootloader unlocked
Bug: 30681215
Change-Id: Ia0fd55dd7b6b731d6f5733fc733621e99bd7b153
2016-08-11 18:14:03 +01:00
Julia Reynolds
98aa59e407 Merge \\"Snooze schedule rules that were canceled by alarms.\\" into nyc-mr1-dev am: ae0aed951b
am: 261b655396

Change-Id: Icd0ff5a828d0f2a39bb0e39085cd9fd7788f354f
2016-07-20 20:51:12 +00:00
Julia Reynolds
261b655396 Merge \"Snooze schedule rules that were canceled by alarms.\" into nyc-mr1-dev
am: ae0aed951b

Change-Id: I18bd8e7528a6c24f350c97268b26fe91ef198290
2016-07-20 20:45:13 +00:00
Julia Reynolds
fe58f1f386 Snooze schedule rules that were canceled by alarms.
So a reboot or snoozed alarm doesn't cause them to
reactivate.

Bug: 30087850
Change-Id: I83fdb88009b515d442993944aec40df7365e830f
2016-07-20 14:50:39 -04:00
Jason Monk
b55c3c60a8 Merge \\"QS: Don\\'t use ComponentName to identify tiles\\" into nyc-mr1-dev am: a0967ebbdf
am: 356d4914b2

Change-Id: I83fad6237edfb9516e1fe40612b820c319f26cc5
2016-07-15 20:16:44 +00:00
Jason Monk
356d4914b2 Merge \"QS: Don\'t use ComponentName to identify tiles\" into nyc-mr1-dev
am: a0967ebbdf

Change-Id: Ib98a48e46f711b927a1b9e8d2b8162a59bfa3240
2016-07-15 17:03:46 +00:00