2043 Commits

Author SHA1 Message Date
Chris Tate
cb14ec1305 Merge "Don't hold the backup queue lock across a backup operation" 2010-02-05 12:38:51 -08:00
Mike Lockwood
1688d312e5 Merge "Keep automatic screen brightness monotonically increasing until screen is turned off." 2010-02-05 12:38:02 -08:00
Dan Egnor
97e4494728 Add an AlarmManager API to set the system time (with the proper permissions). 2010-02-05 12:31:41 -08:00
Mike Lockwood
b286541674 Keep automatic screen brightness monotonically increasing until screen is turned off.
This is an experimental change to avoid the light sensor screen fluctuation problem.
We only do this when undocked to since the lighting should be stable in the docked case
and since the dock keeps the screen on we need to be able to adjust the lighting.

Change-Id: I70afcc393f51f2679be8228d6cb993ddc07e5986
BUG: 2387223
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-05 14:33:14 -05:00
Christopher Tate
c61da3136b Don't hold the backup queue lock across a backup operation
This got lost in the shuffle when the backup process was retooled to run
synchronously within a single spun-off HandlerThread.  Formerly it was okay
to hold the lock around the point in time when the backup service thread was
being spun off, but once that became synchronous it wound up locking out
apps' calls to dataChanged(), which in turn led to ANRs.

Bug: 2421333
Change-Id: Icf378e5733af5f28a689c564494486cd3555eca7
2010-02-05 10:41:27 -08:00
Chris Tate
5c1779b8ac Merge "Add single-package restore from an app's most-recent data" 2010-02-04 16:27:42 -08:00
Christopher Tate
8472581aa3 Add single-package restore from an app's most-recent data
Renamed the RestoreSession performRestore() method to restoreAll(), and
added a new restorePackage() method that only restores the single
specified app.  In order to restore an app other than itself, the
caller must hold the android.permission.BACKUP permission.

This change also introduces dataset tracking:  the Backup Manager
persistently remembers both the current backup dataset's identity
and that of the "ancestral" dataset, i.e. the one most recently used
for a whole-device restore such as performed by SetupWizard.  When a
single package is restored via restorePackage(), the selection of
most-recent dataset to use is this:

1. The data from the currently-active backup dataset, if such exists.
   An app that has ever backed up data will therefore get its last-
   known-good data.

2. The app's data from the ancestral dataset, if such exists.  This
   covers the case of a factory reset followed by reinstallation of
   an app at a later time.  The app had not yet backed anything up
   post-wipe, but the old data is in the ancestral dataset and should
   be brought forward when the app reappears.

3. If neither 1. nor 2. exist, there is no data to restore, so just
   skip it and return failure.

Note that the infrastructure to automatically attempt a restore after
an application has been installed does not yet exist; that's coming.

Change-Id: I0ba170df9885128000c46ed28d3dddda3a63a143
2010-02-04 16:01:09 -08:00
Daniel Sandler
64226a49b7 Merge "Add support in StatusBarManager for disabling ticker text." 2010-02-04 15:58:18 -08:00
Daniel Sandler
91e1d0cdda Add support in StatusBarManager for disabling ticker text.
The new flag, DISABLE_NOTIFICATION_TICKER, will be used by
the car dock app (in conjunction with DISABLE_EXPAND) to
minimize distractions to the driver.

It may also be used by the secure lockscreen to avoid
leaking personal information when the screen is on but the
device is locked (e.g. when the desk dock app is running).

Change-Id: Ibc8efde7da7501767163ae0a75f7c369b824e2a2
2010-02-04 15:55:00 -08:00
Ken Shirriff
5c19aeca3d API review: TrafficStats: rename Pkts to Packets
Rename getMobileTxPackets(), getMobileRxPackets(), getTotalTxPackets(),
getMobileRxPackets()

bug 2420318
2010-02-04 14:37:21 -08:00
Kenny Root
8f3ff09556 Merge "resolved conflicts for merge of dd24f599 to master" 2010-02-04 14:26:40 -08:00
Kenny Root
2cce6267a0 resolved conflicts for merge of dd24f599 to master
Change-Id: I57c349c493d69585d4c85e8c0970649708c6bd33
2010-02-04 14:23:39 -08:00
Dianne Hackborn
2a9094d079 Framework part of issue #2391576: Add method to start the Jit and call it 2010-02-04 11:54:34 -08:00
Eric Laurent
dd24f59906 am aead64de: Fix issue: 2413494: [Passion-c] Add TTY support.
Merge commit 'aead64def1fe58c95c086a0ca00cf0b13fa32ef1' into eclair-plus-aosp

* commit 'aead64def1fe58c95c086a0ca00cf0b13fa32ef1':
  Fix issue: 2413494: [Passion-c] Add TTY support.
2010-02-04 09:34:34 -08:00
Robert Greenwalt
d0e18ffb82 First pass at USB Tethering.
bug:2281900
2010-02-04 09:15:06 -08:00
Eric Laurent
aead64def1 Fix issue: 2413494: [Passion-c] Add TTY support.
Handle TTY mode change events received by HeadsetObserver and send information down to AudioHardware with AudioManager.setParameters()

Use setting "tty_mode_uses_heaset_events" in core config.xml to indicate if the product uses this particular
method of indicating the TTY mode change.
2010-02-03 23:35:34 -08:00
Joe Onorato
f1dd37ac28 Merge "Fix 1667521 - system process crash after bad notification" 2010-02-03 20:25:43 -08:00
Joe Onorato
68065e0a19 Fix 1667521 - system process crash after bad notification
The steps to reproduce this were kind of interesting.  You needed to have
a notification with a bogus RemoteViews in the first position in the list,
and then have another notification come in with an earlier timestampe.  In
that case, it would get a bad index for the new (not bogus) view that was
being added.
2010-02-03 20:21:41 -08:00
Dianne Hackborn
fa6bc84e01 Merge "Implement system data migration support." 2010-02-03 18:18:56 -08:00
Dianne Hackborn
b858dfda50 Implement system data migration support.
This adds three new features:

- <original-package android:name="com.foo" /> manifest tag.
  This allows an .apk to specify another package it originally came from,
  propagating all state and data from the old to new package.

- <adopt-permissions android:name="com.foo" /> manifest tag.
  In some more complicated cases, a new .apk may be a combination
  of multiple older .apks that each declared their own permissions.
  This allows you to propagate the permissions from these other
  .apks into the new one.

- A new system/etc/updatecmds directory.
  You can place files here which describe data files to move from
  one package to another.  (See below for details.)

Also in this change: we now clean up the data directories of
.apks that disappear from the system image, and some improvements
to logging and reporting error messages.

A typical file in the updatecmds directory looks like this:

-------
com.google.android.gsf:com.google.android.providers.talk
    databases/talk.db
com.google.android.gsf:com.google.android.googleapps
    databases/gls.db
-------

This says that for com.google.android.sfs, there are two packages to
move files from:

From com.google.android.providers.talk, the file databases/talk.db.
From com.google.android.googleapps, the file databases/gls.db

As part of moving the file, its owner will be changed from the old
package to whoever is the owner of the new package's data directory.

If those two files had existed, after booting you would now have the
files:

/data/data/com.google.android.gsf/databases/talk.db
/data/data/com.google.android.gsf/databases/gls.db

Note that all three of these facilities assume that the older .apk
is completely removed from the newer system.  The WILL NOT work
correctly if the older .apk still remains.
2010-02-03 15:42:02 -08:00
Chris Tate
348f7b9048 Merge "Add auto-restore setting and Backup Manager awareness thereof" 2010-02-03 15:35:28 -08:00
Christopher Tate
cce9da5dc3 Add auto-restore setting and Backup Manager awareness thereof
This setting, like BACKUP_ENABLE, should never be set directly in the secure
settings database.  Instead, it should be manipulated through the new IBackupManager
method setAutoRestore(boolean).

Change-Id: I5c3226ca85b6148bb756d753d7f9e4ea76e878c4
2010-02-03 15:33:52 -08:00
San Mehat
ec4caa0f54 NativeDaemonConnector: Improve NativeDaemonException reporting to include the actual error response
Signed-off-by: San Mehat <san@google.com>
2010-02-03 14:37:43 -08:00
Suchi Amalapurapu
33cea41732 Merge "Apps on sdcard: Add new broadcasts" 2010-02-03 10:21:23 -08:00
Suchi Amalapurapu
08675a3376 Apps on sdcard: Add new broadcasts
Add new broadcasts ACTION_MEDIA_RESOURCES_AVAILABLE and
ACTION_MEDIA_RESOURCES_UNAVAILABLE that get broadcast by
PackageManagerService when sdcard gets mounted/unmounted
by MountService so that packages on sdcard get recognized by
various system services as being installed/available or
removed/unavailable by the system.
The broadcasts are sent before the actual package cleanup which includes
mounting/unmounting the packages and we force a gc right after so
that any lingering file references to resources on sdcard get
released.
2010-02-02 18:33:29 -08:00
Neal Nguyen
3433d3c90e Modifying Services Tests XML file so it builds with the right permissions. 2010-02-02 17:09:00 -08:00
Chris Tate
37b2217600 Merge "Get rid of now-superfluous "backup or restore in progress" tracking" 2010-02-02 15:27:55 -08:00
Christopher Tate
c2af5d3bf8 Get rid of now-superfluous "backup or restore in progress" tracking
Now that backup/restore/etc operations are queued and serialized, we no longer
need to use external state tracking to prevent overlapping operations.

Change-Id: I14f2a5d740cb97ae062aad55a06f49a2be5dd985
2010-02-02 15:24:39 -08:00
San Mehat
be16cb15b3 PackageManagerService: Refactor MountService calls (new api)
Signed-off-by: San Mehat <san@google.com>
2010-02-02 11:17:46 -08:00
San Mehat
4270e1ea74 MountService: Massive bloat reduction and rewrite
- Most API calls now return an int as a result code (see MountServiceResultCode.java)
- All notification code has been removed
- All settings code has been removed
- Removed UMS centric API calls in favor of more generic 'shares'
- Mount error reporting is no longer done via an event, but is done as part of the
  actual mount process
- Rework vold IPC commands to be more sane

Updated:
    MountService: Rename MountServiceObserver -> MountServiceListener
    MountService: Add support for Async callbacks

Updated:
    MountService: Add BinderDeath handling

Updated:
    MountService: Remove notifys since we dont listen anyways

Updated:
    MountService: Fix bad cast

Signed-off-by: San Mehat <san@google.com>
2010-02-02 11:17:46 -08:00
San Mehat
78071b7347 Merge "NativeDaemonConnector: Cleanup socket code and use a proper exception Signed-off-by: San Mehat <san@google.com>" 2010-02-02 11:15:55 -08:00
Joe Onorato
f6133febae Fix bug 2362761 AppWidgetService should use Intent.setPackage()
Thanks Bjorn for the tip.
2010-02-01 18:24:46 -05:00
Dianne Hackborn
9327f4f671 More device policy work: clarify password modes, monkeying.
Clarifies what the password modes mean, renaming them to "quality"
and updating their documentation and the implementation to follow.

Also adds a facility to find out if a monkey is running, which I
need for the api demo to avoid letting it wipe the device.
2010-01-29 17:16:02 -08:00
Neal Nguyen
9205b2effe Merge "Phase 2 of test cleanup: moving test files from AndroidTests closer to their sources." 2010-01-29 16:38:53 -08:00
Christopher Tate
b0dcaaf108 Don't crash on transport unregistration if there is no current transport
Change-Id: Icd0962254ba224a7be27d408dffb25b634f67863
2010-01-29 16:27:04 -08:00
Chris Tate
4a20061f34 Merge "Make backup/restore asynchronous and enforce timeouts" 2010-01-29 15:02:03 -08:00
Christopher Tate
44a2790374 Make backup/restore asynchronous and enforce timeouts
Callouts to app backup agents are now asynchronous, and timeouts are applied if
they take too long, hang, etc.  The initial timeouts are set to 15 seconds on
backup, 60 seconds on restore.  These operations typically run at background
priority, so it's necessary to give them ample time to run.

As part of setting up this asynchronicity, the Backup Manager's internal thread
management has been overhauled.  It now spins off a single HandlerThread at
startup, and runs backup/restore/etc operations *synchronously* in that thread,
applying timeouts as appropriate.  This means we're no longer spinning up new
threads all the time, and furthermore it ensures that we can never have more
than one operation in flight at once.  Later CLs will remove the now-redundant
logic that previously ensured that operations didn't stomp on each other.

Bug: 2053560
Change-Id: Ie4315c219c7ff6dd8f51f2ad6c0872595b18cff1
2010-01-29 14:07:52 -08:00
Mike Lockwood
ef73162887 Support for triggering the lockscreen while the screen is on:
Add new ALLOW_LOCK_WHILE_SCREEN_ON window manager flag, which when set
causes the window manager to put up the lockscreen after the
normal screen timeout has elapsed.

Add plumbing to pass PowerManager.userActivity() to the window manager policy.

Change-Id: I05adc52bad39c56031a08e8ec3cbcf5c2d9b9827
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-01-29 17:05:04 -05:00
Neal Nguyen
1a44d5dcab Phase 2 of test cleanup: moving test files from AndroidTests closer to their sources.
Most of these are file moves; a couple notable exceptions are the changes due to the move, and fixing up test code:
- database/DatabaseCursorTest.java
- database/DatabaseStatementTest.java
- net/UriTest.java
2010-01-29 13:35:51 -08:00
Suchi Amalapurapu
bd2f531a28 Merge "Fix StringIndexOutOfBoundsException in PackageManagerService" 2010-01-29 08:45:39 -08:00
Daniel Sandler
d425a45f8d Fix build.
(Broken in change Ib94f795c.)
2010-01-29 10:09:04 -05:00
San Mehat
4c27e0e3be NativeDaemonConnector: Cleanup socket code and use a proper exception
Signed-off-by: San Mehat <san@google.com>
2010-01-29 06:30:23 -08:00
Daniel Sandler
77c292d83e Merge "New full-screen activity for USB mass storage interaction." 2010-01-29 06:22:33 -08:00
Bjorn Bringert
5fd5bfe942 Fix StringIndexOutOfBoundsException in PackageManagerService
The method packageManagerService.getNextCodePath(String oldCodePath,
String prefix, String suffix) threw StringIndexOutOfBoundsException if
oldCodePath does not contain prefix, and prefix is longer than
oldCodePath, or if the preix and suffix overlap.

Fixes http://b/issue?id=2404232

Change-Id: Ib8abb16f8bfd08f607476d9289f46d170c43a076
2010-01-29 12:29:41 +00:00
Chia-chi Yeh
784d53e79b WifiService: allow EAP variables to be unset using empty strings. 2010-01-29 16:26:28 +08:00
Irfan Sheriff
c4a0c2744a Merge "Blacklist APs instead of disable" 2010-01-28 20:46:25 -08:00
Robert Greenwalt
fbf56dc719 am 3e229076: am cc4b4016: Fix the reporting of NO_CONNECTIVITY.
Merge commit '3e229076203cd8cfee0adac44cd3c930dfa0e59c'

* commit '3e229076203cd8cfee0adac44cd3c930dfa0e59c':
  Fix the reporting of NO_CONNECTIVITY.
2010-01-28 14:46:55 -08:00
Robert Greenwalt
64fe5646c5 am 6d626d41: am 5381e4ef: Merge "Refine fix I53e91db7 to apply only to wifi network" into eclair
Merge commit '6d626d41e9db62a0eadb61ccb2aa4081a8b9f6d0'

* commit '6d626d41e9db62a0eadb61ccb2aa4081a8b9f6d0':
  Refine fix I53e91db7 to apply only to wifi network
2010-01-28 13:44:45 -08:00
Daniel Sandler
b94f795c25 New full-screen activity for USB mass storage interaction.
Still TODO: patch into forthcoming callbacks from
MountService so the USB storage activity always shows the
correct state of the device. (Right now it only refreshes
its display onResume.)

Bug: 2299129
2010-01-28 16:18:22 -05:00
Dianne Hackborn
254cb446fa More device admin.
- Clean up device policy manager APIs.
- Implement lockNow().  For now this just turns the screen off to lock the device.
2010-01-28 13:15:57 -08:00