Commit Graph

5464 Commits

Author SHA1 Message Date
Filip Gruszczynski
ac7518854e Merge "Remaining APIs for freeform window caption." 2015-12-10 01:57:10 +00:00
Filip Gruszczynski
3dec081967 Remaining APIs for freeform window caption.
The APIs are:
* setting a listener for the area of the caption where we display
control buttons; this is intended for apps that overlay the caption on
their content, so they don't display the content in that area and clash
with the buttons;
* specifying the color pallete of controls in the caption; by default we
try to infer the best color from the theme (dark buttons for light theme
and vice versa), but in case we get it wrong, we allow the developer to
overwrite it;
* specifying the caption background during the resizing; by default we
try to infer a good color from the theme, but in case we do it wrong, we
allow the developer to overwrite this.

The CL also includes merging of layouts decor_caption_dark and
decor_caption_light into a single one. Not only it reduces code
duplication, but also is necessary for allowing adjustment of the
controls color pallete after the layout was created.

Bug: 25486369
Bug: 25818398

Change-Id: Ib87fe849b07df341893ec7873982bf7ab932f6d5
2015-12-09 13:46:30 -08:00
Chet Haase
709bf2a37c Merge "Revert "Add support for partial view layouts"" 2015-12-09 18:40:06 +00:00
Lorenzo Colitti
899d2af1df Merge "Add a new WakeupMessage class and use it in two places." 2015-12-09 13:08:21 +00:00
Chet Haase
4610eeff9c Revert "Add support for partial view layouts"
This reverts commit c55d5072ac.

There were several bugs related to incorrect handling of various
layout issues (layout not being run on containers/views that needed
it), reverting to take another run at it outside of master.

Issue #25980198  requestLayout() sometimes doesn't result in measure/layout for view

Change-Id: Ic0e159cbcf6171652d8fd1bee9ae44a3977cea04
2015-12-08 16:45:23 -08:00
Filip Gruszczynski
d427047d98 Merge "Remove Window.setDecorView API." 2015-12-09 00:13:42 +00:00
Filip Gruszczynski
9b81e406b0 Remove Window.setDecorView API.
We currently don't have a strong use case for this.

Change-Id: I106aaf1224d7934964d9b92628fd3cdd42507c46
2015-12-08 16:07:02 -08:00
Dianne Hackborn
2639c4bf6b New generic background restrictions.
This modifies the existing rigid background restriction to
a more moderate policy that we can (eventually) apply to all
apps:

- After N minutes no longer in the foreground, any background
  services running in the app are stopped and no more can be
  started.
- No manifest receivers for the application will be executed
  if the broadcast is not being sent explicitly to that app and
  the app is not running.  (Eventually we should tighten this so
  they won't be received if the app is past its N minute
  background window.)
- Other non-background processes may still bind to services in
  the background process, which will raise it to back to an
  executing state...  so things like syncs, jobs, live wallpapers,
  accessibility services, etc still work.

Change-Id: I08ddbfdf640ef324a27b2eb9eecd9499f3ebddd9
2015-12-08 12:45:18 -08:00
Lorenzo Colitti
9d3aadb247 Add a new WakeupMessage class and use it in two places.
This is useful when using the new AlarmManager direct callback
interface to wake up the system and request that an object whose
API consists of messages (such as a StateMachine) perform some
action.

In this situation, using AlarmManager.onAlarmListener by itself
will wake up the system to send the message, but does not
guarantee that the system will be awake until the target object
has processed it. This is because as soon as the onAlarmListener
sends the message and returns, the system is free to go to sleep
again.

Bug: 20157436
Bug: 25823676
Change-Id: Idff20029d287f26347441a2523b7fb20eda6a8b0
2015-12-08 23:50:23 +09:00
Amit Mahajan
547ef450bf Merge "Adding StateMachine.hasMessages(), StateMachine.hasDeferredMessages()" into mnc-dr1.5-dev am: cd2cc9aa9b am: d515b124f7
am: 0dfeda60c0

* commit '0dfeda60c06c7bdbb4fde197e50a4c46f4024bd7':
  Adding StateMachine.hasMessages(), StateMachine.hasDeferredMessages()
2015-12-07 23:51:52 +00:00
Amit Mahajan
0dfeda60c0 Merge "Adding StateMachine.hasMessages(), StateMachine.hasDeferredMessages()" into mnc-dr1.5-dev am: cd2cc9aa9b
am: d515b124f7

* commit 'd515b124f7f966a3e4725dc6f6179ade869df636':
  Adding StateMachine.hasMessages(), StateMachine.hasDeferredMessages()
2015-12-07 23:32:22 +00:00
Amit Mahajan
d515b124f7 Merge "Adding StateMachine.hasMessages(), StateMachine.hasDeferredMessages()" into mnc-dr1.5-dev
am: cd2cc9aa9b

* commit 'cd2cc9aa9bfdc21a06ffd7049a4b4ad07bbf6886':
  Adding StateMachine.hasMessages(), StateMachine.hasDeferredMessages()
2015-12-07 23:10:55 +00:00
Rubin Xu
f4b4bf633d Merge "Quick setting tile to toggle work mode for managed profiles" 2015-12-07 21:53:45 +00:00
Seigo Nonaka
012ce3453f Merge "Allow IMEs to opt out the opaque navigation guard view." 2015-12-07 21:51:06 +00:00
Rubin Xu
1205fb1d92 Quick setting tile to toggle work mode for managed profiles
Status bar will also show a different badge icon when managed profile
is in quiet mode i.e. work mode is off. The tile is invisible for now
until the full feature lands.

Bug: 22541941
Change-Id: I53f33ea346cd9215ecee2ca42de137af61e4c8a2
2015-12-07 18:24:39 +00:00
Todd Kennedy
c72b3101ee Merge "Add ephemeral installs" 2015-12-07 15:33:05 +00:00
Filip Gruszczynski
ae5fe6abb3 Merge "Remove some sized based resource (match support lib removal)." 2015-12-04 20:09:31 +00:00
Seigo Nonaka
0a9d1ea015 Allow IMEs to opt out the opaque navigation guard view.
Previous CLs [1][2] introduced an opaque navigation guard view to
avoid the island effect (the real nav bar is transparent but the IME
shows its UI with assuming that the real nav bar is opaque).
 [1] I460912ee7c117480c57b947ed31eca330819f32c
 [2] I6a93f30aec83f1cecfb854073046cbc87ab4aa66
Although the current guard view works fine for that particular case,
there are two major situations where having an opaque navigation
guard view does not make much sense.
  1. The IME shows no software keyboard at all.
     Some IMEs automatically hide software keyboard when a hardware
     keyboard is attached.
  2. The IME relies on floating UI that is disjoint from the bottom of
     the screen.
The main goal of this CL is to address case 2 because unlike case 1
the system is not able to automatically detect the case 2.  Only IME
developers know when the opaque guard view should be opted out.
Of course, if IME developers can opt out the opaque guard view,
it means that they can also work around case 1 without relying on
the system, but again it is not the primary goal of this CL.
With this CL IMEs are now able to opt out the opaque navigation guard
view by calling Window#setNavigationBarColor(Color.TRANSPARENT) from
InputMethodService#onWindowShown().  Note that this API used to have
no effect for IME, hence reusing this here should have no compatibility
issues.
Note that any other color is currently ignored to minimize the impact
on UX.

Bug: 22564251
Change-Id: Iea77915ecc55eedaf19899e72c44f704ba9d852c
2015-12-04 08:19:13 -08:00
Filip Gruszczynski
b635fdaf22 Remove some sized based resource (match support lib removal).
Bug: 25394588
Change-Id: I5b5b446667fc6ec028ec259da236967d3b2d22d2
2015-12-03 18:37:38 -08:00
Jorim Jaggi
04c2fbd6fe Draw status bar background in BackgroundFrameRenderer while resizing
To make sure there is always enough contrast between the status bar
icons and the background, we move the drawing for the status bar
background into BackdropFrameRenderer while resizing, so we can
extend the width into the full surface width.

Bug: 24365214
Change-Id: Ifbb10bacf66670c3637f6f6730a8ac47eb1c3939
2015-12-03 16:06:09 -08:00
Jorim Jaggi
6e0ce286a8 Don't remove colored bar views when relaunching
Change-Id: I518521e6b5e0b18a7f9ad9c7c6a67d55e2dfa2ab
2015-12-03 15:23:44 -08:00
Jorim Jaggi
4fa7892f35 Add flag so apps always draw status bar background
So we don't have to implement crazy magic when one app requests
drawing the status bar by itself, and the other doesn't in split
mode.

Bug: 24365214
Change-Id: I1f6a0efd0865b784402055e008da2f31e626f163
2015-12-03 15:23:27 -08:00
Todd Kennedy
2699f06555 Add ephemeral installs
* Add a new --ephemeral argument to 'adb install'
* Add plumbing to internally track ephemeralness
* Create new app directory for ephemeral installs

Bug: 25119046
Change-Id: I1d379f5ccd42e9444c9051eef2d025a37bd824fe
2015-12-03 14:47:01 -08:00
Alan Viverette
9643e73951 Merge "Ensure only one context menu is shown at a time" 2015-12-03 21:27:07 +00:00
Yohei Yukawa
0eae0eb5a6 Merge "Fix special handling of a fake language code "tl"." am: 9fd2af6b32 am: 30e321b54a
am: d42df4f68e

* commit 'd42df4f68e16bc3800d4d944caddbcbe79986fe8':
  Fix special handling of a fake language code "tl".
2015-12-03 20:00:30 +00:00
Yohei Yukawa
30e321b54a Merge "Fix special handling of a fake language code "tl"."
am: 9fd2af6b32

* commit '9fd2af6b323ef98695701a8bcfdd3ca1c4dd7965':
  Fix special handling of a fake language code "tl".
2015-12-03 19:10:30 +00:00
Clara Bayarri
10ad84a17d Create a separate Work Challenge check
This allows us to tell lock checks from FBE checks separately,
and will be useful when dealing with password unification.

Change-Id: Ifbea425f749fee4d6d51faddd8b64bf717a1a5f8
2015-12-03 16:18:53 +00:00
Yohei Yukawa
ed65bc0c62 Fix special handling of a fake language code "tl".
My previous CL 92280cd309 [1] had a silly
mistake that "tl" is converted to "fil" but "tl_PH" is not.

  [1] I94f203bddceb9c87710cb187cc3cc0ee6d9092a5

With this CL, the compatibility rewrite-rule from "tl" to "fil" starts
working regardless of the existence of countly/variant subtags in locale
string.  So far the only affected platfrom is API Level 23.

Bug: 20696126
Change-Id: Ica9cd2baac002c406f92331aadd7725d7424046a
2015-12-02 18:22:41 -08:00
Dianne Hackborn
a864049aae Merge "Fix reporting of uid state in battery stats." 2015-12-02 20:05:57 +00:00
Abodunrinwa Toki
7e29d1b4fc FloatingToolbar polish.
This patch updates the FloatingToolbar to look and transition
exactly as described in the UX spec.

It includes an animating (VectorDrawable) overflow button and
menu item buttons that sit in place during transitions.

Bug: 24257588
Change-Id: I2b3f84ba451800830878667ce1abd7a99b4f9fea
2015-12-02 11:14:43 +00:00
Dianne Hackborn
a8d10945a6 Fix reporting of uid state in battery stats.
Now that the activity manager keeps track of per-uid process states,
we can push that already rolled-up data into battery stats to directly
track the times in those states.

The problem with the reporting was actually that we weren't dealing
correctly with negative process states, which is now fixed.  (It was
interpreting them as FOREGROUND rather than not running.)

Also split out a number of new states -- TOP, FOREGROUND_SERVICE,
TOP_SLEEPING -- from FOREGROUND.  This should allow us to get a much
better idea of how much an app has been actively in use: TOP is when
it is directly visible to the user or in use by such, FOREGROUND_SERVICE
is when it is running in the background in a way the user is aware of.
Also when reporting these numbers, they are no longer added together as
reported but kept as separate times.

Change-Id: I6d307503a4b4ad5c0d5d49305ef63f8eb858e2c9
2015-12-01 16:53:28 -08:00
Tom Taylor
32363a023a Merge "TRON: log changes to the default SMS app" 2015-12-01 18:00:39 +00:00
Selim Cinek
4fb12d3f8e Made the bigtext now nicely float around the image
If there is an image instead of applying the same
margin everywhere, the text now floats around the
image.

Change-Id: I87f9ca9f51fb270b0732a99374544381bd1fc4e0
2015-11-30 17:45:15 -08:00
Tom Taylor
2be1b0e975 TRON: log changes to the default SMS app
Bug 25929677

Add a constant for logging the action when a user changes the default
SMS app.

Change-Id: If0b0919f795390e98c33bcac849614c07ef1442f
2015-11-30 16:29:17 -08:00
Yohei Yukawa
8ce2a538d9 Use Context.getSystemService(Class<T>) for InputManager.
This is a mechanical replacement of Context.getSystemService(String)
with Context.getSystemService(Class<T>) when retrieving InputManager.
Note those are bundled code.  Hence we don't need to make sure
Build.VERSION.SDK_INT >= 23.

Change-Id: Iee47e374e1349720e3100bab33ed139e1f47c169
2015-11-26 00:02:11 -08:00
Yohei Yukawa
0466206a6a Merge "Tell the reason why IMM called startInput()." 2015-11-25 20:36:13 +00:00
Alan Viverette
021627eb58 Ensure only one context menu is shown at a time
Refactors the menu helper classes. Both classes now implement a common
MenuHelper interface, which eliminates the need to keep separate helpers
on PhoneWindow and unifies the DecorView showContextMenuForChild()
implementations.

We now explicitly dismiss any previously shown context menu before showing
a new context menu. Previously we relied on the modal nature of the dialog
context menu to prevent multiple menus from being opened at once, but this
is no longer reliable with popup context menus.

Bug: 25656520
Change-Id: Idab3daa6d6888f803f2e33660fe1dd488e4c28d1
2015-11-25 14:22:00 -05:00
Yohei Yukawa
35d3f37bd5 Tell the reason why IMM called startInput().
As a preparation to fix Bug 25373872, this CL introduces an additional
int parameter into the following two methods
  - IInputMethodManager.startInput()
  - IInputMethodManager.windowGainedFocus()
so that IMMS can know why IMM needs to start input.  Currently the
"startInputReason" parameter is used only for debug message only when
the OS is rebuilt with flipping IMMS#DEBUG to true.  Basically this
should have no impact in production builds except for a tiny overhead
of having one int parameter in some internal IPC calls.

Note that since 7663d80f6b [1] basically
IMMS#windowGainedFocus() has been a superset of IMMS#startInput().
Hence we should pass to "startInputReason" parameter to
IMMS#windowGainedFocus() as well as IMMS#startInput().

  [1]: Icb58bef75ef4bf9979f3e2ba88cea20db2e2c3fb

Bug: 25373872
Change-Id: Ia1fe120af7d71495c5f3a4fc0ec6390efb8240ca
2015-11-25 11:07:19 -08:00
Filip Gruszczynski
811dc3b42b Allow preloading of freefore multi window drawables.
Bug: 25081468
Change-Id: Ic6ec6050882e5362e1ab8734962d163fff04b53d
2015-11-23 18:16:24 -08:00
Filip Gruszczynski
a7308c1bd8 Merge "Handling touch events on the caption." 2015-11-21 00:42:01 +00:00
Filip Gruszczynski
edb6e12014 Merge "Remove allow_stacked_button_bar from support library." 2015-11-20 22:02:57 +00:00
Alan Viverette
3c5aeef512 Merge "Dispatch the actual PopupWindow dismiss callback to PopupMenu" 2015-11-20 21:59:19 +00:00
Filip Gruszczynski
a33bdf372c Handling touch events on the caption.
We need a more sophisticated touch handling to support overlaying the
caption. The touch events need to be routed in following order:
close/maximize buttons, application content, caption dragging.

Bug: 25486369
Change-Id: I9d4e971fb055c217c0bd83f0490fb42a5c22e93b
2015-11-20 13:25:24 -08:00
Julia Reynolds
e31444f7c9 Merge "Implement notification ranking by topic." 2015-11-20 20:31:08 +00:00
Alan Viverette
708aa9d964 Dispatch the actual PopupWindow dismiss callback to PopupMenu
Previously the dismiss callback was called immediately after the menu
received a close request; however, the dismiss callback implies that
the menu's window has finished animating and been removed from the
window manager.

Also cleans up handling of mPopup in MenuPopupHelper to prevent
unnecessary MenuPopup allocations and convert unnecessary fields into
method arguments.

Bug: 25323707
Change-Id: I8e3877ae6c40b4d0f1df23a4ff4fa48a7df34e0d
2015-11-20 15:21:30 -05:00
Alan Viverette
be5ec13acf Merge "By default, display PopupMenu at Gravity.START and resolve X offset" 2015-11-20 19:27:44 +00:00
Julia Reynolds
233a5f97ea Implement notification ranking by topic.
Including sensitive notification visibility & DND bypass.

Bug: 22451710
Change-Id: I5f3a0c6d59de0495cb904bad6f886eb29ed4bda4
2015-11-20 14:25:07 -05:00
Filip Gruszczynski
66f1ba01c1 Remove allow_stacked_button_bar from support library.
Bug: 25394588
Change-Id: Id7896746aebeab273297f3c5e78f0f794fa5bc82
2015-11-20 10:57:19 -08:00
Alan Viverette
d6443f60e1 By default, display PopupMenu at Gravity.START and resolve X offset
Bug: 25801269
Change-Id: I8c8090a59780c131cee2d56b668f1c4e062b8ebe
2015-11-20 13:57:15 -05:00
Adam Lesinski
e98c57a829 Merge "Fix batterystats battery level int packing" 2015-11-20 18:53:03 +00:00