Commit Graph

10565 Commits

Author SHA1 Message Date
TreeHugger Robot
2ac9698271 Merge "Reorganize font enumeration API." into oc-dev 2017-04-04 16:49:56 +00:00
Jorim Jaggi
1edadac465 Merge "Handle case when snapshot dimensions don't match" into oc-dev 2017-04-04 09:14:38 +00:00
TreeHugger Robot
a52fc49845 Merge "Themes: Apply themes to system_server safely" into oc-dev 2017-04-04 03:25:29 +00:00
TreeHugger Robot
78e8ac9c14 Merge "Framework support to improve bg check CTS tests." into oc-dev 2017-04-03 22:26:01 +00:00
Seigo Nonaka
ff55115121 Reorganize font enumeration API.
This CL cleans up APIs around font variation settings.
- Remove FontConfig and FontManager public API.
- Remove FontManagerService from system service.
- Extract inner class FontConfig.Axis as top-level class FontVariationAxis.
  This is used by Typeface.Builder public API to create new Typeface.
- Introduce and expose FontVariationAxis utility functions from/to string.
- Throws if the invalid font variation settings is passed.

Test: android.text.cts.FontVariationAxisTest passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.cts.PaintTest passes
Change-Id: I9ccafe7a53935960566243e2856e166878ca59ae
2017-04-03 13:55:07 -07:00
TreeHugger Robot
dcc792a13f Merge "Persistent connection to DO/PO service." into oc-dev 2017-04-03 20:35:18 +00:00
Winson Chung
34ecbaa991 Merge "Ensuring multi-window callbacks contain new configuration and are in order" into oc-dev 2017-04-03 18:23:31 +00:00
Chad Brubaker
e35d50622c Merge "Rename READ_PHONE_NUMBER to READ_PHONE_NUMBERS" into oc-dev 2017-04-03 17:34:13 +00:00
TreeHugger Robot
e9679db5e2 Merge "Allow committing allowing state loss on detached FragmentManager." into oc-dev 2017-04-03 16:34:17 +00:00
Jorim Jaggi
aea6b74e17 Handle case when snapshot dimensions don't match
If the snapshot starting window has different dimensions than the
snapshots we have taken, we do the following:

- Create a child Surface that has exactly the dimensions of the
snapshot.
- We fill the parent surface with the app background color, as well
as all screen background decorations (status bar background,
navigation bar background).
- We also clip of the status bar/navigation bar background in some
cases, as it looks ugly if it's not behind the system bars.
- Furthermore, we inherit all layout flags on the window and all
layout relevant SystemUI flags on the window such that it's very
likely that the size will match, and the system bars are drawn
correctly.
- In order to make the transition from the snapshot to the real
window a bit more predictable/less messy, we enforce a minimum
duration the snapshot is visible, which is slightly more than our
app transitions.

Test: TaskSnapshotSurfaceTest
Test: Open app, go home, go landscape, open app again
Test: Go to multi-window, open app from recents with a snapshot
taken in fullscreen.

Fixes: 36703868
Change-Id: Ia2d4add6971a18ab7aa2942d2b644d6e87a402af
2017-04-03 15:36:29 +02:00
TreeHugger Robot
4d558930c8 Merge "Created an HtmlInfo object on ViewStructure." into oc-dev 2017-04-01 02:34:03 +00:00
Dianne Hackborn
9484603c0f Framework support to improve bg check CTS tests.
(Finally) introduce a new ServiceConnection callback to
tell you when the binding has died.  This allows you to robustly
have a weak service monitoring, and also is an easy way to find
out about breakages due to app updates etc.

Also clean up some debug output.

Test: moved to own suite and ran them.

Change-Id: I526cc00816c384fa9eb1312b92406f38085cbff9
2017-03-31 17:58:38 -07:00
Winson Chung
5af42fc305 Ensuring multi-window callbacks contain new configuration and are in order
- This CL has two main changes:
  1) It modifies the activity multi-window and picture-in-picture mode
     changed callbacks to provide the configuration of the activity with
     the mode applied.
  2) It modifies the order in which the multi-window and picture-in-picture
     mode callbacks are made, to ensure that when going in and out of
     picture-in-picture: first PiP, then MW, and then the config change.
- Previously, the ordering of the two callbacks was inconsistent.  When
  calling moveActivityToPinnedStack(), we reparent the task into the pinned
  stack (triggering the picture-in-picture mode change), followed by the
  resize animation (causes configuration changes).  Inversely, when we
  expand the task to fullscreen (and not just remove it), we run the
  animation first, which resizes the task to the final size (causes
  configuration changes) then reparent after the animation completes
  (triggering the picture-in-picture mode change).

  In this CL, we ensure that for both the transition in and out of PiP, we
  defer to the bounds animation to trigger the PiP mode change.  Normal
  calls to reparent or adding a new task are unchanged.  When the PiP
  mode change is called from the animation, it provides the final target
  bounds which we use to calculate the target configuration of the activity
  for the callback.  If the bounds animation is interrupted, an update will
  also be scheduled if we change the fullscreen state we are animating to.

  To work around the issue where we are scheduling MW/PiP mode changes in
  both the animation and the configuration change, we also now keep track
  of each state internally in the ActivityRecord.

Bug: 36099777
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testConfigurationChangeOrderDuringTransition

Change-Id: I03513bc3a4d4a72c250983f22f079ce9d7a2cb40
Signed-off-by: Winson Chung <winsonc@google.com>
2017-03-31 17:04:26 -07:00
TreeHugger Robot
f04d039584 Merge changes from topic 'launch-2d-activities-vr' into oc-dev
* changes:
  Allow shell uid to access Vr APIs
  Add vr persistent mode enable/disable
  Launch 2D activities in VR mode
2017-03-31 23:48:22 +00:00
TreeHugger Robot
2d161b1d3f Merge "Implement issue #36590595: Add ability to associated a ClipData with JobInfo" into oc-dev 2017-03-31 23:21:11 +00:00
Makoto Onuki
fc73d799e9 Persistent connection to DO/PO service.
Test: Manual test with customize API tests; CTS coming.
Change-Id: I1d7eaa4b1fdd20726c1832c736d32f934c6a82f9
2017-03-31 14:50:20 -07:00
Chad Brubaker
0c1651f289 Rename READ_PHONE_NUMBER to READ_PHONE_NUMBERS
Bug: 35853790
Test: make -j128 checkbuild
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
Change-Id: I11d374cbbb6c2deaf74ac784ff995bd182fe9157
2017-03-31 11:20:02 -07:00
Dianne Hackborn
a47223f99b Implement issue #36590595: Add ability to associated a ClipData with JobInfo
Yum!

Also needed to have a Context.revokeUriPermission() variant that is sane,
so reasonable CTS tests can be written.

Test: new ClipDataJobTest added.

Change-Id: Ia3135ea788a6e32c971bae7dab3a844d0ef4139c
2017-03-31 10:41:50 -07:00
Julia Reynolds
ed8d07f213 Merge "Rename badge icon method" into oc-dev 2017-03-31 16:34:03 +00:00
Karthik Ravi Shankar
99493dbc94 Launch 2D activities in VR mode
When in VR mode, launch all activities into the virtual display ID as
provided by the Compatibility display. This includes two cases -

- New activity launches
- Existing activity in the background.

Testing Done: Tested with PlanarVirtualDisplay app and Settings,
Calculator and GestureApp with different intent flags.

Bug: 36071574
Bug: 36071445
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testVrActivityLaunch
Test: #testVrActivityReLaunch

Change-Id: Ic590a7cbd6f9b339dc83b22a8ffb1252219ef22e
Signed-off-by: Karthik Ravi Shankar <karthikrs@google.com>
2017-03-31 08:37:05 -07:00
Anton Philippov
537fd18eaf Merge "Fix BackupManagerMonitor wrapping in RestoreSession" into oc-dev 2017-03-31 10:43:28 +00:00
TreeHugger Robot
1a098cf62b Merge "Rename autoFillHint to autoFillHints." into oc-dev 2017-03-31 01:41:45 +00:00
Chris Tate
4a0e84b454 Merge "Reschedule jobs that crash partway through" into oc-dev 2017-03-30 23:46:39 +00:00
Philip P. Moltmann
81192b40de Rename autoFillHint to autoFillHints.
Fixes: 35364993
Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
Change-Id: I65a4c2c65563e7bbd60c4e99c8800b0b11af2300
(cherry picked from commit feb3299ed5)
2017-03-30 23:45:33 +00:00
Felipe Leme
25bf787ffb Created an HtmlInfo object on ViewStructure.
The ViewStructure typically represents a View, but it it can also be a virtual
view; in particular, WebView uses virtual views to represent HTML elements.

Although most of the properties of the HTML element maps to properties of
Android Views, some properties (such as 'name' and 'id' on <INPUT> fields)
don't, and those are crucial for autofilling web pages.

Rather than trying to artificially map these properties, it's better to create
a generic representation, for the following reasons:

1. Web standards move in a different velocity than Android APIs
2. Android APIs cannot be changed easily. Deprecated APIs continue to work,
   and new added APIs don't work in older versions
3. The data used for autofill is opaque to the Framework - it's only relevant
   to the node producers (like WebView) and consumers (Autofill services).

Also removed the setIdEntry() that was used for the same purpose.

Fixes: 36696757
Bug: 36718508
Test: VirtualContainerActivityTest with new checks pass

Change-Id: Ia626bd1f640b0b5861e81a5915504b95029874c9
2017-03-30 14:24:05 -07:00
George Mount
fe0ad1c290 Allow committing allowing state loss on detached FragmentManager.
Bug 36702993

Instead of throwing an exception during commitAllowStateLoss()
or commitNowAllowingStateLoss(), silently drop the transaction
when the FragmentManager is detached.

Test: I7093457c2b4936b95ab086dbe947571f0b525f63
Change-Id: I77641b69f2573fc895a27ec9da63c2d2ab6d7a4e
2017-03-30 13:03:59 -07:00
Christopher Tate
08992ac57e API refactor: context.startForegroundService()
Rather than require an a-priori Notification be supplied in order to
start a service directly into the foreground state, we adopt a two-stage
compound operation for undertaking ongoing service work even from a
background execution state.  Context#startForegroundService() is not
subject to background restrictions, with the requirement that the
service formally enter the foreground state via startForeground() within
5 seconds.  If the service does not do so, it is stopped by the OS and
the app is blamed with a service ANR.

We also introduce a new flavor of PendingIntent that starts a service
into this two-stage "promises to call startForeground()" sequence, so
that deferred and second-party launches can take advantage of it.

Bug 36130212
Test: CTS

Change-Id: I96d6b23fcfc27d8fa606827b7d48a093611b2345
(cherry picked from commit 79047c62b5)
2017-03-30 18:31:24 +00:00
Maurice Lam
257047b24b Merge "Make Notification.EXTRA_ALLOW_DURING_SETUP system API" into oc-dev 2017-03-30 18:04:24 +00:00
Evan Rosky
f114667f2d Merge "Allow ToolbarActionBar to pass-through unhandled keyShortcuts" into oc-dev 2017-03-30 16:46:27 +00:00
Julia Reynolds
612beb2f2f Rename badge icon method
Test: make
Change-Id: Ic7f7dc3319ba4ffa67e1e02acd1828ca46975baf
2017-03-30 11:42:35 -04:00
Christopher Tate
b2087f874c Reschedule jobs that crash partway through
We were properly re-running jobs if the app hung during their
execution, but outright crashes wound up with the scheduled job
being dropped.  That's bad; it can easily lead to broken monitoring
in the case of content-triggered jobs.

We now reschedule with backoff when this happens.  In addition, to
mitigate the impact of repeatedly crashing apps, we now enforce a
minimum backoff interval of 10 seconds for automatic reschedules.

Bug 36030229
Test: manual

Change-Id: Ib5da583d7901d1255066c48558b35186eb641e17
2017-03-29 18:12:36 -07:00
Evan Rosky
c46203785c Allow ToolbarActionBar to pass-through unhandled keyShortcuts
It was consuming all keyShortcuts which broke system hotkeys
like shift+tab.

In order to prevent the decor/phonewindow from creating menus,
this creates a dummy view in onCreatePanelView.

This also includes a change to Activity to not send KEYCODE_TAB
keystrokes to the defaulthandler. This was preventing keyboard
navigation from working on any activity that had a default
search fallback.

Bug: 32482282
Bug: 18021345
Test: Added a CTS test (ToolbarTest#testKeyShortcuts) for toolbar
      keyShortcuts. Verified Tab-navigation works in Play Store.
Change-Id: I5c732a2b21219157818bed49576debd20d5a8178
(cherry picked from commit b22faf524e)
2017-03-29 23:41:47 +00:00
Maurice Lam
96c1003e1a Make Notification.EXTRA_ALLOW_DURING_SETUP system API
Test: Manually tested setup wizard notifications continue to work
Bug: 34705874
Change-Id: If2bff20a74caeac5041d97f1656138676c93f554
2017-03-29 16:19:54 -07:00
George Mount
5dd7c9af6d Fix getting wrong instance when restoring non-config
Bug 36679897

When restoring the non-config fragments, the wrong index was
being used to lookup the fragment fromt the list of active
fragment states.

Test: Ic862fd9670408dab09ab5817cdec21e91aef001b
Change-Id: Ic5a8e723041949e6d01d4f5ddc6d54e491143b59
2017-03-29 15:17:44 -07:00
George Mount
c7146beabe Make public getFragments() and onGetLayoutInflater() methods
Bug 34703669
Test: I846ef668e3dd7d664cfb56d2b9400467ba9b79f4
Change-Id: Ie202960ada86b25e964f98a639b5f5740c8fdb79
2017-03-29 14:58:42 -07:00
Anton Philippov
68faa93ce9 Fix BackupManagerMonitor wrapping in RestoreSession
Do not wrap a null monitor, pass a null wrapper instead.
BackupManagerService expects null monitor wrapper, so this
will prevent extra work for BMS and potential NPEs.

Bug: 36470662
Test: manual
Change-Id: Ia45375049101f757542960bc7f1fd640fc9c3fb7
2017-03-29 16:00:32 +01:00
Tony Mak
ec319aba34 Introduce AMS.getLastResumedActivityUserId to fix work profile icon issue
Problem:
Work profile status bar icon feeature is relied on two callbacks
1. onForegroundProfileSwitch  (AMS.setResumedActivityLocked)
2. appTransitionStarting (WMS)

We assume callback 1 is always called before 2, but it is not the case.
These two callbacks are triggered by two handlers in two different threads,
and hence race condition happens.

Solution:
Not rely on onForegroundProfileSwitch to update mManagedProfileFocused
flag anymore. Query getLastResumedActivityUserId in appTransitionStarting.
Also, make sure mLastResumedActivity is updated before sending message
to WMS in setResumedActivityLocked.

Test: Start a work app, observe that the work icon is shown.
Test: Start a personal app, observe that work icon is gone.
Test: Dock the work app, tap on it (give it focus), observe that work
      icon is shown.
Test: Start a work app, switch user, can see the icon is gone. Switch back,
      icon is back.

Bug: 34159089

Change-Id: I2cee141d18e8b7d5607b26dd7a2fd5bc9cd0ebb3
2017-03-29 10:03:39 +00:00
Jeff Tinker
79a973f643 Revert "Make public getFragments() and onGetLayoutInflater() methods"
This reverts commit 599be3d01e.

This change is being reverted because it broke git_master build.

Change-Id: I54ab9cd3d9e08dcf870f472fda08cc44e57986d0
bug: 34703669
2017-03-29 01:25:06 +00:00
Adam Lesinski
a82b62678a Themes: Apply themes to system_server safely
Creates a new UI Context for UI based operations.
This UI Context is wired up the same way a normal app
Context would be, and is subject to change when overlays
are enabled/disabled.

For this reason, only UI should be using this new Context.
All other operations should be using the original system Context
so that changing themes don't impact the regular operations of
system_server.

Also added some sanity checks at key places where we show UI
(ShutdownThread, BaseErrorDialog).

Bug: 36059431
Test: $ adb shell am crash com.android.settings
Test: Observe crash and power off dialogs are blue with PixelTheme
Change-Id: I87227ee2e0be1e72dcde8f482b37725cb687260b
2017-03-28 17:31:00 -07:00
TreeHugger Robot
c8d8c27c68 Merge "Make public getFragments() and onGetLayoutInflater() methods" into oc-dev 2017-03-28 23:43:23 +00:00
TreeHugger Robot
36e2483663 Merge "Add Configuration param to onMovedToDisplay" into oc-dev 2017-03-28 21:36:40 +00:00
Chad Brubaker
336ae5b616 Add ACTION_EPHEMERAL_RESOLVER_SETTINGS
This Intent will be used in Settings to show the settings UI for the
Ephemeral resolver. Settings can get the correct component to send the
Intent to by calling
PackageManager.getInstantAppResolverSettingsComponent

Bug: 35918998
Test: Boots
Change-Id: I0edcf85704f2c19e0ee27f91b6ef057d52e32778
(cherry picked from commit aa49cb86e6)
2017-03-28 20:34:55 +00:00
Andrii Kulian
e5c58eefb1 Add Configuration param to onMovedToDisplay
To be consistent with other multi-window callbacks adding
Configuration param to the onMovedToDisplay, so that app
developer can handle configuration change at the same time
when it receives a notification about move.

Bug: 36649499
Test: android.server.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Change-Id: I80c765473bfc09ea1fb7aa4e2e77baf3b21606b8
(cherry picked from commit 2c32a11a71)
2017-03-28 17:28:17 +00:00
TreeHugger Robot
7ec7ef2ba3 Merge "Support loading a stub WebView using a donor package." into oc-dev 2017-03-28 17:11:26 +00:00
George Mount
599be3d01e Make public getFragments() and onGetLayoutInflater() methods
Bug 34703669

Test: I71856306a7bb67aacb84be17165e7e095653c20a
Change-Id: I41999d0f5e6d75afebbbf67ad5bf49fa0cca509e
2017-03-28 16:38:08 +00:00
Amith Yamasani
759922d9db Revert "Logging to track #36406078"
Not needed anymore, since the bug was found to be in the binder driver.

This reverts commit 9afb1fc495.

Change-Id: I3891866f6e30a3f3391df8005e56bf9b9777b3a6
(cherry picked from commit ab5523f337)
2017-03-28 16:35:12 +00:00
Torne (Richard Coles)
0452670374 Support loading a stub WebView using a donor package.
Support loading a WebView package which specifies the name of a "donor"
that provides missing files. This allows a preinstalled stub WebView to
function by loading its code and assets from the preinstalled Monochrome
implementation, as long as the versions are close enough that the
manifest contents are compatible, which should be fine since
preinstalled versions will match.

To do this, we replace the stub's code paths in AppplicationInfo with
the donor's, so that all Java and native code and resources are loaded
from the donor APK at runtime instead of from the (mostly empty) stub.

To get the ClassLoader with the modified path cached as if it was the
regular path, we introduce a new "cacheKey" parameter in
ApplicationLoaders.

Bug: 21643067
Test: build "new" stub WebView upstream in chromium and test loading
Change-Id: I08cc9122b1c9def3e1206974f3e0e8973cca3419
2017-03-28 16:21:10 +00:00
TreeHugger Robot
a2bd52aca3 Merge "Fix issue with task overlay activities not finishing." 2017-03-28 02:02:34 +00:00
Winson Chung
6954fc9a7e Fix issue with task overlay activities not finishing.
- The task overlay activity should only exist when there are activities
  present in the task.  When the last such activity is finished, we should
  remove the whole task entirely including the task overlay.
- Exposing the task overlay apis to CTS

Bug: 36507456
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testFinishPipActivityWithTaskOverlay
Change-Id: I1dabe7782fb6769a90d832664e8052be158041e1
2017-03-27 13:34:53 -07:00
TreeHugger Robot
5e01870015 Merge "Unbind from service on app killed and dedup association requests" 2017-03-27 18:43:37 +00:00