2131 Commits

Author SHA1 Message Date
Dianne Hackborn
2269d1572e Re-arrange android-common so framework no longer links with it.
This is the framework part, moving classes around so the framework
no longer needs to link to android-common.  Makes some APIs public,
others that didn't need to be public are private in the framework,
some small things are copied.
2010-02-25 11:39:33 -08:00
Mike Lockwood
ca44df86ac Fix synchronization problem in PowerManagerService.dump()
Fixes a race condition that resulted in an IndexOutOfBoundsException
due to a wakelock being released while dump() was iterating through the
wakelock list.

BUG: 2469910

Change-Id: I10d7a65b9f397934942b290cb047c4ca81214297
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-25 14:08:55 -05:00
Tobias Haamel
a712dcec1c Init car mode when phone is booted in a dock.
When the device is booted in a car dock the car mode needs to be set
as well, so that the status bar notification shows up and the system
is initialized the same way as if the phone is placed into a car dock
when it's booted already.
2010-02-25 11:14:21 +01:00
Suchi Amalapurapu
c42e29e0a5 Add new handler mechanism in MountService to make unmount api asynchronous.
MountService updates state on PackageManager and then tries to
kill processes holding file references to media about to be unmounted by
invoking api on ACtivityManager. This is retried upto 4 times to make sure all
processes holding file references are killed before unmounting the media
at specified path.

Also changed PackageManger api to return boolean value to indicate if
MountService is likely to receive broadcasts related to apps on sd.
2010-02-24 20:30:03 -08:00
Robert Greenwalt
406b09bbd1 Merge "Add mobile data on/off switch." 2010-02-24 19:45:32 -08:00
San Mehat
982bb24f5d Merge "MountService: Send UMS_CONNECTED broadcast on boot if UMS connected." 2010-02-24 19:04:48 -08:00
San Mehat
6a965af2d7 MountService: Send UMS_CONNECTED broadcast on boot if UMS connected.
UMS detection is now done wayyyy before the system is booted, so set a flag
to send our intent broadcast once we've booted.

Signed-off-by: San Mehat <san@google.com>
2010-02-24 18:14:18 -08:00
Robert Greenwalt
c03fa50149 Add mobile data on/off switch.
bug:2251458
2010-02-24 18:14:07 -08:00
Robert Greenwalt
d70a3d4e2d Tethering improvements.
Changes due to comments.
Fixing Tether teardown.

bug:2422545
2010-02-24 18:03:40 -08:00
Christopher Tate
3dda518a4f Add 'restoreAnyVersion' attr for apps that want to restore "future" data
If a backup-participating app sets android:restoreAnyVersion="true" in its
manifest <application> tag, then its agent will be invoked for restore
even if the available dataset was created by a later version of the app
than is currently installed on the device.  This will not typically be
a problem for third party applications, since for them the installation
and initial data restore are tightly coupled, but it can cause serious
problems for applications which are both preinstalled on the system
partition and overridden by later updates.  The primary difficulty
that this new attribute addresses is this:

1. User buys a Nexus One, Market self-updates, and the user installs some apps.
At this point the backup data on the server may indicate that the version of
Market which originated its bookkeeping is newer than the stock N1 Market app.
2. User loses their phone, and buys a replacement N1.  At setup time, Market
has not yet had a chance to self-update, so when the restore comes in, it's
tagged as being from "the future" and so the restore is refused.  No apps get
reinstalled.

Bug: 2442127
Change-Id: I076a9553dc613e5c3189350e778315718ed1ed2b
2010-02-24 17:23:54 -08:00
Dianne Hackborn
c3b91fd26a Fix crash in PendingIntentRecord debug output.
Add null checks to a few places to avoid crashes when dumping
debug data.

Also add some sanity checks for accessing content providers in
the activity manager.
2010-02-24 13:12:52 -08:00
Suchi Amalapurapu
cf6eaeaae9 Some framework fixes for apps on sd
change hard coded path in installd
fix tests
Work around for renaming containers.
Do forced unmount when destroying containers.
Force a gc in default container service to release handle to parsed package
and thus avoid getting killed by vold
Some cosmetic changes to PackageManager api.
Unit tests for renaming container for MountService
Remove internal size limit on app to be installed.
2010-02-24 11:31:36 -08:00
San Mehat
85451ee15f MountService: Fix bug which would allow apps to try to rename a container whos dst is mounted
Signed-off-by: San Mehat <san@google.com>
2010-02-24 08:54:18 -08:00
Joe Onorato
0e93b562f4 Merge "Make the notification windowshade work properly with overscroll." 2010-02-23 19:20:22 -08:00
Joe Onorato
f0fda925e6 Make the notification windowshade work properly with overscroll.
Bug: 2432590
2010-02-23 19:18:54 -08:00
Robert Greenwalt
6142a0b68f Fix build.
clicked "submit" on I65ae29bd when I shouldn't have.

Fixing according to comments and a build error change.
2010-02-23 18:15:29 -08:00
Robert Greenwalt
5cde63a60d Merge "Add USB RNDIS enable/disable control" 2010-02-23 18:08:04 -08:00
Robert Greenwalt
65ae29bd85 Add USB RNDIS enable/disable control
Also adding interface configuration to the tethering machine.
Also fixing netd bug that didn't send up/down portion of iface config command.
2010-02-23 16:04:41 -08:00
Bernd Holzhey
6fd5e0ac51 Fix calculation of the next twilight update for locations where the day or night never ends. 2010-02-23 06:04:33 +01:00
Dianne Hackborn
f13f60127e Merge "Fix some random bugs." 2010-02-22 20:48:01 -08:00
Dianne Hackborn
9e0f5d9a63 Fix some random bugs.
2185256: After open &close of device keyboard shortcut does not added to Home desktop.

ActivityThread was losing the last saved state when restarting or launching into
a paused state.

2366174: defaults not cleared when they should be

PackageManagerService now removes any preferred activity records for a package
when it is uninstalled.

2154556: Battery stats can have an unbounded number of wake locks

We now start combining wake locks into one shared record when we hit a
maximum limit (currently 20).

2442519: Foreground services can have no notification by providing a bogus one.

If the notification manager rejects our notification, the service is forced to
no longer be in the foreground.

2442383: Finalization issues in com.android.server.am.PendingIntentRecord.java

Cleaned up finalization to call super class and avoid the big activity manager
lock (we still need to use the locks inside of the message system, but these
are much less likely to be a problem).

2284190: Cannot call a phone number using adb

We weren't getting the calling uid/pid in startActivity() if the caller did not
supply an application record.
2010-02-22 20:45:58 -08:00
Mike Lockwood
46db504de5 Don't start location providers until the system is ready.
Change-Id: Id545e95705e59ffbaaab8a679a1b7df488813101
BUG: 2461320

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-22 20:42:27 -05:00
Daniel Sandler
6fb7cbf12a Merge "Show the USB mass storage UI as soon as USB is connected." 2010-02-22 16:46:08 -08:00
Daniel Sandler
c07907e038 Show the USB mass storage UI as soon as USB is connected.
This is a huge usability win for average users who are
trying to transfer files: it coaches them through the
process while at the same time saving a number of steps.

If the user is just charging via USB, they're most likely
not actively using the device, in which case they won't
notice the difference.

Users with ADB turned on will see the old behavior (just the
ongoing notification, which pops the UsbStorageActivity if
tapped).

Bug: 2299129

Change-Id: Ib63a0a973dfdeb28741268fcf0e0fbc1b7be2922
2010-02-22 16:39:47 -05:00
San Mehat
b09cc2cde2 Merge "MountService: Force unmount when enabling ums" 2010-02-22 13:21:58 -08:00
San Mehat
3d4881067a MountService: Force unmount when enabling ums
Signed-off-by: San Mehat <san@google.com>
2010-02-22 13:08:44 -08:00
Dianne Hackborn
7e31e0c351 Merge "Fix issue #2438980: Implement package watcher for voice recognizer service setting" 2010-02-22 12:18:01 -08:00
Daniel Sandler
ec2c88d835 Move new sound effects to the system stream.
Change-Id: I11cfa6495abeb0193b1a3929ec54f0386cfe9ed2
2010-02-22 15:10:38 -05:00
Dianne Hackborn
21f1bd17b2 Fix issue #2438980: Implement package watcher for voice recognizer service setting
I am getting tired of writing package monitor code, realized this is missing in
a number of places, and at this point it has gotten complicated enough that I
don't think anyone actually does it 100% right so:

Introducing PackageMonitor.

Yes there are no Java docs.  I am still playing around with just what this
thing is to figure out what makes sense and how people will use it.  It is
being used to fix this bug for monitoring voice recognizers (integrating the
code from the settings provider for setting an initial value), to replace
the existing code for monitoring input methods (and fix the bug where we
wouldn't remove an input method from the enabled list when it got
uninstalled), to now monitor live wallpaper package changes (now allowing
us to avoid reverting back to the default live wallpaper when the current
one is updated!), and to monitor device admin changes.

Also includes a fix so you can't uninstall an .apk that is currently enabled
as a device admin.

Also includes a fix where the default time zone was not initialized early
enough which should fix issue #2455507 (Observed Google services frame work crash).

In addition, this finally introduces a mechanism to determine if the
"force stop" button should be enabled, with convenience in PackageMonitor
for system services to handle it.  All services have been updated to support
this.  There is also new infrastructure for reporting battery usage as an
applicatin error report.
2010-02-22 11:27:52 -08:00
Joe Onorato
679dd12fa1 Ignore touch down events near the edge of the screen for the purposes of pulling down the
windowshade.

This makes it happen less often when you pick up the device or push open the keyboard.
2010-02-22 10:52:11 -08:00
Christopher Tate
59eac4b535 Fix crash: check for install failure cleanly
Don't go looking at attributes of a package struct without first verifying
that the struct pointer is non-null:  in the failed-install case, of course
there will be no package info.

Change-Id: I3b2cafca2f1e3891a6592825ce5bcc977e7f3483
2010-02-19 19:25:45 -08:00
Christopher Tate
1bb6906c7a Automatically restore app data at install time
When an application being installed defines a backupAgent in its manifest, we
now automatically perform a restore of the latest-known-good data for that app.
This is defined as "data backed up by this app from this handset, if available;
otherwise data for this app as it existed when the device was initially
provisioned."  If neither option exists for the app, no restore action is
taken.

The CL involves major changes in the Backup and Package Managers...

* The Package Manager's act of installing an application has now been split
into two separate phases, with a data-restore phase optionally occurring
between these two PM actions.  First, the details of the install are performed
as usual.  Instead of immediately notifying install observers and issuing the
install-related broadcasts, the in-process install state is snapshotted and
the backup manager notified that a restore operation should be attempted.  It
does this by calling a new API on IBackupManager, passing a token by which it
identifies its in-progress install state.

The backup manager then downloads [if possible] the data for the newly-installed
application and invokes the app's backupAgent to do the restore.  After this
step, regardless of failure, it then calls back into the Package Manager to
indicate that the restore phase has been completed, supplying the token that
was passed in the original notification from the Package Manager.

The Package Manager then runs the final post-install actions: notifying install
observers and sending out all the appropriate broadcasts.  It's only at this
point that the app becomes visible to the Launcher and the rest of the OS.

... and a few other bits and pieces...

* The ApplicationInfo.backupAgentName field has been exposed to the SDK.  This
can be reverted if there's a reason to do so, but it wasn't clear that this
info needs to be hidden from 3rd party apps.

* Debug logging of restore set IDs and operation timeout tokens [used during
any asynchronous Backup Manager operation] are now consistently in hex for
readability.

* We now properly reset our binder identity before calling into the transport
during restore-set operations.  This fixes a permissions failure when a
single-app restore was attempted.

* The 'BackupTest' test app is no longer lumped onto the system partition
by default.

Change-Id: If3addefb846791f327e2a221de97c8d5d20ee7b3
2010-02-19 17:24:07 -08:00
Suchi Amalapurapu
6c81defa3d Merge "Move package from internal to external and vice versa." 2010-02-19 14:27:29 -08:00
Suchi Amalapurapu
8946dd3355 Move package from internal to external and vice versa. 2010-02-19 14:20:54 -08:00
San Mehat
fafb041b47 MountService: Move boot-time mount to a thread - avoids ANR at boot
Signed-off-by: San Mehat <san@google.com>
2010-02-19 06:51:58 -08:00
Robert Greenwalt
939d5fafc9 Merge "Add USB RNDIS enable/disable control" 2010-02-18 17:34:16 -08:00
Dianne Hackborn
b167643c87 Merge "Fixing bug 2453467 - In case of a dead process while disabling Accessibility some processes keep sending AccessibilityEvents" 2010-02-18 15:49:25 -08:00
Dianne Hackborn
e36d6e277e Work on issue #2263557: PMF3000 showing hybrid of portrait and landscape modes
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.
2010-02-18 15:47:34 -08:00
Svetoslav Ganov
fb606da00c Fixing bug 2453467 - In case of a dead process while disabling Accessibility some processes keep sending AccessibilityEvents 2010-02-18 15:30:52 -08:00
Joe Onorato
424c61fd0a Fix 2363699 - Make notification shade animate closed when disabled
The animation was removed to fix 2298803 because if the windowshade
was tracking when this happened, it would get stuck.
2010-02-18 14:17:23 -08:00
Marco Nelissen
c34ebce475 Make MountService work in the simulator. 2010-02-18 13:59:05 -08:00
Robert Greenwalt
ce1200d42c Add USB RNDIS enable/disable control 2010-02-18 12:10:55 -08:00
San Mehat
d970998b0d framework: storage: Add 'force' option to unmount/destroy storage apis, and update callsites.
Also adds additional storage unit tests

Signed-off-by: San Mehat <san@google.com>
2010-02-18 11:48:48 -08:00
Tobias Haamel
154f7a1cc2 Show car mode notification in status bar.
The notification is an ongoing event and can be used to get out of car mode.
2010-02-18 11:43:03 -08:00
Marco Nelissen
6d43ebb807 Merge "Make the simulator boot again." 2010-02-18 11:11:29 -08:00
Joe Onorato
6a6588b4ac am 6371a2d3: am ee3bbefd: Merge "Don\'t crash the system process when apps give us a bad foreground service notification." into eclair
Merge commit '6371a2d31f30b473e91be9cced64a2527c086af1'

* commit '6371a2d31f30b473e91be9cced64a2527c086af1':
  Don't crash the system process when apps give us a bad foreground service notification.
2010-02-18 11:02:48 -08:00
Marco Nelissen
62dbb22bd4 Make the simulator boot again. 2010-02-18 10:56:30 -08:00
Dianne Hackborn
65e7277391 Merge "Fixing bug 2451615 - Accessibility services are started upon system reboot while accessibility is disabled" 2010-02-18 10:49:00 -08:00
Robert Greenwalt
589f37cd27 Merge "Add Java hookup to netd interface notifications." 2010-02-18 10:11:27 -08:00
Eric Rowe
3d4178fe1a Merge "Fix formatting of ANRs." 2010-02-18 09:58:07 -08:00