2386 Commits

Author SHA1 Message Date
Dianne Hackborn
c4aad01cbb Formalize overscan metrics.
The window manager now maintains and reports a new formal
"overscan insets" for each window, much like the existing
content and visible insets.  This is used to correctly
position the various UI elements in the various combination
of layout options.  In particular, this allows us to have
an activity that is using fitSystemWindows to have the content
of its UI extend out to the visible content part of the screen
while still positioning its fixed UI elements inside the
standard content rect (and the entire window extending all
the way into the overscan area to fill the screen as desired).

Okay, maybe that is not written so clearly.  Well, it made
my head hurt too, so suffer!

The key thing is that windows now need to know about three
rectangles: the overall rectangle of the window, the rectangle
inside of the overscan area, and the rectangle inside of the
content area.  The FLAG_LAYOUT_IN_OVERSCAN option controls
whether the second rectangle is pushed out to fill the entire
overscan area.

Also did some improvements to debug dumping in the window
manager.

Change-Id: Ib2368c4aff5709d00662c799507c37b6826929fd
2013-02-22 19:14:37 -08:00
Craig Mautner
3c1743705c Create rotation animation modes.
Allow fullscreen windows to specify crossfade or jumpcut animations
that override the default rotation animation. Only if the incoming
and outgoing topmost windows are fullscreen and both specify the
same animation to use.

Fixes bug 8182773.

Change-Id: I6b3c0020d7bd2cdfba5c66189e114ec62cd54fcf
2013-02-22 10:44:52 -08:00
Jim Miller
a75a883fe9 Add explicit userId to AppWidget binder calls
Keyguard currently relies on being in the system process to grab the
given user's widgets.  When we split keyguard into a new process,
it will need to have access to user-specific info to instantiate a
specific user's widgets.  In order to accomplish this, we add an
explicit userid to each binder call as well as new permission
check to allow keyguard access.

This also fixes a potential race condition of having an incorrect user id
due to an async call to change the user.  Every binder call now has a specific
user id. The user id is either the calling process user's id or an explicit
one passed by applications like keyguard. It is created once when an
AppWidgetManager is instantiated and remains for the lifetime of the object.

Fixed bug where widgets sometimes didn't show up for secondary users.

Moved permission check in AppWidgetService into getImplForUser()

Refactored to use userid from context associated AppWidgetManager instance.

Clean up AppWidgetHost to use userId from Context.

Remove redundant userId check in checkPermission since it's handled by
ActivityManager.handleIncomingUser()

Removed redundant userid check.

Upload after rebase...

Change-Id: Iae3e20f2b342c323bb58768b3d22051510f8268b
2013-02-20 15:41:14 -08:00
Michael Wright
b854e24d3a Add default handlers for brightness keys
Change-Id: Ic57ba8cb159f08e0cde32350cb2d5eb34f68f830
2013-02-20 14:40:12 -08:00
Dianne Hackborn
313440842b Overscan improvement: all apps extend to overscan area.
Introduce another new rectangle in window layout, the
restricted overscan region.  This is for windows that can
be in the restricted region (that is, full screen but with
hard restrictions like the nav bar) but whose content can
be adjusted for the overscan constraints.

In other words, normal application windows now always extend
into the overscan region, and we push their content inside
of it.

Change-Id: Ibccf3d7f144912d49de3fc497c1ec2e8e0b7f714
2013-02-19 19:28:11 -08:00
Michael Jurka
f9b9ead5d4 Merge "Fix bug with clock when keyguard widgets disabled" 2013-02-19 22:10:48 +00:00
Dianne Hackborn
c652de8141 Implement display overscan support.
The window manager now keeps track of the overscan of
each display, with an API to set it.  The overscan impacts
how it positions windows in the display.  There is a new set
of APIs for windows to say they would like to go into the
overscan region.  There is a call into the window manager to
set the overscan region for a display, and it now has a
concept of display settings that it stores presistently.

Also added a new "wm" command, moving the window manager
specific commands from the "am" command to there and adding
a new now to set the overscan region.

Change-Id: Id2c8092db64fd0a982274fedac7658d82f30f9ff
2013-02-19 12:08:58 -08:00
Michael Jurka
fc2dbb2f3a Fix bug with clock when keyguard widgets disabled
Clock widget no longer alternates between
bold and non-bold versions

Bug: 7662061

Change-Id: I866d4b42493df3a6449d8eabc3ea140dc39dac57
2013-02-15 14:20:05 +01:00
Mathias Jeppsson
d1443e9944 Fix starting window memory leak
If starting window is added to arrays like mViews in
WindowManagerImpl.java, but not accepted by WindowManagerService,
we leak starting windows. To avoid leaking, remove the view
from WindowManager.

Change-Id: I4d98b883e9dfaf5e71bdece385643ba1b59b2633
2013-02-13 11:14:23 +01:00
Craig Mautner
005f6f6077 Merge "Reset SensorEventListener when listener reenabled." 2013-02-11 17:47:14 +00:00
Craig Mautner
eee29c445c Reset SensorEventListener when listener reenabled.
- Following disable and reenable of the WindowOrientationListener
the state was the same as before. State should be reset to default.

- Provide a Handler to the sensor task to deliver events on the
same Thread that WindowManagerPolicy operates on.

- Expand lock protection to all of WindowOrientationListener.

- Move WindowOrientationListener to policy package.

- Make SensorEventListenerImpl non-static.

Fixes bug 7964531.

Change-Id: I17cecf3d0b6d125cb3e4d7350c3adb3f62b684bd
2013-02-11 09:46:08 -08:00
Alan Viverette
b428b0fc5b Delay accessibility announcements in the keyguard.
Prevents interruption of announcements when magnification is enabled.

Bug: 7895569
Change-Id: I87ae1ee41ade2b59a0f1da8046c5bd23d0637da2
2013-02-07 12:19:15 -08:00
Dianne Hackborn
c2293025a2 App ops: track system windows, monitoring changes.
Change-Id: I273e82bdad66ada3bf0f7ec9176bc304b9ee1ee8
2013-02-06 23:59:56 -08:00
Romain Guy
15a4620b18 Fix graphics corruption in WiFi password dialogs
The ActionBarContextView popup window was set to use the "layout in screen"
and "inset decor" flags even though it's not a fullscreen window. This was
causing the popup window to be created by taking up all the available space.
Because the views inside the popup window are wrap_content, this would cause
part of the window to not be drawn and since the window is, correctly,
marked opaque, we would get random graphics corruption on screen (the user
would see the content of the tiles on a tiled renderer such as QCOM's.)

This change simply removes the two unnecessary flags from the popup window,
forcing it to be created and laid out at the exact size it needs. It will
be properly positioned by the window manager underneath the status bar.
An interesting side effect is that the window is now smaller than before
(since it doesn't extend underneath the status bar) which saves a bit of
memory.

The popup window also contains an unncessary black background behind the
action bar context view. This helps in a way because it allows us to
create an opaque window but it increases the required bandwidth to draw
that window. Given the benefits for SF it's probably best we keep the
window the way it is for now.

Change-Id: I4aeeb42a6232ff6b71811e766846d45635eb3365
2013-02-04 18:49:38 -08:00
Dianne Hackborn
f265ea9d83 App ops: vibration, neighboring cells, dialing, etc.
Improve handling of vibration op, so that apps are
better blamed (there is now a hidden vibrator API that
supplies the app to blame, and the system now uses this
when vibrating on behalf of an app).

Add operation for retrieving neighboring cell information.

Add a new op for calling a phone number.  This required
plumbing information about the launching package name through
the activity manager, which required changing the internal
startActivity class, which required hitting a ton of code that
uses those internal APIs.

Change-Id: I3f8015634fdb296558f07fe654fb8d53e5c94d07
2013-02-01 15:14:29 -08:00
Svetoslav Ganov
d0fd54648c Merge "Adding UI test automation APIs." 2013-01-29 03:16:40 +00:00
Michael Wright
a1deeba325 Merge "Add plumbing for Recent Apps keycode" 2013-01-28 22:32:45 +00:00
Dianne Hackborn
f9c5e0fe83 Add new API to propagate contextual data to the assist action
When launching an assist, we have a new API allowing the
current foreground activity/application to provide additional
arbitrary contextual information that is stuffed in the
assist intent before it is launched.

Change-Id: I0b2a6f5a266dc42cc0175327fa76774f814af3b4
2013-01-23 14:39:13 -08:00
Michael Wright
c9ebea79b4 Add plumbing for Recent Apps keycode
Change-Id: Id1bd8deced1be924cf9b3bbbf19e689b6b759061
2013-01-22 21:26:18 -08:00
Svetoslav Ganov
80943d8daa Adding UI test automation APIs.
This change adds APIs support for implementing UI tests. Such tests do
not rely on internal application structure and can span across application
boundaries. UI automation APIs are encapsulated in the UiAutomation object
that is provided by an Instrumentation object. It is initialized by the
system and can be used for both introspecting the screen and performing
interactions simulating a user. UI test are normal instrumentation tests
and are executed on the device.

UiAutomation uses the accessibility APIs to introspect the screen and
a special delegate object to perform privileged operations such as
injecting input events. Since instrumentation tests are invoked by a shell
command, the shell program launching the tests creates a delegate object and
passes it as an argument to started instrumentation. This delegate
allows the APK that runs the tests to access some privileged operations
protected by a signature level permissions which are explicitly granted
to the shell user.

The UiAutomation object also supports running tests in the legacy way
where the tests are run as a Java shell program. This enables existing
UiAutomator tests to keep working while the new ones should be implemented
using the new APIs. The UiAutomation object exposes lower level APIs which
allow simulation of arbitrary user interactions and writing complete UI test
cases. Clients, such as UiAutomator, are encouraged to implement higher-
level APIs which minimize development effort and can be used as a helper
library by the test developer.

The benefit of this change is decoupling UiAutomator from the system
since the former was calling hidden APIs which required that it is
bundled in the system image. This prevented UiAutomator from being
evolved separately from the system. Also UiAutomator was creating
additional API surface in the system image. Another benefit of the new
design is that now test cases have access to a context and can use
public platform APIs in addition to the UiAutomator ones. Further,
third-parties can develop their own higher level test APIs on top
of the lower level ones exposes by UiAutomation.

bug:8028258

Also this change adds the fully qualified resource name of the view's
id in the emitted AccessibilityNodeInfo if a special flag is set while
configuring the accessibility service. Also added is API for looking
up node infos by this id. The id resource name is relatively more stable
compared to the generaed id number which may change from one build to
another. This API facilitate reuing the already defined ids for UI
automation.

bug:7678973

Change-Id: I589ad14790320dec8a33095953926c2a2dd0228b
2013-01-22 17:56:53 -08:00
Amith Yamasani
d4fe37bee7 Merge "Rename bindService to bindServiceAsUser to follow convention." 2013-01-16 23:26:30 +00:00
Amith Yamasani
27b89e6658 Rename bindService to bindServiceAsUser to follow convention.
This is for the multi-user version of bindService, not the original.

Change-Id: Ib2de35941196accf387b1a276a77e6f9af805ec0
2013-01-16 12:30:11 -08:00
Chris Wren
56018e577e port system ui over to new ICU date formatting API.
Bug: 7288134
Change-Id: Icea2ff96fd91c6db66b3aad6f6653b21203351b1
2013-01-15 17:14:48 -05:00
Christopher Tate
58f41ecfa5 Migrate BUGREPORT_IN_POWER_MENU from Secure to Global settings
Bug 7273591

Change-Id: I5790f9d18ddf22282144be1c2d96dd4d706caa14
2013-01-11 15:40:36 -08:00
Jeff Sharkey
ab82e35a59 Merge "Examine widget hierarchy to find clocks." 2013-01-11 10:56:40 -08:00
Jeff Sharkey
06c5f8a768 Examine widget hierarchy to find clocks.
When switching to a widget, examine its hierarchy to determine if it
contains TextClocks that show hour and minute for the local timezone.
If so, hide the status bar clock.  Doesn't fix closing walls.

Bug: 7667638
Change-Id: I1e2c40345c9e5eb0193efd70838c7ca9f779190b
2013-01-11 10:49:19 -08:00
Dianne Hackborn
9e6575bc52 am 854458f4: am 0287ca3c: am e62fa825: Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
* commit '854458f4d52937f9a1385559d759bd8019eb3294':
  Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
2013-01-09 19:01:26 -08:00
Dianne Hackborn
e62fa82579 Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
The volume panel now forces us out of the UI modes while it
is up.

Change-Id: If39fa33b1c52579bf5d376ce4722408cee3ca951
2013-01-09 18:51:51 -08:00
Dianne Hackborn
891d3fbb15 Fix issue #7966357: Super lights out mode vs. volume dialog
The volume panel now forces us out of the UI modes while it
is up.

Change-Id: I25f29af5b6518aba695b64a75977ae240b742118
2013-01-09 18:31:37 -08:00
Jim Miller
995c25bbcb Merge "split active user animation across switch." 2013-01-08 14:45:11 -08:00
Chris Wren
f41c61bc15 split active user animation across switch.
Bug: 7626087
Change-Id: If743a4be498c624d2c4ec91989648e8be754ee4b
2013-01-08 16:35:13 -05:00
Craig Mautner
4b71aa1f8a Move app transition constants
Move app transition constants from WindowManagerPolicy to
AppTransition.

Change-Id: I8ae6c4d0da1db826c44eb4ea0c6b85016b50b1a3
2013-01-07 23:38:57 -08:00
Jim Miller
8ca2fc10ce Remove unused keyguard code
This change removes the old keyguard code because it's obsolete and doesn't run
anymore.

Change-Id: I8ed93f507378a17cf834d2ee9284c098eb8efffe
2013-01-02 17:07:56 -08:00
Craig Mautner
a2303750fb Merge changes I1dfe21e5,Ia0218bf8
* changes:
  Clean up warnings.
  Minor refactorings.
2012-12-19 16:40:18 -08:00
Craig Mautner
0bf6ec9e37 Clean up warnings.
Change-Id: I1dfe21e5f64364c90565b594e28074cabe7daa64
2012-12-18 10:03:21 -08:00
Amith Yamasani
5d8961e756 am 507ea24b: am ffdc7aed: Merge "avoid crashing system serer process"
* commit '507ea24b8f881f8af42393a0512c88cf7397edb9':
  avoid crashing system serer process
2012-12-15 15:10:30 -08:00
Amith Yamasani
507ea24b8f am ffdc7aed: Merge "avoid crashing system serer process"
* commit 'ffdc7aed5ec8f38706ddfad02d3df05493351083':
  avoid crashing system serer process
2012-12-15 14:57:40 -08:00
Svetoslav Ganov
545252f4fd Refactoring of the screen magnification feature.
1. This patch takes care of the case where a magnified window is covering an unmagnigied
   one. One example is a dialog that covers the IME window.

bug:7634430

2. Ensuring that the UI automator tool can connect and correctly dump the screen.

bug:7694696

3. Removed the partial implementation for multi display magnification. It adds
   unnecessary complexity since it cannot be implemented without support for
   input from multiple screens. We will revisit when necessary.

4. Moved the magnified border window as a surface in the window manager.

5. Moved the mediator APIs on the window manager and the policy methods on the
   WindowManagerPolicy.

6. Implemented batch event processing for the accessibility input filter.

Change-Id: I4ebf68b94fb07201e124794f69611ece388ec116
2012-12-14 16:27:27 -08:00
Amith Yamasani
ffdc7aed5e Merge "avoid crashing system serer process" 2012-12-14 09:04:30 -08:00
Craig Mautner
ae44659f30 Call adjustWallpaperWindowsLocked once per pass.
Also refactor a few methods and improve logging.

Change-Id: Ic54a1ff99f6de732b31cda5c06d36e8de01a269c
2012-12-12 10:09:19 -08:00
Jim Miller
0386410ead am 5b09fcc7: am 946f6ab4: am 9819a617: Merge "Fix password field focus in keyguard" into jb-mr1.1-dev
* commit '5b09fcc71664383ba73eb2074e52141d5e6abf9e':
  Fix password field focus in keyguard
2012-12-06 23:22:27 -08:00
Winson Chung
f90b03771d am f882bc33: am a1bc0979: am 0db59a85: Revert "Saving and restoring current page when rotating in lockscreen. (Bug 7568412)"
* commit 'f882bc336794909b4c145462cfedc8e28a8494ec':
  Revert "Saving and restoring current page when rotating in lockscreen. (Bug 7568412)"
2012-12-06 23:22:23 -08:00
Jim Miller
5b09fcc716 am 946f6ab4: am 9819a617: Merge "Fix password field focus in keyguard" into jb-mr1.1-dev
* commit '946f6ab44048138c03f9bcf93451322b4397f8f9':
  Fix password field focus in keyguard
2012-12-06 18:59:24 -08:00
Winson Chung
f882bc3367 am a1bc0979: am 0db59a85: Revert "Saving and restoring current page when rotating in lockscreen. (Bug 7568412)"
* commit 'a1bc0979a8cd7389ef4f7f4800fc58cd987ffee2':
  Revert "Saving and restoring current page when rotating in lockscreen. (Bug 7568412)"
2012-12-06 18:59:19 -08:00
Jeff Sharkey
4bef5ac8c7 Merge "Wire KEYCODE_SYSRQ up to take screenshot." 2012-12-06 09:35:40 -08:00
Jeff Sharkey
2991fa35a5 Wire KEYCODE_SYSRQ up to take screenshot.
Change-Id: If7eee811d43ac88c7d206c61f264c3e5f63aa5b3
2012-12-05 18:07:05 -08:00
Jim Miller
9819a61745 Merge "Fix password field focus in keyguard" into jb-mr1.1-dev 2012-12-05 16:37:52 -08:00
Winson Chung
0db59a856f Revert "Saving and restoring current page when rotating in lockscreen. (Bug 7568412)"
This reverts commit 6cbc2e81742039969e081a9eed02060fb8789e25.
2012-12-05 16:04:23 -08:00
Jim Miller
42df15e93d Fix password field focus in keyguard
This fixes a bug introduced in Change-Id: I34b7db402401a824f463d35d7546c05dc2979243 where
the top-most view was allowed to capture focus in order to ensure the device handled volume
key events.

This resolves the issue by restoring previous behavior and ensures we still handle media keys,
regardless of focus.

Fixes bug 7676996

Change-Id: Id2d1200be81640e4b4b7b5e3a0af099d6fc2d259
2012-12-05 15:15:00 -08:00
Amith Yamasani
c1493e1a01 am 368ee53f: am f663cad2: am 6c58b155: Merge "Make 3rd party lockscreen widgets work on secondary users" into jb-mr1.1-dev
* commit '368ee53f25cdff7ea89293d2cc81e95816919369':
  Make 3rd party lockscreen widgets work on secondary users
2012-12-05 13:00:41 -08:00