224 Commits

Author SHA1 Message Date
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
Mitsuru Oshima
9189cabb0b * Moved supports-density tag under manifest
* Refactored Compatibility code
  * Added CompatibilityInfo class
  * Removed getApplicationScale from Context
  * Added Resources#getCompatibilityInfo so that RootView can get the compatibility info w/o going through Context
* Expandable support
  * Added expandable tag under manifest
  * Old application w/o expandable is given the default screen size  ([320, 480] x density).
  * The non-expandable window is centered.
2009-06-03 16:28:10 -07:00
Suchi Amalapurapu
701f5164c1 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 15:52:04 -07:00
Amith Yamasani
eaeb663bcd Track activity foreground CPU usage for battery stats.
Track the foreground CPU time of an activity so that we can tell if apps are
spending more time in the background compared to foreground.
Update power profile values for screen backlight and GPS.
Fix some javadoc bugs (milliseconds vs. microseconds).
2009-06-03 15:38:24 -07:00
Satish Sampath
8dbe612dc6 Adding internal method replacePreferredActivity.
This was required because we need a way to set the preferred activity for a
particular intent filter based on user selection (in our case the
ACTION_WEB_SEARCH intent filter for selecting the preferred search engine from
the list of available search engines providers). The current
addPreferredActivity call was not sufficient since it leaves the existing
preferred activities in the list and does not remove them, which this call
does.
2009-06-03 07:54:42 +01:00
Wink Saville
f315238a2b TODO's from Teleca with modifications from wink. 2009-06-01 14:39:20 -07:00
San Mehat
5a3a77dabd base: Rename WRITE_SDCARD -> WRITE_EXTERNAL_STORAGE
Signed-off-by: San Mehat <san@google.com>
2009-06-01 09:25:28 -07:00
Christopher Tate
181fafaf48 Retool the backup process to use a new 'BackupAgent' class
Backups will be handled by launching the application in a special
mode under which no activities or services will be started, only
the BackupAgent subclass named in the app's android:backupAgent
manifest property.  This takes the place of the BackupService class
used earlier during development.

In the cases of *full* backup or restore, an application that does
not supply its own BackupAgent will be launched in a restricted
manner; in particular, it will be using the default Application
class rather than any manifest-declared one.  This ensures that the
app is not running any code that may try to manipulate its data
while the backup system reads/writes its data set.
2009-05-31 13:10:03 -07:00
Jaikumar Ganesh
4551565943 Enforce permissions for PhoneStateListener events.
PhoneStateListener events like LISTEN_CALL_STATE_CHANGED,
have privacy information like phone numbers and hence,
need to be protected with a permission. The permission
READ_PHONE_STATE is used for this purpose. Use the permission
trick to ensure backward compatability.
2009-05-29 11:38:00 -07:00
Robert Greenwalt
fc1b15cfbf Fix wifi multicast API for public use.
Applying API review comments and taking it public.
2009-05-28 13:37:06 -07:00
Dianne Hackborn
06de2ea752 Activity Manager changes the scheduling group of processes.
The algorithm for this is currently very simple: all persistent processes are
always in the normal scheduling group, all other processes are normal if their
oom_adj is as good or better than VISIBLE, otherwise they are in the background
group.

Note that this currently results in a fair number of log messages about not
being able to change the group, since the system process does not have
permission to do so.  Once a kernel fix is in, these will go away and the code
will start working.
2009-05-26 18:50:46 -07:00
Mike Lockwood
270e87f71a Sensors: Use a native_handle for the data channel instead of a single file descriptor.
This eliminates the requirement that all sensors share a single file descriptor.
This, along with concurrent changes in other projects, fixes bugs b/1614524 and b/1614481

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-05-23 13:22:08 -04:00
Android (Google) Code Review
fea1a459aa Merge change 2364 into donut
* changes:
  Initial checkin for App Fuel Gauge infrastructure.
2009-05-22 19:40:33 -07:00
Dianne Hackborn
b181118b6e Define TARGET_CPU_ABI for finding native code in .apks 2009-05-22 18:45:25 -07:00
Amith Yamasani
244fa5c05b Initial checkin for App Fuel Gauge infrastructure.
This adds the PowerProfile class and data file that provides power consumption numbers
for different subsystems. Also added Audio/Video subsystems to track on a per UID basis.
2009-05-22 14:36:07 -07:00
Mike Lockwood
fd6e5f0dda location: Replace ILocationCollector interface with new ILocationProvider method
This change replaces ILocationCollector with a more general mechanism that
passes locations received from a provider to all other providers.
The network location provider now uses this to implement the location collector.
In the future, this could be used to inject network locations to the GPS
as aiding data.

This change also removes the now obsolete permission INSTALL_LOCATION_COLLECTOR.

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-05-21 11:28:20 -04:00
Joe Onorato
d2110dbce0 Hook up the backup data writer, and add a utility to read the backup data files. 2009-05-20 11:24:20 -07:00
Android (Google) Code Review
a5ca3425f9 Merge change 2017 into donut
* changes:
  Increment BatteryStatsImpl's VERSION. That'll make it stop trying to interpret older records with the new format. Also applied other comments involving name changes to remove un-needed 'Wifi' labels in WifiManager API, etc.
2009-05-20 09:06:22 -07:00
Jacek Surazski
f5b9c72022 ActivityManagerService sends bug reports on crashes and ANRs
If an installerPackageName was specified when the app was installed,
looks for a receiver of ACTION_APP_ERROR in that package. If found,
this is the bug report receiver and the crash/ANR dialog will get a
"Report" button. If pressed, a bug report will be delivered.
2009-05-20 10:52:04 +02:00
Dianne Hackborn
95fc68f24a Fix issue where apps could prevent the user from going home.
Now we have a 5-second time after home is pressed, during which
only the home app (and the status bar) can switch to another app.
After that time, any start activity requests that occurred will
be executed, to allow things like alarms to be displayed.  Also
if during that time the user launches another app, the pending
starts will be executed without resuming their activities and
the one they started placed at the top and executed.
2009-05-19 18:46:53 -07:00
Robert Greenwalt
58ff0217a6 Increment BatteryStatsImpl's VERSION.
That'll make it stop trying to interpret older records with the new format.
Also applied other comments involving name changes to remove un-needed 'Wifi' labels in WifiManager API, etc.
2009-05-19 15:53:54 -07:00
Mike Lockwood
ac61f6bc2b Telephony: Allow getCellLocation() if client has permission ACCESS_FINE_LOCATION
ACCESS_FINE_LOCATION should imply ACCESS_COARSE_LOCATION, so either of these
permissions should be sufficient to allow TelephonyManager.getCellLocation().

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-05-19 13:53:24 -04:00
Mihai Preda
c3320dbe1c Minor performance improvement when filtering intents by package.
Don't consider the activities that have no intent filters.
2009-05-19 14:15:14 +02:00
Android (Google) Code Review
2f11599eb3 Merge change 1579 into donut
* changes:
  Teleca 2b changes
2009-05-18 22:26:25 -07:00
Wink Saville
e9b06d754a Teleca 2b changes 2009-05-18 21:47:50 -07:00
Android (Google) Code Review
7e4c34329c Merge change 1881 into donut
* changes:
  WifiService: Wifi power management change
2009-05-18 13:17:38 -07:00
Mike Lockwood
d9c32bc838 WifiService: Wifi power management change
Put Wifi into an idle state immediately if the screen is turned off and the Wifi interface has no IP address.
We will continue to keep Wifi up for 15 minutes in the case where the screen is turned off when Wifi is fully connected.
This will allow us to go into a low power mode faster when Wifi is not actively being used.
It also avoids bringing up Wifi if the user just turns on the screen for a few seconds to check the clock, etc.

Fixes bug b/1736920

Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-05-18 15:54:16 -04:00
Suchi Amalapurapu
d1a9337380 Add a new window flag to display a window when keyguard is shown. 2009-05-18 10:47:24 -07:00
Mihai Preda
074edef7c4 remove unused ContentResolver parameter from IntentResolver.queryIntent. 2009-05-18 17:13:31 +02:00
Dianne Hackborn
a96cbb435d Implement compatibility support for WRITE_SDCARD permission.
Now old applications will automatically be granted it.  Also renamed it from
SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions,
and re-arranged how we do targetSdkVersion to actually be usuable for this
kind of stuff.

Note that right now this results in basically all apps being given the
WRITE_SDCARD permission, because their targetSdkVersion is not set.  I will
be dealing with that in a future change.
2009-05-15 18:02:47 -07:00
Mihai Preda
eae850cefe Allow intent resolution to be constrained by package name. 2009-05-15 12:32:07 +02:00
svetoslavganov
75986cf9bc Accessibility feature - framework changes (replacing 698, 699, 700, 701 and merging with the latest Donut) 2009-05-14 23:47:05 -07:00
Android (Google) Code Review
2a5cfe5192 Merge change 1590 into donut
* changes:
  Add wifi multicast filter api (enable/disable). Fixes 1833432.  Automatically re-disables any request when the app exits/crashes.  Also hooked into Battery Stats for power managment analysis.
2009-05-14 13:24:52 -07:00
Android (Google) Code Review
aa642c0cc2 Merge changes 1591,1596 into donut
* changes:
  Add a new feature to android.os.Debug to add the ability to inject only specific fields when calling setFieldsOn().
  Fixes #1836075. Adds consistency checks for the View hierarchy. To enable them, you need a debug build and ViewDebug.sConsistencyCheckEnabled set to true in debug.prop. This change also lets you easily enable drawing and layout profiling in ViewRoot by setting ViewRoot.sProfileDrawing, ViewRoot.sProfileLayout and ViewRoot.sShowFps in debug.prop with a debug build.
2009-05-14 11:59:33 -07:00
Joe Onorato
290bb011c5 Get the backup calling through to the file backup helper.
This includes some cleanup to make the parameters match
between BackupService.onBackup and FileBackupHelper.performBackup.
2009-05-14 09:39:32 -04:00
Dianne Hackborn
b910811136 am 5d6d773: AI 148824: Fix issue #1851541 (sharedUserId requests not bei
Merge commit '5d6d773fab559fdc12e553d60d789f3991ac552c' into donut

* commit '5d6d773fab559fdc12e553d60d789f3991ac552c':
  AI 148824: Fix issue #1851541 (sharedUserId requests not being checked for matching signatures on .apk).
2009-05-13 18:13:17 -07:00
Dianne Hackborn
5d6d773fab AI 148824: Fix issue #1851541 (sharedUserId requests not being checked for matching signatures on .apk).
To address issues where we could leave half-installed applications around if there was a failure during the install, we split getPackageLP() into two phases: the first would create the record, and only after doing all verification checks would we call insertPackageSettingLP() to do the remaining part of the original implementation and actually insert the record into the data structures.
  Unfortunately it was only in insertPackageSettingLP() that we would set the sharedUser field of the PackageSetting structure, so when before that we went to verify certificates, we didn't think it had requested a shared user ID, and let it through without checking.
  This fix simply sets the sharedUser field when the PackageSetting structure is first created, so we will actually check against its certs.  We still also set this again in insertPackageSettingLP(), but there is no harm in this because the only time we call this function is in that big install func, which just passes in the same shared user that it had when first getting the package.
  BUG=1851541

Automated import of CL 148824
2009-05-13 18:09:56 -07:00