286 Commits

Author SHA1 Message Date
Joe Onorato
302754801c Make it so the notification manager doesn't mysteriously
beep during boot.
2009-07-08 17:09:14 -07:00
Christopher Tate
22b60d8fd0 Remove a lot of debug-log verbosity
We now log in dataChanged() only when an app is added to the backup set (and
*not* if it redundantly asks to be added after it's already there) and on error.
2009-07-07 16:36:02 -07:00
Christopher Tate
a7de384550 Only write to the pending-backup journal when necessary
We now only commit to the pending-backup journal on disk the first time that a
given package is added to the backup set.  This avoids a lot of write thrashing
of the disk, particularly since Settings tends to call dataChanged() a great
many times during boot, while the Settings UI is in use, etc.
2009-07-07 14:50:26 -07:00
Christopher Tate
3d7cd13e77 Fix the metadata-available test during restore 2009-07-07 14:23:07 -07:00
Android (Google) Code Review
c1c44a5614 Merge change 6363 into donut
* changes:
  LocationManagerService: Use Context.checkCallingOrSelfPermission for permission checks
2009-07-07 11:02:04 -07:00
San Mehat
0310f9aa21 WifiService: Fix build (missing import)
Signed-off-by: San Mehat <san@google.com>
2009-07-07 10:50:39 -07:00
Mike Lockwood
b7e9922722 LocationManagerService: Use Context.checkCallingOrSelfPermission for permission checks
so other services running in the system process can use the location manager.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-07-07 13:18:21 -04:00
San Mehat
fa6c7111fe WifiService: use wifi association state to determine if we should suspend wifi instead of
the existance of an IP address.

Signed-off-by: San Mehat <san@google.com>
2009-07-07 09:41:39 -07:00
Christopher Tate
8031a3df2f Make enable/provisioning of the backup service a two-step process
This CL adds the concept of 'provisioned' to the backup manager.  No backups
will be scheduled until the user has indicated that backups are to be enabled
*and* has clicked all the way through the setup wizard.

When the user first turns on the backup system, the delay before the initial
backup pass is different from the periodic backup interval.  Currently that
initial delay is 12 hours.  The intent here is to guess at a less-active time
for performing that first backup pass.

NOTE: currently the backup service defaults to 'provisioned'.  Once the real
code goes live in Setup Wizard, this will be changed to default to
not-provisioned until the user has confirmed all the relevant UI.
2009-07-06 17:43:03 -07:00
Christopher Tate
34ebd0e1bb Fix up permissions for 'dumpsys backup' 2009-07-06 15:44:54 -07:00
Android (Google) Code Review
0d725f7d5a Merge change 6162 into donut
* changes:
  Hold a wakelock during backup/restore/clear operations
2009-07-06 11:54:34 -07:00
Christopher Tate
b6787f2ee5 Hold a wakelock during backup/restore/clear operations
We need to make sure we stay alive for the duration of a backup or (especially)
restore operation.  The existing Handler-based timing system was simply not
properly functional, so it's been retooled to use a repeating alarm delivering a
broastcast PendingIntent to our registered receiver.

We acquire a partial wake lock in the broadcast receiver [i.e. while the Alarm
Manager is holding one for the duration of broadcast delivery] and pass the
wakelock object to the backup thread, which eventually releases it when it's
finsihed operations.  A similar pattern is used for the threads handling restore
and clear.
2009-07-06 11:49:49 -07:00
Chung-yih Wang
699ca3f251 Add password field for WiFi configuration.
1. the certtool.h is modified for avoiding the side effect,
   for saving the configuration with wpa_supplicant.
2. put the loadLibrary back in CertTool.java
3. Fix incorrect JNI declarations.
2009-07-05 11:06:01 +08:00
Android (Google) Code Review
7e8cbfc2bc Merge change 6143 into donut
* changes:
  Fix the simulator.
2009-07-02 15:24:43 -07:00
Marco Nelissen
d595c79cdd Fix the simulator. 2009-07-02 15:23:26 -07:00
Android (Google) Code Review
e15df4017c Merge change 6132 into donut
* changes:
  If we can't get the restore set's metadata, don't continue
2009-07-02 14:30:56 -07:00
Christopher Tate
8c0324752a If we can't get the restore set's metadata, don't continue
Without the metadata we can't verify the version number or the signatures of the
apps whose data we'd be trying to restore against the apps present on device.
This is not acceptable; we need to refuse to give data to an unauthenticated
app.
2009-07-02 14:28:47 -07:00
Android (Google) Code Review
0d81f63687 Merge change 6102 into donut
* changes:
  Backup Wifi supplicant data.
2009-07-02 13:19:55 -07:00
Android (Google) Code Review
9701b3d594 Merge change 5979 into donut
* changes:
  Remove the constraint to assign new uid when code path changes for system packages
2009-07-02 12:20:29 -07:00
Christopher Tate
4e3e50cfa7 Clean up the last two literal permission string usages 2009-07-02 12:14:05 -07:00
Amith Yamasani
16d79e56ca Backup Wifi supplicant data.
WifiService requests a backup when it writes wifi configuration to disk.
Backup the wifi supplicant file when settings provider runs backup.
2009-07-02 12:05:32 -07:00
Christopher Tate
ee0e78af5a Add a "clear backed-up data" method to the backup mechanism
It's now possible to ask that the backup manager wipe the saved data for a given
application from the backing store.  LocalTransport implements this now but the
Google backend does not yet.  When the data is wiped, the on-device backup state
is also wiped to ensure that the next backup pushes all necessary data.

Bmgr has not yet been modified to actually call into this method, but it will
be soon.
2009-07-02 11:30:29 -07:00
Dianne Hackborn
d7cd29da91 Add facility to run setup wizard after an update.
The system now keeps a tag of the last version (just an arbitrary string)
that the setup wizard was run for.  If this is different than the current
one in the setup wizard, then setup is launched at boot.

This introduces a new intent action for the part of the setup wizard that
gets run for an ungrade, which the system uses to find its current version
tag for comparing against what was last stored.  It is up to the launched
setup activity update the stored setting to reflect its current value,
once it is happy.
2009-07-01 20:20:47 -07:00
Dianne Hackborn
cf098294da Move backup state to settings, change permission checks to use symbol.
This changes the backup service to use the settings provider instead
of system properties, correspondingly making it off by default and
allowing specific devices to define the transport.  Also tweaks
the permission checks to use the permission symbol instead of raw
strings.

This requires some corresponding changes in the vendor projects.
2009-07-01 20:12:36 -07:00
Android (Google) Code Review
2bbb80e183 Merge change 5994 into donut
* changes:
  Less logging in some places.  More in others.
2009-07-01 18:04:40 -07:00
Joe Onorato
9a5e3e115f Less logging in some places. More in others. 2009-07-01 21:04:03 -04:00
Romain Guy
a54755962c Cleanup a bunch of warnings in app widgets code. 2009-07-01 17:21:12 -07:00
Suchi Amalapurapu
b24a96701a Remove the constraint to assign new uid when code path changes for system packages 2009-07-01 16:16:56 -07:00
Android (Google) Code Review
d18dc8c641 Merge change 5906 into donut
* changes:
  resolve complex value in application context instead of system context.
2009-07-01 12:53:04 -07:00
Android (Google) Code Review
54af78a3f7 Merge change 5950 into donut
* changes:
  Fix memory leaks in system_server unlink DeathRecipients in a whole bunch of places to avoid memory leaks
2009-07-01 12:52:39 -07:00
Suchi Amalapurapu
fff2fda019 Fix memory leaks in system_server
unlink DeathRecipients in a whole bunch of places to avoid memory leaks
2009-07-01 12:55:30 -07:00
Christopher Tate
49401ddb9a Revamp backup scheduling policy
We now schedule a periodic check of pending backups; if any apps have requested
a backup since the last check, we perform all of the pending backups.  The
periodic backup scheduling matches the enable/disable state of the backup
manager; while backups are disabled entirely there are no periodic wakeups.

The period is set here to one hour.  If an external caller (transport, the
'bmgr' command line tool, etc) requests an immediate backup pass, that is
performed and then the periodic backup check is rescheduled using that pass as
the starting point of a new interval.
2009-07-01 12:38:06 -07:00
Christopher Tate
ce0bf069fe Use secure settings for backup enable / transport selection 2009-07-01 11:45:57 -07:00
Mitsuru Oshima
8f25c426b1 resolve complex value in application context instead of system context. 2009-07-01 00:10:43 -07:00
Christopher Tate
7958834e0e Run backups at background priority 2009-06-30 16:11:49 -07:00
Android (Google) Code Review
6e1647a212 Merge change 5829 into donut
* changes:
  Fix issue #1673793: Theme styles don't apply.
2009-06-30 14:04:55 -07:00
Dianne Hackborn
1dac277f93 Implement issue #1943927 (need notification in status bar when adb is active)
This is a little hacky -- we just assume that if adb is enabled and power
is connected through usb, then it is active.

The icons and text are temporary until final design is provided.
2009-06-30 13:40:51 -07:00
Dianne Hackborn
de7faf658c Fix issue #1673793: Theme styles don't apply.
It turns out this was not a problem in the resource code at all.  Rather,
the system process has a cache of pre-loaded attributes it uses to avoid
continually reloading things as it needs them.  Well it turns out this
cache wasn't flushed after a package was uninstalled or a configuration
changed, so you could re-install an app where you change its style resources
so its theme now points to one that is inconsistent in the cache.

This is mostly a problem for developers, where they continually install
new versions of an app where resources have changed.  This could possibly
show up when updating an app on a normal phone, although the problem would
eventually correct itself since this cache uses weak references.

Anyway, the cache is now reworked to be flushed appropriately.

This change also includes an update to aapt to be able to dump the
contents of bags in resources.
2009-06-30 13:27:30 -07:00
Christopher Tate
72d19aa51e Tighten up the metadata backup logic
We now store the app version codes and and global OS incremental version name in
the PM backup state and the actual backup record.  We then use that information
to trigger a re-backup of the metadata if the OS revision changes in any way, or
to back up single apps' metadata if we notice that they've been upgraded.
2009-06-30 12:52:54 -07:00
Christopher Tate
6f317426e4 Don't issue a deletion for the global metadata backup
We were accidentally submitting a deletion for the global metadata key in the
PM backup handling (it was falling into the usual "here's a package that we said
we'd backed up last time, but now it's no longer on device" code).  Don't do
that any more, i.e. actually keep the global metadata key in the backup set.
Oops.
2009-06-29 18:52:55 -07:00
Christopher Tate
6ef58a1509 Implement persistent enable/disable of the backup manager
Backup & restore is still enabled by default, but with the expectation that it
will be enabled during the course of the Setup Wizard or some other privileged
entity that has notified the user about the ramifications.  While disabled,
data-changed notices will still be collected, but no backup pass will be
scheduled.  When the backup manager is later enabled, any pending data-changed
notices will then be processed and the apps invoked for backup.
2009-06-29 15:33:27 -07:00
Android (Google) Code Review
66c2942a11 Merge change 5605 into donut
* changes:
  Fix issue #1943706 (Applying the monkey to GoogleVoice causes SecurityException)
2009-06-29 11:57:33 -07:00
Christopher Tate
9171749700 Use system properties to track the current transport
This change retools the transport selection mechanism a fair bit.  Transports
are now specified by name rather than by numeric ID, and the name of the
currently selected transport is stored in a persistent system property under the
name "persist.service.bkup.trans".

The name -> IBackupTransport translation is now handled by maintaining a map
from the names to the live IBackupTransport objects that correspond.  The Google
transport service observer now registers and unregisters the transport as the
service goes up and down.

The bmgr command has been expanded to include real transport interrogation and
selection by name, and some documentation has been written for it.
2009-06-26 21:14:41 -07:00
Dianne Hackborn
2bd33d74ae Fix issue #1943706 (Applying the monkey to GoogleVoice causes SecurityException)
Fiddle around with event dispatching to remove calling permissions when we
enter event injection, and prevent callers from going to the PhoneWindowManager's
event processing code unless they are allowed at that point.
2009-06-26 18:59:01 -07:00
Christopher Tate
f7c886b4fe Respect android:allowClearUserData=false during restore
Ordinarily we wipe the data of apps we are restoring.  This is problematic for
packages that expect that their data can never be wiped back to nothing,
especially system packages, so we now respect the android:allowClearUserData
manifest attribute.
2009-06-26 15:34:09 -07:00
Christopher Tate
466ef345d1 Trim some superfluous imports. 2009-06-26 14:41:57 -07:00
Android (Google) Code Review
72eb0acad5 Merge change 5483 into donut
* changes:
  Expand support for different screen sizes.
2009-06-26 13:46:07 -07:00
Dianne Hackborn
723738cfae Expand support for different screen sizes.
Applications can now declare that they support small, normal, or
large screens.  Resource selection can also be done based on these
sizes.  By default, pre-Donut apps are false for small and large,
and Donut or later apps are assumed to support all sizes.  In either
case they can use <supports-screens> in their manifest to declare
what they actually support.
2009-06-26 13:37:05 -07:00
Dan Egnor
156411df46 Use a long for restore token 2009-06-26 13:25:27 -07:00
Christopher Tate
8a27f923eb Don't crash in various ways when using backup services too early
BackupManager now no longer tries to use a null service binder if it's used
early during the boot process.  ActivityManagerService no longer tries to
dereference null pointers if bind/unbind semantics get out of step due to things
being run too early.
2009-06-26 12:20:10 -07:00