164 Commits

Author SHA1 Message Date
Dianne Hackborn
8313fc7e94 Allow all apps to call ContentResolver.getType().
I can't find the bug number for this, but it is needed for some things
we are doing where the app building an intent may not have access to the
URI in the data field.  This is for HC, but doing in GB to avoid introducing
integration issues.

Change-Id: I0cac971854198b18775d2a73deb80f23431bfbe2
2010-09-26 21:31:47 -07:00
Dianne Hackborn
361199b5e7 Add PackageManager API to get information about a provider component.
Kind-of useful when all you have is a ComponentName.

Change-Id: I9a99f12daabb29e97e882e09c43ca0df70c00651
2010-08-31 18:59:04 -07:00
Brian Carlstrom
3c7c351a62 Tracking merge of dalvik-dev to gingerbread
git cherry-pick --no-commit f77cf7f0
git cherry-pick --no-commit c8f503b5285e30c1a881d0ba860ba9021f57d113
git cherry-pick --no-commit 570bb561
git cherry-pick --no-commit e2417541
git cherry-pick --no-commit e4d81f25bd4dc1a5c909b56ab56a56406290da30
git cherry-pick --no-commit 5e8a587d

Change-Id: I101a385d43f3e0f4ce5352217f92ef67a3908c88
2010-08-04 23:47:38 -07:00
Joe Malin
d93f4e5b70 Merge "DO NOT MERGE Doc Change: Javadoc for test case classes" into gingerbread 2010-07-13 09:46:38 -07:00
Brett Chabot
f6120cf431 Merge "Improve InstrumentationTestRunner exception handling." into gingerbread 2010-07-08 14:09:21 -07:00
Brett Chabot
31e7ce762c Improve InstrumentationTestRunner exception handling.
This commit fixes two somewhat related problems:
  - Attempting to run a method which does not exist caused a runtime
exception which stopped the test run. Change this so the runner reports
an individual test failure instead
  - A runtime exception during the test run would cause it to stop
completely, with no information dumped to the logcat or stdout. Now
exceptions are trapped and reported to stdout.

Also added associated unit tests to test these two conditions.

Related bug 2812262.

Change-Id: I383f9b9bad99f14cb51071800fa9bdbf6a6a1119
2010-07-07 17:33:22 -07:00
Kenny Root
93565c4b32 OBB API for PackageManager
Simple API for tracking .obb files associated with packages. Stores the
path in the PackageSettings. No verification of file content is done
now since the PackageManagerService can't read the SD card where these
files will likely live.

Change-Id: Ibeaf26ba0526b6d60f401137e58f46ee9faff39e
2010-07-07 09:57:51 -07:00
Joe Malin
87e98cda1c DO NOT MERGE Doc Change: Javadoc for test case classes
Change-Id: I21b78a84ee1345a98631dcaab937a10b4fa4344d

Original change was SHA1 7d433aabb731a790fc8d06d260c826751215113f
2010-07-02 17:52:37 -07:00
Evan Millar
25f3ab4ee7 Manual merge of change 53051 from master (DO NOT MERGE)
Change-Id: Ia4697a15cb874f25849655994e10aa88ae60b328
2010-06-18 16:19:26 -07:00
Adam Powell
81cd2e90cc Logo attribute for manifest and PackageManager methods to fetch it
Change-Id: I2c5ac44a4e2af982a616b2012901d7395013b19f
2010-04-23 15:49:07 -07:00
Dianne Hackborn
d7c096845d Package manager optimizations.
Addresses:
Issue #2550648: PackageManagerService setComponentEnabledSetting unconditionally
writes Settings xml
Issue #2549084: Make PackageManager.addPermission have async version

Also make the writing of settings when changing the preferred activities to use
the same async mechanism, and fiddle with thread priorities in the background
thread to go up to foreground priority when holding the lock to write settings
and a few other places.  (At some point we should really clean this up to never
acquire the main lock while in the background.)

Change-Id: Ib2b7632543f6fb3f92a225518579f3b2d15e1413
2010-03-30 13:34:43 -07:00
Brett Chabot
89c0ef4aba Add -e package description to InstrumentationTestRunner javadoc.
Bug 2528316

Change-Id: Ic707115e40a18521e0d57ee12f43df96be7033f2
2010-03-19 11:40:50 -07:00
Kenny Root
10362ab9d6 Add missing license notices on test classes
Change number and file origin info

34691-p9 frameworks/base/test-runner/src/android/test/ProviderTestCase2.java
48099-p9 frameworks/base/test-runner/src/android/test/RenamingDelegatingContext.java
40550-p9 frameworks/base/test-runner/src/android/test/BundlePrinter.java
87783-p9 frameworks/base/test-runner/src/android/test/IsolatedContext.java
34691-p9 frameworks/base/test-runner/src/android/test/ProviderTestCase.java

Change-Id: I1fea36db24e73f91ffdf43b84ff73be55478b53a
2010-03-12 11:14:55 -08:00
Brad Fitzpatrick
1877d0158b Add "call" method on ContentProvider.
This permits implementing interfaces which are faster than using
remote Cursors.  It then uses it for Settings & SettingProvider, which
together account for ~50% of total ContentProvider event loop stalls
across Froyo dogfooders.

For fetching Settings this looks like it should reduce average
Settings lookup from 10 ms to 0.4 ms on Sholes, once the
SettingsProvider serves most gets from in-memory cache.  Currently it
brings the Sholes average down from 10ms to 2.5 ms while still using
SQLite queries on each get.
2010-03-05 12:08:39 -08:00
Paul Westbrook
69120a73d0 Bug 2306842
Since MockAccountManager was passing null to the AccountManager
constructor, unit tests where the AccountManager attempts to call
the AccountManagerService were crashing.

Now the getAccountsByTypeAndFeatures and blockingGetAuthToken
(which are the calls that the Gmail unit tests call) call a small
stub

At some point, all of the other AccountManager calls should be stubbed
out
2010-02-26 18:24:29 -08:00
Doug Zongker
0375fa12c7 fix error in javadoc
The "@link LargeTest" is broken since it doesn't know where that class is.

Change-Id: Ie15e40bac8a1965427e351926b2208775e79cb13
2010-02-23 12:36:06 -08:00
Brett Chabot
88e03a9736 Add ability to run tests restricted to given annotation.
And ability to exclude tests with given annotation.

Also fix class cast compile warning in emma output method.

Bug 2239240

Change-Id: I56273a51a8c58a690680bdb612615fab69e6e13f
2010-02-22 18:08:35 -08:00
Brett Chabot
08d13c3cbb Fix code coverage output message when running tests in non-raw mode.
Bug 2082804
2010-02-20 18:38:30 -08:00
Brett Chabot
e70f61b116 Retry test-runner tests move.
This time change the frameworks makefile so it only includes test-runner/src
in the public API.
2010-02-20 17:29:05 -08:00
Suchi Amalapurapu
8946dd3355 Move package from internal to external and vice versa. 2010-02-19 14:20:54 -08:00
Suchi Amalapurapu
642b7c0f19 Merge "Include install location preference when installing packages. Changes include Add new remote call in default container service to determine install location. Rename INSTALL_ON_SDCARD Remove recommentAppInstall method Add some additional flags used in remote stubs. Move check for protected apps prior to copy. Unit tests" 2010-02-16 09:23:51 -08:00
Suchi Amalapurapu
5b993ce7bc Include install location preference when installing packages.
Changes include
Add new remote call in default container service to determine
install location.
Rename INSTALL_ON_SDCARD
Remove recommentAppInstall method
Add some additional flags used in remote stubs.
Move check for protected apps prior to copy.
Unit tests

DefaultContainerService first parses the file uri(if content uri is specified
it returns a default install internal only value) and returns
a recommended location. Based on which the temporary id is determined
either a file name or a container id and the file is copied there.
This is then later renamed during install.
Todo's light weight parsing of package when determining location since we
just need the install location attribute only when finding out
recomended location. This will also enable to move the check for
updated system apps(cannot be on sdcard) prior to copying.
2010-02-12 18:50:47 -08:00
Brett Chabot
90762d35a9 Modify ActivityInstrumentationTestCase2 to not require hardcoded package name.
Deprecate old constructor.

Bug 2440167
2010-02-12 11:09:26 -08:00
Dianne Hackborn
470969346d Add APIs for mapping between new and current package names.
This will allow Market and others to find out what the "real" name
of a package is, when it is currently running under the old name of
a previously installed version.
2010-02-11 20:02:20 -08:00
Paul Westbrook
1048108f1f Fix some Gmail tests
The SSLSessionCache attempts to create a directory through the context
In MockContext, this throws an UnsupportedOperationExcetion

This CL changes MockContext2 in ProviderTestCase2 to allow getDir
to be called, but the directory is named so it will be seperated from
a directory created by a regular context
2010-02-11 14:09:10 -08:00
Suchi Amalapurapu
117818e4f1 Add new manifest option for install location
Change recommendAppInstallLocation api
add code to parse new attribute.
Define flags in PackageInfo
Add new settings attributes for enabling setting and value for install location
Some tests
The policy for install location: if explicitly set in manifest as internal only we try to install the app only on internal storage. if set to preferExternal, we try to install it on sdcard if possible. If not we fall back to internal.
If the user enables setting SET_INSTALL_LOCATION(which will always
be set to false in final release builds) and sets a prefered location, we try
to honour it.
2010-02-10 08:59:08 -08:00
Mike Lockwood
d03ff94fe5 Clean up interface between LocationManagerService and the location providers:
LocationManagerService now uses new Java interface LocationProviderInterface
rather than LocationProviderProxy to refer to location providers internally.

LocationProviderProxy and the ILocationProvider binder interface are only
used for location providers implemented as services (NetworkLocationProvider)

Built-in location providers (GpsLocationProvider and mock providers) now just
implement LocationProviderInterface rather than using a Binder interface and proxy object.

Delete obsolete and unused TestLocationProvider class.

Change-Id: Id800e7c1864f7c666f8e37125c05896493b9c8c4
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-02-10 09:41:25 -05:00
Dianne Hackborn
e83cefcef0 New external storage APIs.
This implements the spec for external storage organization, and
properly reflects how the media scanner organizes the files it finds.

Also includes package manager support for removing app private
files from external storage when the application is uninstalled.

For the new APIs and paths, the main place to look is Environment
and Context.
2010-02-09 14:20:55 -08:00
Fred Quintana
53bd2522ca - change the SyncManager to retry MANUAL syncs that encounter a soft error
- make the sync dump handle the case where there are no accounts
- fix a bug that caused the SyncManager to burn up CPU in the system process

The following was implemented:

scheduler offers:
 - settings to disable sync
 - retries of certain errors
 - backoffs

want a way to control these when scheduling a sync
 - "ignore_settings"
 - "ignore initial backoff"
 - "manual" : ignore settings, ignore initial backoff
 - "do not retry"

- need to change the default behavior of not retrying manual syncs to retry regardless
2010-02-08 16:54:43 -08:00
The Android Open Source Project
5d36c46d2d am ad9bcb22: merge from open-source master
Merge commit 'ad9bcb22d05fbf130ac64254abd51a137e9a3d3f'

* commit 'ad9bcb22d05fbf130ac64254abd51a137e9a3d3f':
  Fix x coordinate of the ACTION_UP event in TouchUtils.drag() method
  Fixed Android animation framework, for using interpolators that do not start at 0.0f
  Fix for GPS engines without separate session and engine status events.
  Be tolerant of GPS session and engine on status messages arriving out of order.
  GpsLocationProvider: Do not release wakelock until the GPS engine is fully off
2010-02-08 09:17:10 -08:00
The Android Open Source Project
ad9bcb22d0 merge from open-source master 2010-02-05 13:55:16 -08:00
Marc Capdevielle
8621cfa43f Fix x coordinate of the ACTION_UP event in TouchUtils.drag() method
The ACTION_UP event was fired at the "fromX" position instead of being
fired at the "toX" position which is the current value of local var "x".

This bug had no real impact as the VelocityTracker always ignores the last
MotionEvent when it received more than 3 events...
2010-02-05 19:28:23 +01:00
Oscar Montemayor
539d3c475f Apps on SD card project.
Refactored recommendAppInstallLocation(..) method in PackageManager by making it an instance method.
Since PackageManager has only abstarct instance methods, moved implementation to ApplicationContext.ApplicationPackageManager class, in line with the rest of the method
implementations. Tah way, chage is consistent with best coding practices.
Also MockPackageManager received the additional method.
2010-01-29 15:28:42 -08:00
Fred Quintana
717f0eb34b am 029074ff: fix build
Merge commit '029074ff0fca198676997c7453cfffa932361081' into eclair-mr2-plus-aosp

* commit '029074ff0fca198676997c7453cfffa932361081':
  fix build
2009-12-10 10:45:22 -08:00
Fred Quintana
f99e2e042d am 563bfade: fix a build breakage
Merge commit '563bfade6601f3410681b3cd8b069ed22af5b048' into eclair-mr2-plus-aosp

* commit '563bfade6601f3410681b3cd8b069ed22af5b048':
  fix a build breakage
2009-12-10 10:43:58 -08:00
Daisuke Miyakawa
8ad6ec2eb4 am 8280c2b1: Implement new MockContentProvider. Also make ContentProvider aware of the class.
Merge commit '8280c2b15f6875b2d387c05df23d264864eb9cd5' into eclair-mr2-plus-aosp

* commit '8280c2b15f6875b2d387c05df23d264864eb9cd5':
  Implement new MockContentProvider. Also make ContentProvider aware of the class.
2009-12-04 00:53:53 -08:00
Daisuke Miyakawa
8280c2b15f Implement new MockContentProvider. Also make ContentProvider aware of the class.
Rename the old MockContentProvider to MockIContentProvider since it is
more appropriate name.

Detail:
Current developers inevitably depend on the backend used by ContentProvider,
which is useful but not ideal nor "testable" from the view of them.

Current MockContentResolver only accepts exact "ContentProvider" class, not
IContentProvider interface, since we want to hide "IContentProvider" while
the old MockContentProvider implements IContentProvider and as a result some
methods we want to hide may be exposed to the public SDK now and probably
for the future.

On the other hand, ContentProvider is not interface but an exact class
heavily depends on the internal logic and not suitable for external
developers to use for tests.

The new MockContentProvider introduces the mock implementation
for ContentProvider.
It extends ContentProvider, so "is" ContentProvider, but tries to avoid
depending on any backend System like IPC in Android, etc.
This should be useful from the view of application developers who do not
want to be confused with ContentProvider/ContentResolver backend
implementation "at all" and want to use MockContentResolver without
any other ContentProvider implementations tightly connected to the
external worlds.
2009-12-04 17:48:44 +09:00
Jack Wang
e5fa335b0d am 6e045e0a: am e0cadd7c: Merge change Iffbb6e55 into eclair
Merge commit '6e045e0aa1b465e9e989d3058a5d2fa13dcf026b' into eclair-mr2-plus-aosp

* commit '6e045e0aa1b465e9e989d3058a5d2fa13dcf026b':
  Make perf metrics collection & output via instrumentation simpler
2009-11-16 15:29:15 -08:00
Jack Wang
6e045e0aa1 am e0cadd7c: Merge change Iffbb6e55 into eclair
Merge commit 'e0cadd7cd811a674df62279dec00d17678b2c501' into eclair-mr2

* commit 'e0cadd7cd811a674df62279dec00d17678b2c501':
  Make perf metrics collection & output via instrumentation simpler
2009-11-16 15:25:06 -08:00
Jack Wang
2c13b9d155 am e0cadd7c: Merge change Iffbb6e55 into eclair
Merge commit 'e0cadd7cd811a674df62279dec00d17678b2c501' into eclair-plus-aosp

* commit 'e0cadd7cd811a674df62279dec00d17678b2c501':
  Make perf metrics collection & output via instrumentation simpler
2009-11-16 15:25:01 -08:00
Jean-Baptiste Queru
478de466ce merge from eclair 2009-11-15 12:06:23 -08:00
Jean-Baptiste Queru
9db3d07b96 eclair snapshot 2009-11-13 13:53:39 -08:00
Jack Wang
4f414bd7a7 Make perf metrics collection & output via instrumentation simpler
- Added includeDetailedStats metadata to TimedTest for collecting additional
  metrics like memory usage and binder transactions
- Added PerformanceCollectorTestCase interface for hard-typing test class as
  performance test while still able to inherit from instrumenation test classes
- Reverted previous changes to PerformanceTestBase, will deprecate
  PerformanceTestBase/Case in a future CL
- Removed 'performance.' prefix from keys written to instrumentation output
2009-11-10 19:26:14 -08:00
Jack Wang
af93c05c9a am 227ba207: am e8228afb: Merge change I92cdc5ed into eclair
Merge commit '227ba2072df1474a0b3abaae7c415f152d32bcc2' into eclair-mr2-plus-aosp

* commit '227ba2072df1474a0b3abaae7c415f152d32bcc2':
  PerformanceCollector: Collect & report perf measurements in key/value form
2009-10-30 18:41:08 -07:00
Jack Wang
227ba2072d am e8228afb: Merge change I92cdc5ed into eclair
Merge commit 'e8228afb2bd005ae25ce58719f9d678389b26a16' into eclair-mr2

* commit 'e8228afb2bd005ae25ce58719f9d678389b26a16':
  PerformanceCollector: Collect & report perf measurements in key/value form
2009-10-30 17:07:56 -07:00
Jack Wang
1d225d67d9 am e8228afb: Merge change I92cdc5ed into eclair
Merge commit 'e8228afb2bd005ae25ce58719f9d678389b26a16' into eclair-plus-aosp

* commit 'e8228afb2bd005ae25ce58719f9d678389b26a16':
  PerformanceCollector: Collect & report perf measurements in key/value form
2009-10-30 17:07:21 -07:00
Jack Wang
075997f12e PerformanceCollector: Collect & report perf measurements in key/value form
- Added new functions to PerformanceCollector and PerformanceResultsWriter
- Modified unit tests to test new functionality and fix flakiness reported in
  2218327 and 2118268
- Added PerformanceCollectorTest to small suite
2009-10-28 14:32:05 -07:00
Daisuke Miyakawa
ae27c57664 am 54616f34: Make MockCursor class a part of public SDK.
Merge commit '54616f3435e67029006d2f77462c61ed0635a3f6' into eclair-mr2-plus-aosp

* commit '54616f3435e67029006d2f77462c61ed0635a3f6':
  Make MockCursor class a part of public SDK.
2009-10-21 16:10:24 -07:00
Daisuke Miyakawa
54616f3435 Make MockCursor class a part of public SDK.
With this class, external developers will be able to reduce their
redundant work related to testing around ContentProvider/ContentResolver.

Internal Issue number: 2181010
2009-10-22 07:25:02 +09:00
Mike Lockwood
a4f6c96f1a am 348b92bd: Merge change Iee227ace into eclair
Merge commit '348b92bd513087369ac682e29620d7829fa1381b' into eclair-plus-aosp

* commit '348b92bd513087369ac682e29620d7829fa1381b':
  GPS: Fix problem with SUPL when SUPL APN is already active.
2009-10-08 15:10:25 -07:00