This allows us to support binary proximity sensors that only return 0.0 and 1.0
Change-Id: Ifaf3a4e6fc720cb246ac3558e3e733b4b612c95b
Signed-off-by: Mike Lockwood <lockwood@android.com>
* changes:
Make IBackupTransport.finishBackup() also return an int code, since it too can return TRANSPORT_NOT_INITIALIZED (in fact that's typically how it comes).
Add API to skip the animation for a particular start activity, so that
a latter better one can be used.
Fix Theme.NoDisplay to actually work.
Fiddle with various animations: don't do a different animation for task
switching, try a scale animation for switching in/out of the wallpaper.
Adjust the animation duration so that at normal speed we have something
more like the slower animation option (so slow is now the default).
Change-Id: Ieba9f3db0bd9a762a19b327a3ecccbc7b547893d
return TRANSPORT_NOT_INITIALIZED (in fact that's typically how it comes).
For consistency, make other IBackupTransport methods return int instead of
boolean, and handle accordingly.
Make initializeDevice() its own method instead of a flag on performBackup().
This will be needed when un-checking the settings box anyway, and is
conceptually unrelated to whatever happens to be the first post-initialization
backup we perform. (Note that even if the init is sent separately from the
backup operation, the server will remember that an init has been done and
will *not* return NOT_INITIALIZED for the subsequent backup.)
Fix LocalTransport accordingly (trivial changes).
Handle failures more robustly in BackupManagerService -- most notably,
doQueuedBackups() was ignoring the result code of processOneBackup(), so
a NOT_INITIALIZED error would go past unseen (at least until the next
backup pass). Keep track of error code returns more universally now.
(This includes finishBackup(), of course.)
When attempting a backup, the transport may inform us that the backend is in an
uninitialized state. This typically means that the device's data has been wiped
after a period [e.g. 90 days] of inactivity. This means that we need to
re-store all data subject to backup, and all of our incremental state tracking
on the device is now stale.
In response, we wipe all of our recorded backup state and restart the backup
pass on all participants.
More CPU speed stepping happening with newer devices, so we need
to qualify CPU time with the CPU speed, since power consumption
varies greatly by speed. Apps that peg the CPU should get a higher
penaltly.
Also, fix for 2062930: NPE at VolumePreference.onKey()
This changes a couple of bits of the Backup Manager's logic around
first-backup-ever handling. First, it uses the same "what we've ever backed up"
handling as the rest of the system for purposes of instructing the backend to do
a wipe when the metadata is initialized for the device, instead of looking at
the presence of the @pm@ file. Secondly, for the time being we won't be using
the saved state produced by agents' doRestore() logic. Until the server is
migrating each restored package's data over to the new dataset, this was
resulting in the client holding an agent state blob for which no data existed on
the server under this device's identity but which the device thought was fully
up to date.
IBackupTransport.performBackup() now takes a flag "wipeAllFirst", which if set
will result in the entire restore set for the current device/account being wiped
clean prior to the storage of the provided package. This ensures that a device
on which backup has just been enabled will not confront potentially-stale
information, nor will the restore set potentially contain mismatched data from
orphaned packages.
The Backup Manager has also been revised to pass this flag when first backing up
its master metadata block (and never pass it thereafter unless something has
caused the backup state tracking to be erased, e.g. the user has opted out of
backup and then later re-enabled it).
This fixes a problem that resulted in the screen staying off indefinitely if the prox sensor
is active at the beginning of a bluetooth call and could result in the screen staying off
in other similar circumstances.
Change-Id: Icfa0046d3179f9bb2247e7a3c1f9ff073312667a
Signed-off-by: Mike Lockwood <lockwood@android.com>
The process for starting wifi was using a wakelock around a message-pass and this was causing
an exception for meer mortals (who don't have WAKE_LOCK permission).
bug: 1750535
This also takes care of the problem of system dialogs like the
crash dialog causing the status bar to dim behind the lock screen.
On the down side, the fade transition from the lock screen is
now gone, and I'm not sure how likely it is for it to return.
Change-Id: I7f9e6d0f3510a1fdbbe6ad252d986bd85a16475d
Avert your eyes!
The key change here is that RemoteViews can now call a Context API to
start its pending intent, which inside of the activity manager we can
use to determine to cancel the timeout delay for external entities
to disrupt the home screen.
Change-Id: If097cf7478cbed7a3c04a304050bd7fd5703d197
This was a problem with not hiding the starting window when it got
transfered to an activity whose window (instead of token) animates
when displayed.
Change-Id: I9eb58faa6e27d53144687952a715fc083a5c5842
Categories CATEGORY_CAR_DOCK and CATEGORY_DESK_DOCK can be assigned to
activities to make them launchable on docked events.
This is a better mechanism than listening for ACTION_DOCK_EVENT with a broadcast receiver.
Change-Id: Ic5f3ab3555ce02ca922bc31ebba41978cefe8bda
Signed-off-by: Mike Lockwood <lockwood@android.com>
* changes:
Remove deadlock in PackageManager when installing or upgrading packages. PM first creates a temporary file from the input package uri before installing it. if the package uri points to a content uri, the content provider has to be retrieved via the ActivityManager which could cause deadlocks with the package manager locks being held. Clean up by always copying or creating temporary files before acquiring these locks. Fix issue when restoring a failed upgrade for third party apps.
This implements support for devices whose hardware can hide
their navigation keys. It works much like the existing keyboardHidden
configuration, and for compatibility uses the same configuration
change bit.
Also add FLAG_TURN_ON_SCREEN for windows, which has the system
cause the screen to be turned on when the window is displayed.
Great fun when used with FLAG_SHOW_WHEN_LOCKED!
Change-Id: I0b867f19af85cfd8786a14cea194b34f7bdd9b7a
This introduces a new activity that you can derive from to implement
a wall paper configuration activity. This is supposed to select
a theme based on whether it is being run to configure a real wallpaper
or a preview, but this is going to be more difficult to do than I
thought. :(
Also fix a problem in the white theme where the list view's background
was being set to white, so it wouldn't work on a transparent bg.
Change-Id: I26d5a8695a3c878a1664eb09900eded57eaff990
PM first creates a temporary file from the input package uri before installing it.
if the package uri points to a content uri, the content provider has to be retrieved via the ActivityManager
which could cause deadlocks with the package manager locks being held.
Clean up by always copying or creating temporary files before acquiring these locks.
Fix issue when restoring a failed upgrade for third party apps.
to prevent apps from changing the hardware behind its back.
Fixes b/2041941 Lock screen flashes the screen very bright before dimming
Change-Id: Ice757f7ae87902bdfb3634471cf44f020ebfaae4
Signed-off-by: Mike Lockwood <lockwood@android.com>
This eliminates the assumption that the proximity sensor will always return
zero distance when it is active.
Change-Id: I6245b074e4c42aeae3a181e6a5087554517046d2
Signed-off-by: Mike Lockwood <lockwood@android.com>
Add changes to have the ability to turn on and off the
automatic light sensing for the device. This is fully configurable
and is by default not present. Vendors should override the ALS setting
to enable the automatic lighting controls.
These changes will add a check box to the Brightness settings menu to give control
to the user to allow the device's display lighting to be controlled via the slide bar
or the auto lighting system.
If the user selects auto then the slide bar will become invisible. Manual mode
will present the slide bar to the user.
Change-Id: I146a6d75b99b08c9b839218ce6b85adf21f9fd73
Signed-off-by: Dan Murphy <D.Murphy@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
This takes care of allowing us to cancel the back button. The
back button is a bear because it is strewn all over the place --
everywhere you can close something, there is some code looking
for the back button that now needs to deal with being canceled.
The main things changed are activity (of course), dialog,
input method, search dialog. There are some other misc places
in the framework (and some I missed here that I will get in a
second pass).
To facility all of this, the key dispatching APIs now provide
a lot more support for dealing with looking for cancelled keys,
and incidentally also provide an actual API for catching long
key presses. This also helped clean up the code in PhoneWindow
where it deals with all of the combinations of key pressed and
releases. (And also allows people to override
Activity.onKeyLongPress() to provide a different long press
action for a standard key like search.)
And while I was doing this, I reworked how we detect long
presses by having this be part of the key event delivered by
the window manager. This should greatly reduce (hopefully
outright eliminate) the problems with long presses being
mis-detected when an application is being slow.
Change-Id: Ia19066b8d588d573df3eee6d96e1c90fdc19f57d
First, fix some issues with the final wallpaper bitmap
we use: ensure it is always 16bpp, and make sure dithering
of its bitmap is turned off. We take of dithering
when loading, to make sure we don't use it when drawing.
Also add new APIs to return the wallpaper with the equivalent
of Launcher's old FastBitmapDrawable. As doing this, also load
the default wallpaper the same way as custom ones, taking care to
resize it as needed at load time.
Finally implement a mechanism for the window manager to wait
for the wallpaper to redraw at its new position before returning
from the application's call to change the offset. This ensures
that the wallpaper better tracks the application. Note that there
is a timeout in this wait that is relatively short, and if it
expires we will run for a while without waiting.
Change-Id: Ife449437746da85958bd447e0a6cf3d2223b398c