Commit Graph

9911 Commits

Author SHA1 Message Date
Felipe Leme
dfd119615e Fixed enhanced for loop.
It was trying to interact through null, which could throw an exception. Example:

01-18 18:28:12.609   862  2038 W Binder  : Binder call failed.
01-18 18:28:12.609   862  2038 W Binder  : java.lang.NullPointerException: Attempt to get length of null array
01-18 18:28:12.609   862  2038 W Binder  : 	at android.app.Notification$Action$Builder.build(Notification.java:1289)

Test: manual verification
Change-Id: I84fda80ebd12df7d90730b17fa77d4b9ce5f58d2
2017-01-18 18:38:46 -08:00
Chris Tate
9e83cbbc10 Revert "Enable background restrictions"
This reverts commit 21f778060b.

Change-Id: I65586f9739da84fb32b51b0ea166b8288c41d1b3
2017-01-19 01:12:19 +00:00
Shane Brennan
57bf4ea479 Merge "Add support for audio-focused notifications." 2017-01-19 00:12:09 +00:00
Jason Monk
9cfbe9573e Merge "Allow FragmentContainer to play a role in fragment construction" 2017-01-18 23:58:38 +00:00
TreeHugger Robot
155873057f Merge "Enable background restrictions" 2017-01-18 22:32:17 +00:00
TreeHugger Robot
db595b087a Merge "Protect use of onFindViewById for Fragment Transitions." 2017-01-18 20:26:20 +00:00
Shane Brennan
472a3b330a Add support for audio-focused notifications.
Add extras keys and methos to Notification and RemoteInput for notifications
whose contents have an audio representation and whose RemoteInputs
can accept data results (useful for, e.g., voice messaging
applications, photo results, etc).

This motivator for this change is it enables an end-to-end flow for
audio messaging including
  * System receives the audio message
  * Replying to the message with the user's voice
  * App receives the audio reply data

Note that this CL just adds the capabilities, but does not
add any UI or implementation to perform the above flow.

Test: As agreed, this will be tested both with a set of unit tests,
      and with an "end-to-end" test that simulates two apps, one
      creating an audio message with audio reply action, and a
      second app that executes that action, providing an audio
      result.

Change-Id: I55779ac4b781d8273c13c69fded0b56ee639cf01
2017-01-18 12:15:16 -08:00
Christopher Tate
21f778060b Enable background restrictions
Apps that target O+ are always subject to background restrictions.
Legacy apps' background restriction is subject to the OP_RUN_IN_BACKGROUND
app op.

Apps with these properties are exempted from background restrictions:
  - persistent process
  - currently on the idle battery whitelist
  - global whitelist for things like bluetooth services

Bug 30953212

Change-Id: Ib444829a2d222125f64ff19e8218823fa78373f9
2017-01-18 11:30:41 -08:00
TreeHugger Robot
b9cb9000c0 Merge "Execute non-optimized add operations one at a time." 2017-01-18 18:27:09 +00:00
Bartosz Fabianowski
094119df3e Merge "Allow system to retrieve permission grant state" 2017-01-18 17:25:49 +00:00
Bartosz Fabianowski
4b0624fee4 Allow system to retrieve permission grant state
To inform the user which apps were granted permissions by the admin,
the Settings app needs to access this information without being a DO/PO.

Bug: 32692748
Test: FrameworksServicesTests unit test

Change-Id: I3770ec6343b85be9c6f7655675ed6db5cb50612c
2017-01-18 18:22:50 +01:00
TreeHugger Robot
2ec59897cf Merge changes I01e81b9c,I532c2d74
* changes:
  Add a listener when task snapshots change
  When app dies, destroy snapshot
2017-01-18 12:17:45 +00:00
TreeHugger Robot
38f8292234 Merge "Adding Notification.TvExtender API" 2017-01-18 02:20:47 +00:00
George Mount
498348d34b Protect use of onFindViewById for Fragment Transitions.
Bug 34163850

onFindViewById is only valid once the Fragment's View
has been created, but the child fragment manager
can be used prior to its creation. This protects
the use of onFindViewById from use by fragment
transitions.

Test: Ic72cd7dae8d7982b78258116e7910c4f07d75d50

Change-Id: I67e3b2d5f59c2e741f29211d08ab07476c78a0ca
2017-01-17 17:09:28 -08:00
Jorim Jaggi
fb9d78afb7 Add a listener when task snapshots change
Since we start recents before we take the snapshot, we need to add
a mechanism to inform recents about task snapshots changes.

We add a new method to TaskStackChangedListener,
onTaskSnapshotChanged, which gets called whenever a task snapshot
changes. Then, SystemUI registers such a listener and updates the
task thumbnail view for the specific task.

Test: Open app, press recents, make sure thumbnail is up-to-date
Bug: 31339431
Change-Id: I01e81b9cd11886da734da671c68d5732aa51009f
2017-01-18 01:50:51 +01:00
George Mount
a27a237098 Execute non-optimized add operations one at a time.
Bug 34125817

It appears that some developers rely on fragment views containing
other fragments without using the fragment's child fragment manager.
This CL executes all unoptimized add operations separately to make
sure that this continues to work. Pop operations continue to be
executed together as they did previously.

Test: Ia0333ac1c09e18a6d9b08fe56b1e5c080652ab5b
Change-Id: I832fe631d05dbf8e9712899fef797da1f5747f5e
2017-01-17 15:37:47 -08:00
Jorim Jaggi
10abe2fe29 When app dies, destroy snapshot
Also destroy snapshot when we remove the AppWindowToken.

Test: runtest frameworks-services -c
com.android.server.wm.SnapshotCacheTest
Test: Open app, go home, kill app, make sure snapshots are
destroyed.

Change-Id: I532c2d7499a86164175f9fcbc8b77c6eb6bfeae6
2017-01-18 00:15:26 +01:00
TreeHugger Robot
6725c8d93e Merge changes I906f6667,I42421408
* changes:
  Construct ambient view in Notification
  Notification: Refactor template parameter passing
2017-01-17 22:38:11 +00:00
Adrian Roos
487374fd6d Construct ambient view in Notification
Bug: 30876804
Test: manual
Change-Id: I906f666711a8d92b557184c652b1d6e33ae6f3d8
2017-01-17 13:06:31 -08:00
Adrian Roos
70d7aa3bd0 Notification: Refactor template parameter passing
Introduce a parameter object to reduce the amount of method overloading
we need to do now and in the future.

Bug: 30876804
Test: manual
Change-Id: I4242140835d440d910a2e2e0ee79af2271e1c046
2017-01-17 13:06:22 -08:00
Andrii Kulian
059df13f32 Merge "Add unit tests for 180 degree rotation" 2017-01-17 19:32:00 +00:00
TreeHugger Robot
5feafb1f71 Merge "Properly track fragments from pop operations." 2017-01-17 17:49:25 +00:00
TreeHugger Robot
ce29c76a1b Merge "Fix focus problems when using optimized fragment transactions." 2017-01-17 17:48:38 +00:00
TreeHugger Robot
ef99fb85f9 Merge "Make device wide DO features available if all users affiliated" 2017-01-16 18:09:51 +00:00
Esteban Talavera
d36dd15d9b Make device wide DO features available if all users affiliated
Currently, those features are available on single user devices only
(since they collect privacy sensitive data device wide). Now making
them available as long as all users are affiliated.

It'll take a certain amount of time between user creation and the DPC
of that new user setting the appropriate affiliation ids. The DO won't
be able to access the logs during that time (and won't get any "logs
ready" callback). Once the affiliation ids are set, if they match,
logs become available again - this includes logs collected while the
user was being setup. Some logs might be lost though if the amount of
data exceeds the internal limit.

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest frameworks-services

Test: cts-tradefed run cts -a armeabi-v7a --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.DeviceOwnerTest

Bug: 32326223

Change-Id: Idfe881dd6497d3ad2bead10addfd37b98b8a6e2b
2017-01-16 11:13:01 +00:00
Jesse Hall
b12249b671 Create GraphicsEnvironment for communicating with driver loaders
The GraphicsEnvironment class is given information during application
start, and makes it available to EGL/GLES/Vulkan loaders that don't
have easy access to the VM or to the application Context. Currently
only the driver path is handled, but the existing support for setting
library paths (for Vulkan extensions) and cache directory information
should move here.

Bug: 33531483
Test: various apps w/ and w/o driver package installed
Change-Id: I5820d3d1301d5461e10706f551b268c54d4f8926
2017-01-14 17:31:56 -08:00
TreeHugger Robot
18de051c98 Merge "Send EXTRA_USER with DevicePolicy lock broadcasts" 2017-01-14 17:12:57 +00:00
Bartosz Fabianowski
9e0642287e Merge "Add install reason" 2017-01-14 12:58:20 +00:00
Dmitri Plotnikov
9e9cfd93f1 Adding Notification.TvExtender API
Bug: 30972434
Change-Id: Iccdaa6253fd5a118893f2869bfb876b1d1e015c7
Test: No tests yet. Want to get a preliminary OK for the new API. Will add a test before submitting.
2017-01-13 18:13:59 -08:00
Zak Cohen
9013325c3a Merge changes from topic 'vrmode'
* changes:
  Set ui mode in UiModeManagerService to vrheadset when VR mode is enabled.
  Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.
2017-01-13 23:15:00 +00:00
Bartosz Fabianowski
a34f53f61b Add install reason
This CL allows a reason to be specified when installing a package. The
install reason is a sticky piece of metadata: When a package is e.g.
installed via enterprise policy and an update is then manually
installed or sideloaded, the install reason will remain "policy."
The install reason is tracked separately for each user.

With this CL, two install reasons exist: "policy" and "unknown." Other
install reasons will likely be supported in the future.

Bug: 32692748
Bug: 33415829
Test: Tested manually with "adb install" / "adb uninstall"

Change-Id: I0c9b9e1b8eb666bb6962564f6efd97e41703cd86
2017-01-13 16:51:28 +01:00
Winson Chung
27379c0f89 Merge "Ensure that we always resume task overlay activities if requested." 2017-01-13 07:02:51 +00:00
Winson Chung
cbcadc981b Ensure that we always resume task overlay activities if requested.
- Distinguish between task overlays that need to be resumed and
  those that should not.

Bug: 34240533
Test: Open PiP, tap to show menu.
Change-Id: Ibdb54d544c501a492260f02cdc2de40c5c1a66d1
2017-01-12 17:23:18 -08:00
TreeHugger Robot
317d0c9887 Merge "Send Snooze callback for Assistant" 2017-01-12 20:54:52 +00:00
Andrii Kulian
4ede3e0d0a Add unit tests for 180 degree rotation
These tests if an app window token reports resize when device is
rotated from landscape to seascape.
There is also some additional plumbing to be able to perform a
rotation in unit test. Also dynamic stacks are now allowed to
influence the orientation of the device.

Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
Bug: 33607506
Change-Id: I7b23e2de48d56c9fe485eae6a165378dbbbd08bb
2017-01-12 12:29:54 -08:00
Jason Monk
b2852cab46 Allow FragmentContainer to play a role in fragment construction
This allows class swapping, dependency injection, and other fun
stuff.

Test: manual
Change-Id: I93e17ccf9cebb6f542903d31597b5ea41544e069
2017-01-12 13:07:11 -05:00
TreeHugger Robot
d96cc6e250 Merge changes I2ff9bd44,I946e681e,If72df07b
* changes:
  Handle content insets for snapshots
  Always remove starting window in performShow
  Initial implementation of snapshots
2017-01-12 17:39:15 +00:00
Jeff Sharkey
9bc89af3f1 Add API for apps to declare their "category".
Upcoming platform features need to cluster apps together into broad
categories to help summarize information to users.  (For example,
when presenting battery, network, and disk usage.)

We are tightly limiting the set of categories to keep them easily
presentable to users when summarizing information.  This feature is
not designed to be a general-purpose taxonomy, nor should it be
allowed to become one.

Older apps may not have defined a category in their manifests, so
allow the installing app to define a category on their behalf.

Test: builds, boots
Bug: 33815939
Change-Id: I785b882ee7c18072ef47d56e0fc19ad72888e1b7
2017-01-12 09:53:44 -07:00
Julia Reynolds
7967230de2 Send Snooze callback for Assistant
On selection of a snooze context SnoozeCriterion.

Test: runtest systemui-notification & make cts-verifier
Change-Id: Iaca567100c29295fbbf1d327195a114106909652
2017-01-12 10:40:11 -05:00
Jorim Jaggi
e2c77f9035 Handle content insets for snapshots
Pass information about content insets of a snapshotted task to
SystemUI and use it there to correctly offset the snapshot
when drawing.

Test: Open app, go to recents, make sure app aligns before
and after the animation.
Bug: 31339431
Change-Id: I2ff9bd44534bd8f66b591385da1e1e3aec40b6c5
2017-01-12 16:28:19 +01:00
Jorim Jaggi
02886a82d8 Initial implementation of snapshots
All this functionality is hidden behind a flag. If this flag is
active, we disable the regular screenshots.

Instead, we take a screenshot when an app transition for which a
task is disappearing is starting. The screenshot gets stored
into a gralloc buffer. SystemUI uses a new method to retrieve
a snapshot gralloc buffer and then draws it using GraphicBuffer.
createHardwareBitmap().

When starting an existing activity in an existing tasks, or when
bringing an existing tasks to front from recents, we add a new
snapshot starting window. For that, we reuse the existing
starting window, but when creating the window, we use a fake
window that draws the contents of the starting window.

Test: runtest frameworks-services -c
com.android.server.wm.TaskSnapshotControllerTest
Bug: 31339431
Change-Id: If72df07b3e56f30413db5029d0887b8c9665aaf4
2017-01-12 16:28:01 +01:00
TreeHugger Robot
adf8b4ca76 Merge "Converting action bars to clusters." 2017-01-12 05:11:26 +00:00
Vadim Tryshev
1abe85c867 Converting action bars to clusters.
ActionBar keyboard navigation logic is now implemented via clusters.
Old implementation using setTouchscreenBlocksFocus and Ctrl+Shift+<
shortcut is removed.

Looking at the code, I can’t rule out existence of all 3 categories
(1) action bars with a nested toolbar, (2) action bars without a
nested toolbar and (3) Toolbars outside of action bars.
Because of this, I set “cluster” attribute both on action bar and
toolbar, and have code to avoid nested clusters in case (1).

Support lib’s action/tool bars aren’t converted, however, they
didn’t regress since Ctrl+Shift+< never worked for them. Will be
done after feature freeze.

Bug: 32151632
Test: Manual checks.
Change-Id: Ieb93980088c0fb385a9bc8a5d218ffc269b94dc5
2017-01-11 17:19:39 -08:00
Jeff Schumacher
e5dfa979cb Merge "Made ActivityManager.forceStopPackage a @SystemApi" 2017-01-11 22:34:31 +00:00
TreeHugger Robot
e12c790464 Merge "Make hidden DevicePolicyManager#getDeviceOwnerComponentOnAnyUser system API." 2017-01-11 21:11:06 +00:00
TreeHugger Robot
8b21542ba3 Merge "Added BUGREPORT_OPTION_TELEPHONY." 2017-01-11 20:45:42 +00:00
Zak Cohen
1a6acdbb86 Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.
Bug: 30989383
Test: Unit test for aapt2
Change-Id: I66dc65af6327b94fed74538bee08cada0b8be4fa
2017-01-11 11:44:47 -08:00
TreeHugger Robot
772ff11cb5 Merge "Add missing break statement to fix cts test" 2017-01-11 19:39:07 +00:00
George Mount
99c532d018 Properly track fragments from pop operations.
Bug 33849992

When popping and executing another transaction, the pop
transaction weren't properly tracking the fragments that were
added and removed.

This CL adds tracking the fragments during the pop execution.
It also fixes a small issue in when fragment state was executed
during pop.

Test: I89ed2386220deb21b417cd6674292c12accab18b
Change-Id: Ie693eef38b0136bf8ea76027dbc756b35ee9a366
2017-01-11 11:28:22 -08:00
George Mount
c21dfd9b5c Fix focus problems when using optimized fragment transactions.
Bug 33754255

Instead of making Views INVISIBLE immediately after adding them,
Views are set to transitionAlpha = 0.

Test: I966da3051912fff0f7ac42dec31626fd8248f7c2

Change-Id: Id032d363379ad07376e5ad8def6131820493e4a9
2017-01-11 11:25:38 -08:00