45 Commits

Author SHA1 Message Date
Kenny Root
a503a0f5d4 Add explicit mimetype for verifier calls
Change-Id: I29ffb216680aa24fd9ca3fb4d190038f6d724cb9
2011-10-03 14:46:10 -07:00
Kenny Root
05ca4c9064 Allow non-required package verifiers
* Verifiers can be specified in the AndroidManifest.xml

* Those verifiers can respond to the new Intent action

* PackageManager API for those verifiers: verifyPendingInstall

Change-Id: I4892bce2e6984871e6e93c60a1ca0dae145f5df5
2011-09-23 16:03:03 -07:00
Dianne Hackborn
67c5b12511 Merge "Fix issue #5321282: Force Stop Button in Battery Screen Not disabled correctly" 2011-09-23 12:56:42 -07:00
Kenny Root
fec5e75c96 Less verbose message when dexopt non-APK
The message when something is not an APK that is submitted for dexopt is
not extremely helpful. Make it more precise and remove the useless
traceback.

Change-Id: Ibb34b2b2c10ee28ea98662c3f6fd070529cf8c4f
2011-09-23 10:13:06 -07:00
Dianne Hackborn
80a7ac1063 Fix issue #5321282: Force Stop Button in Battery Screen Not disabled correctly
If the app had activities still finishing, when we checked whether it was
now stopped we would get told no.  Also some other improvements:

- Schedule an idle as part of the force stop, to get any finishing
  activities out of the stack soon rather than waiting for some activity
  to idle.
- Don't filter out stopped system apps.  This is dangerous because
  system apps may have no way for the user to explicitly launch them,
  so they could get put into a stopped state for which there is no way
  to get them out.  Also if the user really wants a system app to not
  run, the new disabling mechanism is more appropriate.

Change-Id: I34003f21dac29e2ca0f66a23b88c710de41bab99
2011-09-22 18:32:52 -07:00
Kenny Root
3a9b5fbb97 Unhide new PackageManager APIs for API 14
Change-Id: I83110285ccee39a4cd872a1c2af8357f541833d4
2011-09-20 14:35:10 -07:00
Kenny Root
0aaa0d9317 Add verifier device identity
This adds a special device identifier that is usable only for device
validation. The user will be presented with this number encoded in
easily-transcribable Base32 in the Developer options of Settings.

Change-Id: I4843f55ee90d689a51d0269b22454ca04c1be7ec
2011-09-13 16:02:43 -07:00
Dianne Hackborn
d2509fd835 Add boot mode where only "core apps" are started.
A core app is one that has coreApp="true" in its manifest tag.

The system can successfully boot (though a little painfully) with
only framework-res.apk, SettingsProvider.apk, SystemUI.apk,
DefaultContainerService.apk, and Launcher2.apk set as core apps.

Currently this boot mode is always turned off.

Change-Id: Ieaa4a8031c2c391a12996aa8d8b1d65fc2b09d6b
2011-09-12 12:29:43 -07:00
Dianne Hackborn
ba24e4d8bb Fix issue #5229575: Youtube link shared through messaging is not...
...opening after selecting option "Youtube" as a luncher.

Also:

* Tweak window animations so that the wallpaper exist animations do not
stop too early (causing the wallpaper to suddenly disappear).
* Make sure no input is being processed while booting, to avoid
accidentally doing things especially in the upgrade dialog.
* Some other small cleanup.

Change-Id: I40a6b53731991d4e31ac4502e3d85f0e47507481
2011-09-01 12:39:17 -07:00
Brett Chabot
ae05e8655d Disable package verification by default.
Change-Id: I0e02cd177dbb99fc97e964ac87251a900d915b95
2011-08-24 18:38:26 -07:00
Dianne Hackborn
661cd52e0e Add progress dialog for booting after an upgrade.
This introduces a new facility for code during the boot process
to display messages to the user through a progress dialog.  This
is only for use when performing longer-than-usual post-upgrade
operations such as running dexopt on applications or upgrading
databases.

Change-Id: I0e78439ccec3850fb67872c22f235bf12a158dae
2011-08-22 13:42:05 -07:00
Dianne Hackborn
d99b293d5f Fix issue #5180553: permission RECEIVE_BOOT_COMPLETED is not checked
Change-Id: I069673f2fbdf05e409c5e9ed99ccd1e15b4fe3ed
2011-08-18 16:02:41 -07:00
Kenny Root
46d2545db4 Merge "Infrastructure to support package verifier" 2011-08-16 08:35:53 -07:00
Kenny Root
bcc2d40a11 Merge "Throw exception on odd length Signatures" 2011-08-16 08:34:22 -07:00
Kenny Root
5ab2157bf1 Infrastructure to support package verifier
Allow a package verifier to approve or disapprove of a package being
installed.

Change-Id: Ibfea0f2b1aaa4ab1589a4e59f96144702b9bf94b
2011-08-15 17:26:31 -07:00
Kenny Root
e342551e56 Merge "Better errors from copyResource" 2011-08-11 13:27:10 -07:00
Dianne Hackborn
f9abb40590 New broadcast telling when an app is fully removed.
Change-Id: Ia516d826f302a01881fa92d9ffdc0adfbf669a4b
2011-08-10 17:15:17 -07:00
Kenny Root
f5121a9b80 Better errors from copyResource
Copy resource would fail without a good error code when the file
couldn't be found during copy.

Also destroy the target container ID during move operations since it
might exist. If the copy failed due to it existing, it would get
destroyed anyway. This way the user has a chance to have a good outcome
the first time.

Bug: 3375299
Bug: 5113898
Change-Id: I00559833f0801bc50e7cc031b462495e37a6b4ab
2011-08-10 17:00:30 -07:00
Kenny Root
461ff1f03c Add security checks for new API
Bug: 5137679
Change-Id: Ic0c1e0cf2960a7062ba318b60ee2c92506f6aab6
2011-08-09 11:08:34 -07:00
Dianne Hackborn
7d608423b7 Move OOM kernel settings to activity manager.
The activity manager now take care of plugging the correct settings
into the OOM killer in the kernel.  This is a lot cleaner because
it is really central to how the activity manager works, and nobody
else cares about them.

Taking advantage of this, the activity manager computes what it
thinks are appropriate OOM levels based on the RAM and display
size of the device.

Also a small optization to the package manager to keep a binding
to the package install helper for a bit after done using it, to
avoid thrashing on it.

And some new APIs that are now needed by Settings.

Change-Id: I2b2d379194445d8305bde331c19bde91c8f24751
2011-08-07 20:20:56 -07:00
Kenny Root
1137341885 Throw exception on odd length Signatures
The old version of this code would silently truncate odd-length
Signatures. However, this masks some bugs. Add a throw of
IllegalArgumentException so users can easily see where they're getting
bad input for Signatures.

Also, go through the existing code and catch this exception or
pre-check the input strings so system_server doesn't crash later.

Bug: 5092338
Change-Id: I8c672c5eaeb738a92c4581ce0df09baf719980ef
2011-08-04 11:51:38 -07:00
Kenny Root
1ebd74acf9 Better error codes for missing files
Make sure that files that don't exist aren't returning bogus 'out of
space' error codes.

Add some Javadoc so I can remember what each thing does in an IDE.

Add copyright header to NativeLibraryHelper

Bug: 3375299
Change-Id: Iac46019160921daca65b21d38897e5165063316e
2011-08-03 16:03:42 -07:00
Kenny Root
5832ead89a Parent's canonical path; not parent of canonical
When moving from SD card to internal, the PackageManager should check if
the native library directory parent's canonical path matches the
canonical data directory.

However, it was checking the canonical native library directory's
parent matches the data directory which makes tests concerning moving
from SD card to internal storage fail.

Change-Id: I16420efbb6f52fd6877a8f62ad060f8a1b8b0033
2011-08-02 15:49:39 -07:00
Kenny Root
4f35092af5 Merge "Move extract native libraries to JNI code" 2011-07-27 15:54:51 -07:00
Kenny Root
66269ea6f6 Move extract native libraries to JNI code
The built-in ZipFile class was quite a long time to find an unpack
libraries. Move everything to using the libutils ZipFileRO class that
goes quite a bit faster. Initial measurements are 6 times faster than
the Java code.

Also, read files off the disk and compare their CRC against the APK's
CRC to see if we need to write the new file to disk. This also cuts down
the bootup time by up to a second per APK that has native files.

Change-Id: Ic464a7969a17368fb6a6b81d026888c4136c7603
2011-07-26 10:14:58 -07:00
Kenny Root
9c8625ead8 Change user 0 directory back for compatibility
The PackageManagerTests aren't designed for multiple users yet, so they
fail. Since multiple users aren't supported yet, just change the default
data directory for user 0 back to how it was previously. This fixes the
existing tests and doesn't get anyone's hopes up since they won't see
/data/user/0/pacakge when we don't support multiple users yet.

Bug: 4380006
Change-Id: Iedcc3115b000759c0013ba6878e13cd2358897da
2011-07-25 09:42:22 -07:00
Dianne Hackborn
b8f400020b Fix issue #4999574: Disabled system app not listed in Settings after reboot
Change-Id: I1a0a0724f72adcfa6aedffdcd3112bd4faa909d3
2011-07-19 15:17:43 -07:00
Jeff Brown
5d6d90fac8 Remove more simulator support code.
Bug: 5010576

Change-Id: Ie6c8665306bf4e822693b76f25c3a0f05c12d42d
2011-07-11 13:33:22 -07:00
Jeff Brown
10e8971286 Eliminate single-process mode.
Bug: 5010576

Change-Id: Id450dc83efed4897d1e4ff451530fed14457aace
2011-07-08 19:54:07 -07:00
Brian Carlstrom
f4b92ec567 Revert "Add keychain user with special keystore access permissions"
This reverts commit 8c2a1a90a81f04573bfa578eab32f5fd4a30eafb.

Conflicts:

	cmds/keystore/keystore.c

Bug:4970237
Change-Id: I626023d695becfada47e5f319b18e0889b766563
2011-06-30 22:59:13 -07:00
Dianne Hackborn
292f8bc9d1 Plumb information from the framework about asec container size.
Change-Id: Ie0ec3cb6d463aefa341a8cbea80be790451ba5e3
2011-06-28 15:02:44 -07:00
Dianne Hackborn
0ac3031c15 Implement remaining infrastructure for user disabling apps.
Change-Id: If8135eb0e27ec36f8f159eb7b6397add7acd0299
2011-06-17 14:49:45 -07:00
Kenny Root
a51b6fd6f8 resolved conflicts for merge of b2d0ee16 to master
Change-Id: I4483a6d0ccecfea4a1e66bb6eba80d13e8b9a3a4
2011-05-19 15:02:18 -07:00
Dianne Hackborn
3d0724dc22 resolved conflicts for merge of 0e59729b to master
Change-Id: I2d3a6bddf66b1df0c101c45ea2fec1cf65caf01b
2011-05-12 15:39:41 -07:00
Amith Yamasani
0f3f29b1b9 Use canonical paths to compare library directory with data directory.
Fix for unexpected recursive symbolic link when unpacking
native libraries contained in apks. This happened due to the data
directory of primary user becoming a symlink to the legacy data directory.

Bug: 4396427

Change-Id: Iaed2f21ada4eda16ce729ead259a52203300dfa8
2011-05-10 15:32:18 -07:00
Amith Yamasani
25641ca1ac Merge "Plumbing in PackageManager and installd for multi-user support." 2011-04-19 10:41:20 -07:00
Amith Yamasani
0b285499db Plumbing in PackageManager and installd for multi-user support.
- Create /data/user directory and symlink /data/user/0 -> /data/data for
  backward compatibility
- Create data directories for all packages for new user

- Remove data directories when removing a user

- Create data directories for all users when a package is created

- Clear / Remove data for multiple users

- Fixed a bug in verifying the location of a system app

- pm commands for createUser and removeUser (will be disabled later)

- symlink duplicate lib directories to the original lib directory

Change-Id: Id9fdfcf0e62406a8896aa811314dfc08d5f6ed95
2011-04-15 15:15:27 -07:00
Kenny Root
2e3ede527d Merge "Updated system packages retain shared user" 2011-04-12 15:34:42 -07:00
Amith Yamasani
beb182a494 Merge "Package manager changes to store and update user information." 2011-04-11 12:14:17 -07:00
Amith Yamasani
4b2e934928 Package manager changes to store and update user information.
Some API stubs for managing users and storing their details.
List of users is stored in an xml file.
Each user's properties are stored in a separate xml file.

Some unit tests for modifying the XML files.

Change-Id: If2ce2420723111bd426f6762def3c2afc19a0ae5
2011-04-11 12:12:58 -07:00
Kenny Root
1d1b489376 Updated system packages retain shared user
If a system package was updated that used permissions provided by a
package signed with a different signature, it wouldn't grant
those permissions to the updated system app.

This is because the sharedUser field was not set in the disabled system
package. Therefore it was checking the disabled system package's
individual user permission grants which were empty.

This change populates the sharedUser field for disabled system packages
after reading all the existing shared users from the saved settings
database.

Bug: 4245273
Change-Id: I57c58c4083bd59f45095c184d6ca5a302f79ff6e
2011-04-08 14:25:27 -07:00
Brian Carlstrom
8c2a1a90a8 Add keychain user with special keystore access permissions
Change-Id: I02fe5171add62c5cd9f57b01bc137f3bc1cb3a69
2011-04-08 14:06:39 -07:00
Joe Onorato
63ebffcb84 turn off log spew
Change-Id: I7e5564e02460ff41829c9fd26d80032ea3104498
2011-04-06 11:50:50 -07:00
Kenny Root
447106fc83 Split dump and annotate users of mPackages lock
Split the dump() command between PMS and Settings.

Try to annotate all users of the mPackages lock in preparation for
switch to reader/writer lock.

Also mark some locals final as I was reading through the usage of the
synchronization on mPackages.

Change-Id: Ia7add63e835e67156edf886f98acebe50cc41f70
2011-03-23 17:20:04 -07:00
Kenny Root
cf0b38ca6e Split PackageManagerService into subclasses
Split PackageManagerService from one monolithic class with several inner
classes to several classes. This will help determining how its data
structures can be reshuffled to provide better separation of concerns.

Change-Id: Ic7571daebdcf13ce08e08f34204c5bbf4140139b
2011-03-22 16:17:57 -07:00