102 Commits

Author SHA1 Message Date
Geoffrey Pitsch
5644ccd185 Delete default channel for all apps targeting O.
Change toast to be for debuggable builds only.

Bug: 35378789
Test: runtest systemui-notification
Change-Id: I36247b003ead00bf1f9f3bed9c1a38a53db18c71
2017-05-02 16:06:19 -04:00
Julia Reynolds
a8b766fb73 Do not unsnooze canceled notifications.
Test: runtest systemui-notification
Change-Id: I3edef5822aa74359bf3a34f54f59d4021696365d
2017-05-01 11:04:23 -04:00
Julia Reynolds
a78cdffd80 Change snoozing behavior for notifications in groups
- Snoozing a summary notification will snooze its current
children in addition to itself
- Posting a non-snoozed notification to a summary will
unsnooze the summary
- snoozing the only child of a group will also snooze the group
summary

Test: runtest systemui-notification
Change-Id: I5edba1461a59131c6c202f02e6f89404d22bb404
Fixes: 35934956
2017-04-27 16:47:36 -04:00
TreeHugger Robot
f84467e19f Merge "Api updates" into oc-dev 2017-04-27 04:51:46 +00:00
Julia Reynolds
567947d75d Merge "Update app level fields when misc channel is updated" into oc-dev 2017-04-26 17:43:32 +00:00
Julia Reynolds
bad4297600 Api updates
- Better documentation on DEFAULT_CHANNEL_ID
- Renaming getChannel/setChannel/getTimeout/setTimeout
- Add documentation to getShortcutId
- @hide parcel constructors

Test: make, make cts
Bug: 37672218

Change-Id: I695b2620c51638a84930e9d1c5fbfd6d85699b55
2017-04-25 17:00:05 -04:00
TreeHugger Robot
21fb35048f Merge "Revert "Revert "Integrate new looper apis into testables""" into oc-dev 2017-04-25 20:27:23 +00:00
Julia Reynolds
fa04e143d8 Update app level fields when misc channel is updated
So user settings aren't lost when the app migrates
to using channels

Test: runtest systemui-notification
Change-Id: I5774997ea33a892fa45f614bb3dd8de7e681f58c
Fixes: 37603697
2017-04-25 15:50:56 -04:00
Jason Monk
745d0a8b77 Revert "Revert "Integrate new looper apis into testables""
This reverts commit fd8f615953631863c94d7080441f8dd4a0a74f56.
+ some minor adjustments.

Test: runtest systemui
Change-Id: Ie4349fcfb2aadbbd8826506faa8a6fb1ecd5b589
2017-04-25 13:49:58 -04:00
Julia Reynolds
a79c37170e Allow some notifications in a group to be muted
Test: cts, runtest systemui-notification
Change-Id: I98b971c496c52f69e039a3a3101f71ac567b538a
2017-04-25 13:41:37 -04:00
Julia Reynolds
10e7275965 Merge "Don't allow devs to create blocked channels" into oc-dev 2017-04-24 21:17:16 +00:00
Julia Reynolds
d8c0ac42de Don't allow devs to create blocked channels
Test: runtest systemui-notification
Change-Id: I11942e4268acc70ffcbcda08eed4e13e64f4b12f
Fixes: 37559814
2017-04-23 13:18:15 -04:00
Julia Reynolds
ca80d1632e Don't consider uri empty a valid sound
Test: runtest systemui-notification
Change-Id: Ia838237e04eb11bd79e3ad5990bbb52c7ab853ee
Fixes: 36848349
2017-04-23 17:13:28 +00:00
Julia Reynolds
fea6f7b799 Remove long standing debug code
Because it stops real errors from bubbling up to the calling app.

Test: make, post notifications
Change-Id: I0e59c61b0a60302a5fd023b7ad909e84b97e5df5
Fixes: 37494547
2017-04-21 09:38:39 -04:00
Julia Reynolds
feb7341b2f Lock all the things
Fix some instances of .*Locked() methods being called without
holding mNotificationLock.

Also, if this happens again, don't crash system server

Change-Id: I0a51310a6f6c8b07266092176e189e7cd08778cc
Fixes: 37444864
Test: runtest systemui-notification
2017-04-18 14:12:16 -04:00
TreeHugger Robot
1ed2771450 Merge "Add user to channel/group modification callbacks." into oc-dev 2017-04-17 21:26:54 +00:00
Julia Reynolds
b9e712ebde Also use the notification's sound for the misc channel
Even if it's nonexistent.

Test: runtest systemui-notification
Change-Id: I1167fdf10b776460de696657dd49ab6f2be85753
Fixes: 37414045
2017-04-17 14:33:30 +00:00
Julia Reynolds
f27d6b2b82 Add user to channel/group modification callbacks.
Because listeners can see notifications on managed profiles.

Test: runtest systemui-notification and testing with a sample app
(reading and updating channels and getting change
callbacks on a managed profile)
Change-Id: I5d7af3c417e3a3d18f992cc9ad01fbd7959de398
Fixes: 36783632
2017-04-17 08:44:35 -04:00
Julia Reynolds
d178ec489f Merge "Allow notification channels to be silent." into oc-dev 2017-04-13 17:07:46 +00:00
TreeHugger Robot
3d6225b4e2 Merge "Companion device mgr doesn't always exist" into oc-dev 2017-04-13 16:50:50 +00:00
Julia Reynolds
727a728836 Companion device mgr doesn't always exist
E.g. on tvs.

Test: runtest systemui-notification
Change-Id: I1f1fd3cc5d361d3854eef5e5726816b50f5d7eb6
Fixes: 37276184
2017-04-13 15:05:45 +00:00
Julia Reynolds
184b86da38 Allow notification channels to be silent.
This better accomodates those apps that play their own sounds.
Since most apps don't play their own sounds, update the documentation
on notificationchannel to add guidance about when they should add a
sound.

Fixes: 37237013
Test: runtest systemui-notification
Change-Id: If00b15b1b44da66d24dacb2895e9a6c0a06d1890
2017-04-13 11:03:57 -04:00
Julia Reynolds
889280c4c3 Only foreground notis should be sorted higher
Having the ongoing flag is not enough.

Test: runtest systemui-notification
Change-Id: I8a6c15af819f2bb4ad3937ae45d33361663fbe13
2017-04-13 11:03:57 -04:00
Julia Reynolds
da78147f29 Clear calling identity before verifying listeners
Also don't throw when can't verify listener.

And update mocking in tests to clean state between tests.

Bug: 36783632
Fixes: 37263567
Test: runtest-systemui-notification, create a secondary user
Change-Id: I5ec95539c9859b67b8fbc7e6a85334e08e6b5a98
2017-04-12 12:08:56 -04:00
Julia Reynolds
73ed76bc6f Allow companion device mgrs channel access
- Callbacks when channels and groups are modified
- Allow them to read and update channels and groups

Test: runtest systemui-notification
Change-Id: Ie4d02bd4583f71f9faf27603bcc59a1ec0eeaf46
2017-04-11 19:08:59 +00:00
Geoffrey Pitsch
415e454f55 Fix race condition in removeForegroundServiceFlag
Also fix flake in our tests.

Test: runtest systemui-notification
Fixes: 36550043
Fixes: 36551790
Change-Id: I910e9233a17ef325bcb173c50c00d9982dc72224
2017-04-10 13:52:07 -04:00
Geoffrey Pitsch
9394a8fc62 Merge "Don't delete new notification channels not present in backup" into oc-dev 2017-04-07 18:16:35 +00:00
Geoffrey Pitsch
6eccf0016b Don't delete new notification channels not present in backup
Test: runtest systemui-notification
Change-Id: Ib25a680487b20700b9936926c1769a4d8f81b62a
Fixes: 36785228
2017-04-06 11:10:04 -04:00
Julia Reynolds
6031533702 Remove unneeded methods
Test: make, make cts, make cts-verifier, runtest systemui-notification
Change-Id: I25b559cfcc30f2d85f468adf840f9124e80f00b0
2017-04-05 18:36:07 -04:00
Geoffrey Pitsch
ed767118f4 Ignore flaky notification test
Bug: 36551790
Test: runtest systemui-notification
Change-Id: I92f72a90afb2323a847149351bf1c6a911027e0b
2017-03-23 15:13:06 -04:00
Dan Shi
874a0916fc Merge "Add test configs to apct tests under frameworks/base" 2017-03-22 17:55:58 +00:00
TreeHugger Robot
2c98e18ce5 Merge "Null check! Now with a test" 2017-03-22 15:20:36 +00:00
TreeHugger Robot
26a547d5e4 Merge "Allow channels to have a user visible description." 2017-03-22 14:04:05 +00:00
Julia Reynolds
8e0eb372c9 Null check! Now with a test
Test: runtest systemui-notification
Change-Id: I0b98b3dd6aeaa7e300bba98b7d7f7f5afae16596
Fixes: 36245468
2017-03-21 21:50:32 +00:00
TreeHugger Robot
48926cc1e6 Merge "Channel updates should trigger ranking updates" 2017-03-21 21:46:36 +00:00
Julia Reynolds
2c891c92fa Allow channels to have a user visible description.
Test: runtest systemui-notification, cts
Change-Id: I0d04b82c99deecad663d8cb0565563f00e8a1f56
2017-03-21 17:45:41 -04:00
Julia Reynolds
a917a1149c Channel updates should trigger ranking updates
- Uid, not user id
- unspecified importance really does mean 'don't override'

Change-Id: Ia60aade179f70cd5d5278eed41c707b9ab6590e0
Fixes: 36007628
Fixes: 36355913
Test: manual, runtest systemui-notification
2017-03-21 11:23:46 -04:00
Geoffrey Pitsch
d9263306d5 Merge "Delete the Default Channel when an app starts using channels." 2017-03-21 14:12:22 +00:00
TreeHugger Robot
2bcca1d624 Merge "BZZZZZZT! BZZZZZT! New Vibrator APIs" 2017-03-21 13:40:36 +00:00
Dan Shi
7f2afd2dff Add test configs to apct tests under frameworks/base
TouchLatency is needed by test TouchLatencyJankTestWear
UiBench is needed by test UiBenchJankTests

Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
make -j32 TouchLatency TouchLatencyJankTestWear  && \
tradefed.sh run template/local --template:map test=TouchLatencyJankTestWear \
      --test-tag testname --log-level-display VERBOSE
make -j32 UiBenchJankTests UiBench  && \
tradefed.sh run template/local --template:map test=UiBenchJankTests \
      --test-tag testname --log-level-display VERBOSE

Change-Id: I63f23e3a21ad1343607953958fb7bb0a5fb8c343
2017-03-21 00:05:14 -07:00
Geoffrey Pitsch
1f17e024a1 Delete the Default Channel when an app starts using channels.
New apps should create their own channels.
Not using channels will silently fail.

STOPSHIPS:
Throw to provide better feedback for developers.
Delete the default channel for all apps that target O.

Test: runtest systemui-notification
Change-Id: Ic93f103efe397f563eaaf1c2e7d8bf9093b2b2e1
2017-03-20 16:49:59 -04:00
Michael Wright
7121697a5e BZZZZZZT! BZZZZZT! New Vibrator APIs
Replace the existing Vibrator APIs with a new class to encapsulate the
haptic effect information, and add the ability to control the vibration
strength.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.VibratorTest
      cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.VibrationEffectTest
      runtest systemui-notification
      Manual testing with $T/google_experimental/users/michaelwr/Vibrator

Bug: 30961353

Change-Id: Idbb9864a7b084c85e7b7de3257a0e6b40d9d91d6
2017-03-20 16:09:51 +00:00
Julia Reynolds
d0a5b1684a Don't backup deleted channels.
Change-Id: I58a23700c9f6ccf5d3d6b7fa9f80be78ef9421f0
Fixes: 36381209
Test: runtest systemui-notification
2017-03-20 14:55:16 +00:00
TreeHugger Robot
587b60282e Merge "frameworks/base: Add APCT tests to the device-tests suite." 2017-03-16 17:35:12 +00:00
Julia Reynolds
9bfba59417 Better deletions
- Allow apps to delete notification groups (which cascade to delete all
channels therein)
- Allow apps to get their groups, so they know what they might want to
delete
- Don't throw if someone tries to delete something that already doesn't
exist.

Change-Id: I5f6e25497c5da1e57b52737586e86097332f88f9
Fixes: 36245468
Fixes: 36127382
Test: runtest systemui-notification, cts
2017-03-16 14:32:50 +00:00
Julia Reynolds
41103f4212 Support for showing deleted channel count in settings.
Bug: 36119790
Test: runtest systemui-notification
Change-Id: Ie30243314d64ded66267d0dc85cc0ad940d917f8
2017-03-16 14:24:17 +00:00
Julia Reynolds
1d97e6a0c1 Remove resource id channel/group name fields
Apps can listen for the LOCALE_CHANGED broadcast to
change names if needed.

Fixes: 35336590
Test: runtest systemui-notification, cts, manual
Change-Id: I62d2778f61e99200692755a6f268828a374837e6
2017-03-16 14:20:28 +00:00
Simran Basi
473a16e492 frameworks/base: Add APCT tests to the device-tests suite.
This CL adds the APCT tests within this project to
a similar suite as CTS known as device-tests.

The current method of running APCT tests in the infrastructure
is unaffected.

Bug: 35882476
Test: `make dist device-tests -j` and local builds of
      continuous_instrumentation_tests & continuous_native_tests

Change-Id: Ifa382fe691842c1cd76897775b9e2a1653449eb5
2017-03-15 14:46:27 -07:00
Julia Reynolds
e866533f11 Allow blocked apps to create channels
Change-Id: I64b90332095f949af003db3db98da75b22a09c64
Fixes: 36040396
Test: runtest systemui-notification
2017-03-13 17:09:18 +00:00
Paul Duffin
2abe1be543 Use --multi-dex native to avoid dex limit
Bug: 32912773
Test: make checkbuild
Change-Id: If23b6a746494d862059ce76ef20b225a6c27c379
2017-03-11 12:26:13 +00:00