212 Commits

Author SHA1 Message Date
Suchi Amalapurapu
bc806f65ed Remove deprecated api. Aptly rename freeStorageWithIntent to freeStorage. 2009-06-19 10:25:37 -07:00
Christopher Tate
20efdf6b56 Make signature checks on restore work with unsigned apps 2009-06-18 19:42:24 -07:00
Android (Google) Code Review
63e7155c7d Merge change 4696 into donut
* changes:
  Fix targetSdkVersion, make resize mode a flag, delayed dexopt, easy ApplicationInfo.
2009-06-18 19:33:33 -07:00
Joe Onorato
5d605dc56b backup stuff 2009-06-18 18:41:11 -07:00
Christopher Tate
abce4e8714 Use signatures on restore
On restore now, the backup manager gets the signature blocks corresponding to
the restore set from the transport.  It then validates those signatures against
the on-device app signatures, and refuses to restore data to an app whose
on-device sig block does not match the backup image's.

Also actually implement 'bmgr transport N' so that we can select the local
transport easily during runtime.
2009-06-18 18:38:02 -07:00
Dianne Hackborn
5c1e00b14d Fix targetSdkVersion, make resize mode a flag, delayed dexopt, easy ApplicationInfo.
- Fix a bug where targetSdkVersion could not be set if minSdkVersion.  Stupid, stupid.
  Also make sure to fail if minSdkVersion is for a code name.  Really stupid.

- Change the API for resize compatibility mode to be a bit in the flags field, instead
  of a separate boolean.

- Implement delayed dexopting, to avoid the looong full dexopt during boot.  This is
  only enabled for "eng" builds.  When in this mode, the activity manager will make
  sure that a dexopt has been done before loading an .apk into a process, and will
  try to avoid displaying ANRs if they are due to the dexopt causing some operation
  to take longer than it normally would (though I make no guarantees about this
  totally working).

- Add API to Context to get the ApplicationInfo for its package, for easy access to
  things like targetSdkVersion.
2009-06-18 17:10:57 -07:00
Android (Google) Code Review
167dbe0bf1 Merge change 4670 into donut
* changes:
  Update RandomBlock to use RandomAccessFile.  This helps prevent certain unusual conditions from corrupting the entropy file.  (for example, if Android should happen to crash while a write is in progress)
2009-06-18 17:05:19 -07:00
Android (Google) Code Review
07eac01644 Merge change 4682 into donut
* changes:
  Store the app signatures as part of the backup set
2009-06-18 16:15:47 -07:00
Christopher Tate
6785dd8420 Store the app signatures as part of the backup set
Under a pseudo-app for the Package Manager, we store the app signatures for all
participating applications installed on the device.  At restore time we will
restore this first, then ensure that the current on-device signature chain is
compatible with the one in the backup set.  If there's a mismatch, this may be a
spoof attempt and we will refuse to restore that app's data.

The restore side of this is not implemented, but the Package Manager agent is
here as well as the backup side theoretically pushing the data now.
2009-06-18 15:58:25 -07:00
Nick Kralevich
2854254c2f Update RandomBlock to use RandomAccessFile. This helps
prevent certain unusual conditions from corrupting the
entropy file.  (for example, if Android should happen to
crash while a write is in progress)
2009-06-18 15:23:17 -07:00
Android (Google) Code Review
5ad76ef5ee Merge change 4521 into donut
* changes:
  load entropy data at boot.  Periodically write entropy data to disk.
2009-06-18 11:58:54 -07:00
Nick Kralevich
4fb256117c load entropy data at boot. Periodically write entropy data to disk. 2009-06-18 11:00:19 -07:00
Dianne Hackborn
c14b9ccdf1 Extend Intent/Uri conversion for use by Browser
This introduces a new Uri form of Intent with an "intent:" scheme, and a
corresponding update to the parser to handle these, so that the browser
can use this generic facility for starting activities based on the links
that are clicked and allow for web pages to link to arbitrary intents.

There is also a new "package" field on Intent which allows you to limit
the components it finds to a given package.  This replaces the new method
that was added to PackageManger for doing this when resolving activities,
and implements it for all Intent queries against the package manager.
2009-06-17 21:48:14 -07:00
Android (Google) Code Review
e64bb1dd9e Merge change 4579 into donut
* changes:
  Fix issue #1924851
2009-06-17 21:40:20 -07:00
Dianne Hackborn
760ec4a095 Fix issue #1924851
We now only increment the launch count when we are launching from one package
to another.  Also the individual components in a package now have a count
of the number of times they have been entered, which likewise is only updated
when going to one component from another.

This requires a new data format (all old data is wiped) and new checkin
dump format (tools must be updated to read it).
2009-06-17 21:36:52 -07:00
Dan Egnor
87a02bcf68 Replace the stub GoogleTransport with callout to the
GoogleTransportService (which lives in vendor/google).
Use the Google transport by default.
Also, fix a bug: Thread.run() != Thread.start()
2009-06-17 18:23:05 -07:00
Jacek Surazski
f829a78f6c add exception message to ApplicationErrorReport
useful signal for clustering
2009-06-17 21:48:17 +02:00
Suchi Amalapurapu
1ccac75e1f Remove circular dependency in PackageManager. api freeStorage uses PendingIntent from android.app
Create a new public IntentSender class that can be used by PackageManager instead.
This new class uses IIntentSender internally and can only be created by PendingIntent for now.
Provide a new getIntentSender api in PendingIntent to create an instance of this class.
Move IIntentSender and IIntentReceiver from android.app to android.content
Change imports of IIntentSender and IIntentReceiver to reflect the new package name
The PackageManager api has been named as freeStorageWithIntent and will be renamed as freeStorage
once the older api(which has been deprecated) will be removed shortly.
2009-06-17 11:31:26 -07:00
Android (Google) Code Review
07ca8c71f4 Merge change 4438 into donut
* changes:
  Fix many of the ANRs introduced by scheduling classes.
2009-06-17 10:38:44 -07:00
Dianne Hackborn
82f3f0008e Fix many of the ANRs introduced by scheduling classes.
We weren't bumping the oom_adj of processes receiving a registered broadcast.  Previously
this wasn't a problem, because those processes are allowed to have their oom_adj
managed by whatever else is in them and if the registered receiver goes away no problem.
But now this is also controlling the scheduling class, so we need to bump them up.

This is probably good anyway, since the developer has the same assurance of their process
not being killing in the middle of registered receivers like it had always been for
manifest receivers.

Also fixed a small issue where we were not recomputing the oom_adh after finished with
a broadcast.
2009-06-16 18:49:05 -07:00
Christopher Tate
aa088447ba Hold the current transport instantiated all the time.
We no longer instantiate the transport just for the duration of handling a
backup or restore operation.  Instead, we hold the object forever (replacing it
if instructed to do so).  This makes it easier for transports to watch system
state and help set backup timing policy.

Also fixes up the IBackupTransport documentation a bit.
2009-06-16 18:25:46 -07:00
Christopher Tate
63d2700036 Allow privileged callers to schedule a backup pass for any app. 2009-06-16 17:18:05 -07:00
Christopher Tate
f68eb500f9 More bmgr work; fix clear-data signalling
The 'list sets' and 'restore token#' commands from bmgr now do what they are
supposed to.  At this point we see the restore target's data being cleared
properly and its agent being launched and invoked for restore.
2009-06-16 13:58:17 -07:00
Android (Google) Code Review
6297cb2eb5 Merge change 4287 into donut
* changes:
  Sketch out a 'bmgr' command line tool
2009-06-15 19:03:48 -07:00
Christopher Tate
ace7f094bf Sketch out a 'bmgr' command line tool
Not finished, but eventually will allow adb shell access to the Backup Manager
for testing purposes etc.
2009-06-15 18:07:25 -07:00
Dianne Hackborn
cfaef699e1 Implement permission test for activity, window, service manager.
This also includes some changes to the window manager permission checks.  Almost all of these
are to make it most testable (through an exception on a permission failure), though there is
one permission check that needed to be added: updateOrientationFromAppTokens().
2009-06-15 14:35:07 -07:00
Android (Google) Code Review
be3615bded Merge change 4112 into donut
* changes:
  Fix bug #1812041: activity manager crash with bad args.
2009-06-12 18:03:11 -07:00
Dianne Hackborn
75b038545e Fix bug #1812041: activity manager crash with bad args.
There was old code that would kill the system process in some cases when there
was a bad activity token.  This is really no longer used, except in a few
places where it allows apps to kill the system.  So just get rid of it and
make the world a better place.
2009-06-12 15:43:26 -07:00
Christopher Tate
cde87f45e0 Journal backup requests so that they won't be lost in a crash
When an application requests a backup via dataChanged(), we now journal that
fact on disk.  The journal persists and is only removed following a successful
backup pass.  When the backup manager is started at boot time, it looks for any
existing journal files and schedules a backup for the apps listed in them, on
the expectation that the device shut down or crashed before a backup could be
performed.
2009-06-12 13:57:39 -07:00
Christopher Tate
9bbc21a773 Flesh out restore interface on manager; work up most of LocalTransport 2009-06-10 20:38:54 -07:00
Android (Google) Code Review
238bf47a85 Merge change 3826 into donut
* changes:
  LocationManagerService: Fix logic error removing multiple dead receivers.
2009-06-10 17:32:21 -07:00
Simon Schoar
4686657cee LocationManagerService: Fix logic error removing multiple dead receivers.
If multiple receivers are dead, only the first one will be added.
found in http://code.google.com/p/android/issues/detail?id=2651

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-06-10 20:23:31 -04:00
Christopher Tate
c7b31e3c3c The rest of the basic flow for restore
Also moved the processOneBackup() implementation into the Thread class that runs
the backup sequence.
2009-06-10 16:43:50 -07:00
Mitsuru Oshima
e5fb328825 resolution support fix/improvement
* adding compatibility menu
    * backup gravity
    * set expanable=true if the screen size is hvga * density.
    * added "supports any density" mode. I'll add sdk check later.
    * disallow to catch orientation change event if the app is not expandable. This
      was causing layout problem under non-expandable mode. I discussed this with Mike C
      and we agreed to do this approach for now. We'll revisit if this causes problem to
      a lot of applications.
2009-06-10 15:22:17 -07:00
Romain Guy
06882f8eff Enable HierarchyViewer on debuggable builds, even if they're secure.
That will let us (finally) use the tool on userdebug builds.
2009-06-10 14:44:11 -07:00
Android (Google) Code Review
b81645c868 Merge change 3726 into donut
* changes:
  ActivityManager: Ensure that we clear the calling process identity around calls to Process.setProcessGroup().
2009-06-10 11:07:58 -07:00
Christopher Tate
df01deaacf More restore plumbing, plus add suggested-backoff to transport API
Adds most of the code for a background-thread restore process, structured much
like the backup thread.  Broke some common functionality out into a helper
function for doing a synchronous wait for a requested agent to attach.

Added a method to IBackupTransport whereby the transport will be asked for
an opinion on whether this is a good time for a backup to happen.  It will
reply with the results of its policymaking around backoff intervals, time-of-day
selection, etc.
2009-06-10 10:53:24 -07:00
San Mehat
9438de2001 ActivityManager: Ensure that we clear the calling process identity around calls to Process.setProcessGroup().
Signed-off-by: San Mehat <san@google.com>
2009-06-10 09:12:37 -07:00
Christopher Tate
9b3905c4a2 Revamp IRestoreSession a bit
We now supply an array of RestoreSet objects instead of wacky Bundle
shenanigans.  Also, pushed beginRestoreSession() out to the BackupManager
concrete interface class so that SetupWizard can use it.

(beginRestoreSession() is @hide, non-privileged apps cannot use it.  It's
also guarded by android.permission.BACKUP enforcement.)
2009-06-08 16:01:24 -07:00
Android (Google) Code Review
9d9953d94d Merge change 3420 into donut
* changes:
  LocationManagerService: Remove some unneeded imports.
2009-06-07 20:30:45 -07:00
Mike Lockwood
6ba283f726 LocationManagerService: Remove some unneeded imports.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-06-07 23:29:25 -04:00
Christopher Tate
8c850b792f Add IRestoreSession interface for the restore flow
Restore is a fairly complicated, somewhat stateful process, so we introduce
a new interface to encapsulate the various bits and pieces into a nicely
separable component.  In particular, this will make it much cleaner to
open and interrogate an expensive-to-construct transport and then reuse it
for the actual restore process itself.
2009-06-07 19:33:20 -07:00
Christopher Tate
7b88128e08 Adjust IBackupTransport interface
Instead of just passing a package name to performBackup, pass the whole
PackageInfo struct, explicitly including the list of signatures for the package.
No need to make each transport look this up individually when it's a necessary
part of the backup payload for each app.
2009-06-07 13:55:42 -07:00
Android (Google) Code Review
19cd309f9e Merge change 3017 into donut
* changes:
  Add the EAP related fields for WiFi configuration.
2009-06-05 19:55:44 -07:00
Christopher Tate
6fa9597690 Apply OOM adjustment while an app is undergoing backup 2009-06-05 18:45:34 -07:00
Christopher Tate
cd4ff2e72d Fix tracking of backup participants across package remove/update 2009-06-05 14:03:25 -07:00
Christopher Tate
1885b37913 Fix backup agent unbind
The handwritten binder transaction passing wasn't propagating the agent-destroy
transaction to the client side.  Oops.

Also, remove obsolete run-one-agent code from the backup manager service.
2009-06-04 15:02:37 -07:00
Chung-yih Wang
5069cc7849 Add the EAP related fields for WiFi configuration.
-- added the EAP/802.1X related fields in WifiConfiguration for
  supporting EAP/802.1X authentication.
-- hid the related fields for now.
2009-06-05 02:10:35 +08:00
Christopher Tate
043dadc751 More backup work
* Put in some permission enforcement around agent connection notification
  and full-backup scheduling.
* Full backup now applies to any package, not just backup participants who
  have declared their own android:backupAgent
* The process of running the backup operation on the set of apps who have
  been queued for it is now done in a separate thread, with a notification
  mechanism from the main Backup Manager service to pass along new-agent
  binding knowledge.  There's no longer one do-backup message on the primary
  Handler per target application.
* The new backup thread sets up the desired transport now and passes
  along the newly backed-up data to it for each backup target.  Two
  transports have been defined so far, GoogleTransport and AdbTransport;
  both are stubs at present.

Note that at present the backup data output file seems to be properly
created, but after doBackup() is called on the test app's agent it's
still zero size.
2009-06-03 20:42:15 -07:00
Android (Google) Code Review
9654cba89e Merge change 3094 into donut
* changes:
  Grant permissions to older package when deleting an updated system application. When a system app gets updated, the permissions are granted to the new pkg. Similary when this updated pkg(from data partition) gets removed, the older pkg from system partition is restored. but the permissions are'nt being granted explicitly and so the restore fails. This fix addresses specific bugs related to uninstall of updated system apps. These code paths will be revisited later but this fix is needed for OTA's that might fall back to older versions of system apps.
2009-06-03 16:32:18 -07:00