This is a bunch of reworking of how configuration changes are handled:
- When orientation is changing (for whatever reason), the window manager no
longer tries to pre-emptively compute a new configuration. Instead, it
just determines change is happening and tells the window manager.
- The activity manager is now responsible for giving the window manager the
final configuration it is using. This is both so it knows whem the
activity manager is done with its configuration updates, and so the window
manager can use the "real" configuration.
- When an orientation or other configuration change is happening, freeze the
screen and keep it frozen until the activity manager has given us the
final configuration.
- The window manager can now send new configurations to its clients during
its layout pass, as part of a resize, if it has determined that it has
changed. This allows for a new View.onConfigurationChanged() API for any
view to easily find out when the configuration has changed.
- ViewRoot now also works with the activity thread to make sure the process's
current resources are updated to the new configuration when it receives one
from a window. This ensures that at the time onConfigurationChanged() and
other view callbacks are happening, the correct configuration is in force.
- There is now a sequence number associated with Configuration, which
ActivityThread uses to avoid using stale configurations. This is needed now
that it can receive configurations asynchronously from both the window
manager and activity manager.
- The hack for keeping the locale has been removed, and underlying problem
fixed by having Configuration initialize its locale to "unknown" instead of
a valid default value.
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.
The ui mode can be set, like it is done for the locale, as follows:
IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);
To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.
The automatic night mode switching will be added in a separate change.
This implements the spec for external storage organization, and
properly reflects how the media scanner organizes the files it finds.
Also includes package manager support for removing app private
files from external storage when the application is uninstalled.
For the new APIs and paths, the main place to look is Environment
and Context.
Merge commit '31ef2e77c50485ad6ed410a5d341754d6787b8e1'
* commit '31ef2e77c50485ad6ed410a5d341754d6787b8e1':
ADT/Layout: support for 3+ color in linear gradients
This prevented ImageView from making proper use of ScaleType.
Also fixed Canvas.getSaveCount() that returned the wrong
value and Matrix.getTransform() which used the wrong order
for the AffineTransform constructor!!
Bug: 2364564
Change-Id: I78babf4aa6689440e52ad06b1473f75b20eb66da
The original bitmap factory is mostly done in native and deals
with the normal android Bitmap class which has been replaced
in the layoutlib by a bitmap that is merely a wrapper around
an AWT BufferedImage.
This new BitmapFactory creates the layoutlib version of
Bitmap all in Java.
Change-Id: Ice8b5d19141a9a43f83349c159201bf85604b3b0
- Move test files to their own package for easy binary inclusion
in adt-test
- fix some tests and remove obsolete ones.
Change-Id: I5b967f29074fdad74073f9b37d903eabe8dc29e6
There were a few missing methods that should have been reimplmented
(because they were native).
Others have been added just to be sure so that we can test whether methods
are missing or not (test coming soon).
Change-Id: I24895c353e38545e9b1abe28d41224fdc78cadb1
Lot of infrastructure for more things to go away when "clear system dialogs"
happens, and now do this when we turn on the lock screen.
Change-Id: I567130296fe47ce82df065ed58ef21b37416ceaf