1103 Commits

Author SHA1 Message Date
Jeff Sharkey
846318a325 Allow prefix-based Uri permission grants.
Define new FLAG_GRANT_PREFIX_URI_PERMISSION which indicates that a
Uri permission grant should also apply to any other Uris that have
matching scheme, authority, and path segments.  For example, a prefix
grant for /foo/ would allow /foo/bar/ but not /foo2/.

Allow persistable and prefix grants to be issued directly through
grantUriPermission().  Relaxing persistable is fine, since it still
requires the receiver to actively take the permission.

Since exact- and prefix-match grants for the same Uri can coexist,
we track them separately using a new UriGrant key.  (Consider the
case where an app separately extends READ|PREFIX and WRITE for
the same Uri: we can't let that become READ|WRITE|PREFIX.)

Fix revoke to always take away persisted permissions.  Move prefix
matching logic to Uri and add tests.  Add new flags to "am" tool, and
various internal uses around Intent and Context.  Switch some lagging
users to ArraySet.

Bug: 10607375
Change-Id: Ia8ce2b88421ff9f2fe5a979a27a026fc445d46f1
2014-04-22 21:06:49 -07:00
Guang Zhu
bc3c1ad960 am 65bcc3ff: am 6c0454ec: Merge "add bt instrumentation to run as a util" into klp-modular-dev
* commit '65bcc3ff9212514a000ccdcc4d8295ddaedcef92':
  add bt instrumentation to run as a util
2014-04-22 13:33:13 +00:00
Guang Zhu
65bcc3ff92 am 6c0454ec: Merge "add bt instrumentation to run as a util" into klp-modular-dev
* commit '6c0454ecae4fe46b7032299d02fc6da80f171ed2':
  add bt instrumentation to run as a util
2014-04-22 13:27:56 +00:00
Guang Zhu
03800b8873 add bt instrumentation to run as a util
some bt test util methods are useful as device setup util, this
change exposes some of them via a BluetoothInstrumentation so
that they can be invoked like commands for setting up or
controlling bt state in test harness

Change-Id: I1d40baf374e145ab550ae4fa5f581e2eaf2e29bb
2014-04-21 19:06:17 -07:00
Jeff Davidson
6a4b220f12 Initial implementation of NetworkScoreManager's backing service.
This service will ultimately be responsible for propagating scores
down to lower-level network subsystems. For now, it just keeps scores
in memory and exposes these for debugging purposes via "adb shell
dumpsys network_score".

This change also adds provisioning of a default scorer. When
NetworkScoreService is first initialized, it checks to see if it has
ever set a default scorer; if not, it reads a package name from a
build config property and attempts to set it as the default.

Also add autogenerated equals/hashCode methods to all parcelables.

Bug: 14111427
Bug: 13786258
Change-Id: I02271171653d42e12acd240b73b9e23950744f6b
2014-04-21 16:04:05 -07:00
Jeff Davidson
dd6fd1e62b Class for managing the active scorer application.
Allows listing all possible scorer apps, getting the active scorer
app, setting the active scorer app, and determining whether a given
UID is for the active scorer.

Note that setting a default scorer with a system image will be handled
separately - the plan here is to add a read-only build property
containing a package name to use as the scorer out of the box.
When NetworkScorerService is initialized, it will check a provisioning
bit; if that bit isn't set, it will set the current scorer to the
package specified in this build property (if any) and set the
provisioning bit to true.

Bug: 13769362
Change-Id: I18c0b2ba2aceccc88b70c3611a49149e0bf17ecf
2014-04-16 14:17:01 -07:00
Jeff Davidson
dc960e21ef Data structures for communication with network scorer apps.
NetworkKey represents the necessary information to identify a network
to be scored. ScoredNetwork contains the key to identify a network as
well as a score to be used when evaluating that network (as a curve
based on RSSI).

Bug: 13767776
Change-Id: I6bfebd105c9381e615513167b4332b767b43a23a
2014-04-16 11:28:51 -07:00
Jorim Jaggi
d274c46432 Fix ugly black background when expanding/collapsing notifications.
Bug: 13635952
Change-Id: I7a0f434172db4583f904e6817d94ca12d3b117bc
2014-04-11 16:07:44 +02:00
Yohann Roussel
900224afc2 Merge "A stress test for concurent multidex extraction." 2014-04-09 09:49:58 +00:00
Jaewan Kim
baa00cc350 Merge "Revert "Refactor IpConfiguration from WifiConfiguration"" 2014-04-07 09:01:43 +00:00
Jaewan Kim
6789797485 Revert "Refactor IpConfiguration from WifiConfiguration"
This reverts commit 1284767ceb1affa6d5af77fd26ccf7322df48a6d.

Change-Id: Ibccea84e5dc44c1b8954779660e0721b27f762d4
2014-04-07 09:01:24 +00:00
Jaewan Kim
ce245e1c65 Merge "Refactor IpConfiguration from WifiConfiguration" 2014-04-07 04:40:45 +00:00
Jaewan Kim
1284767ceb Refactor IpConfiguration from WifiConfiguration
Bug: 7606609, Bug: 8687763
Change-Id: I736eb3c73a8ffc8f137a04a5ea66ee564dc2b530
2014-04-07 11:35:35 +09:00
Maxim Siniavine
962e12883b DownloadManager test will wait until certain progress, is made
during download before moving to next stage of the test.

Increase the timeout for waiting for download to complete.

Change-Id: I61820a9525256f4f2e16571e1ac075d2f5268cae
2014-04-03 19:46:51 -07:00
Yohann Roussel
3aac33e726 A stress test for concurent multidex extraction.
Change-Id: Iab2427a8867a2a7a9a12e2557b2e970430fa6356
2014-04-02 18:50:31 +02:00
Christopher Tate
f1977b4500 Expand install observer semantics
...and now fail conservatively when two apps both attempt to define
the same permission.  Apps signed with the same certificate are
permitted to redefine permissions.

We also finally have a (hidden) interface class for observing package
installation so that we can now rev the interface without breaking
existing callers.

Bug 13551375

Change-Id: Ifa4e59154dcccbb286ee46a35a6f25e4ad0f0f01
2014-03-27 12:37:47 -07:00
Glenn Kasten
1ee4eb074c Merge "Revert "Expand install observer semantics"" 2014-03-26 20:00:11 +00:00
Glenn Kasten
7629a18a3f Revert "Expand install observer semantics"
This reverts commit ab8a501f255b272af887acb0e66eb71cdf24c755.

Change-Id: I4ab4ae1a96efa2adf9d5a513793d8b84eef38b4e
2014-03-26 19:59:48 +00:00
Christopher Tate
9067dc03ff Merge "Expand install observer semantics" 2014-03-26 19:24:09 +00:00
Christopher Tate
ab8a501f25 Expand install observer semantics
...and now fail conservatively when two apps both attempt to define
the same permission.

We also finally have a (hidden) interface class for observing package
installation so that we can now rev the interface without breaking
existing callers.

Bug 13551375

Change-Id: I3a286d024a30e812ee4b098f345401df3c00e178
2014-03-25 19:28:54 -07:00
Yohann Roussel
185a7e38bc Add one test application for multidex.
This application is intended to be run by
SupportMultidexHostTest.

Change-Id: Icace956cd68e03735fd8c73f877d911f01098f54
2014-03-24 11:28:31 +01:00
Xia Wang
454fc6b118 am 560e7541: am 1b007565: am 9b650702: Merge "Fix state transition verification." into klp-dev
* commit '560e75417252b502a41967aa4d819a029361e384':
  Fix state transition verification.
2014-03-18 22:34:17 +00:00
Xia Wang
560e754172 am 1b007565: am 9b650702: Merge "Fix state transition verification." into klp-dev
* commit '1b007565c73097728496f3dbe811a51c879ba89e':
  Fix state transition verification.
2014-03-18 22:22:37 +00:00
Xia Wang
01f03b50fb Fix state transition verification.
When there is connectivity state change, the network states could be broadcasted multiple times.
The state transition should consider that.

Bug: 13277256
Change-Id: I3d400900a0e2454f9d198629f1c062cbb15bdcd8
(cherry picked from commit 71aae0b6fd1bb9204b81c2e9447f3544c29579c4)
2014-03-18 18:23:05 +00:00
Jeff Sharkey
432f755d44 am ac0f9ffd: am da07fe64: am eeb36c5c: am d88d8174: Merge "Null pointer exception in FileRotator.java"
* commit 'ac0f9ffda2a7e48d2d641654dafd11b8da39830a':
  Null pointer exception in FileRotator.java
2014-03-17 17:57:13 +00:00
Mikael Gullstrand
bbf1861fdd Null pointer exception in FileRotator.java
Sometimes a null pointer exception is thrown when examining files
managed by the file rotator.

The logs from the test show that the Wifi state is changed a large
number of times. On every state change, a write operation is
initiated on the file system. This will eventually result in out
of memory and the call to mBasePath.list() in the maybeRotate(...)
method in FileRotator.java will return null so the iteration will
throw a NullPointerException.

Change-Id: I5d5980d9593bc9ec75281169ca27ee591809903f
2014-03-13 17:25:01 +01:00
Maxim Siniavine
a305d7229f Fixes for download manager test.
When checking that the download is in progress, check the number number
of bytes downloaded as reported by download manager, rather than looking at the file size.

When waiting for the download to complete rely on the received broadcast.

Bug: 13326931

Change-Id: I4c2431dd71e17602e758bc482be185683040ea98
2014-03-12 18:22:02 -07:00
Xia Wang
6bed599aa7 Merge "Fix state transition verification." 2014-03-08 00:15:53 +00:00
Xia Wang
71aae0b6fd Fix state transition verification.
When there is connectivity state change, the network states could be broadcasted multiple times.
The state transition should consider that.

Bug: 13277256
Change-Id: I3d400900a0e2454f9d198629f1c062cbb15bdcd8
2014-03-06 16:09:05 -08:00
Yohei Yukawa
f06569561f Introduce InputMethodSubtypeArray for memory efficient IPCs
This CL introduces InputMethodSubtypeArray which compresses
multiple instances of InputMethodSubtype to reduce the risk
of TransactionTooLargeException during IPCs.

There are some IMEs which rapidly adding new subtypes into
their supported language list. One problem here is that each
instance of InputMethodInfo internally owns the list of
supported subtypes. Basically it requires additional
200 ~ 300 bytes for each subtype when InputMethodInfo is
transffered via IPCs. We should keep the size less than
100 KB in typical scenario.

With this CL, the list of InputMethodSubtype is marshalled
with GZIP compression. Approximately one InputMethodInfo is
marshalled within 10 KB even when it has 100 subtypes.

No negative performance impact is observed so far. The cost of
decompression seems to be compensated by another optimization
in this CL. Actually marshalling cost is reduced with this CL
by caching the compressed data on demand.

BUG: 12954290
Change-Id: Ibb2940fcc02f3b3b51ba6bbe127d646fd7de7c45
2014-03-06 11:25:57 +09:00
Xia Wang
0df3cdbc81 Merge "Add timer to wait for screen off" 2014-03-04 00:51:37 +00:00
Xia Wang
df362d264c Add timer to wait for screen off
bug#: 13278052

Change-Id: Ic4dc847f3f3fe86750343ffabedb13dbeb4f61a7
2014-03-03 15:39:46 -08:00
Yohei Yukawa
c18cd393f6 Make sure InputMethodInfo implements Parcelable transitively
This CL adds one more test to make sure InputMethodInfo
implements Parcelable correctly. This test makes sure that
one can marshall and unmarshall again from an unmarshalled
copy of InputMethodInfo.

BUG: 12954290
Change-Id: I5aa1552a8089fe0bac54513ba224e5bfc494be97
2014-03-03 14:14:10 +09:00
Yohei Yukawa
589800485d Add unit test for InputMethodInfo
This CL adds a unit test to make sure that InputMethodInfo
implements Parcelable correctly.

BUG: 12954290
Change-Id: I0abe8c266b4b035bf8ef4688d11069b355fabe9f
2014-02-27 17:32:48 +09:00
Yohann Roussel
1ec1370a5d Merge "Add support.multidex tests app for an update bug." 2014-02-26 16:23:34 +00:00
Yohann Roussel
05e2a94c8b Add support.multidex tests app for an update bug.
The failing scenario is
- install v1
- run
- update to v2
- update to v3
- run
last run was failing with initial multidex library versions because
it's still running on v1 extracted secondary dex files.

Change-Id: Id9811371fc70b0a4e9b49de913ee38d18699b21d
2014-02-26 17:02:13 +01:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
Narayan Kamath
b2e0733fe6 am 94b7c749: am 37e6af75: am 92a09fbd: am a14d9c31: Merge "Move Json{Reader,Writer} test to cts."
* commit '94b7c749fd0bc5bbd80dbabfd412c2a212584343':
  Move Json{Reader,Writer} test to cts.
2014-02-17 18:32:44 +00:00
Narayan Kamath
94ccb6bf95 Move Json{Reader,Writer} test to cts.
These tests aren't really run automatically (or perhaps
even manually) in their present location, and increasing
CTS coverage is never a bad thing.

Change-Id: I81cce1211021011dca551fde62e725e177ca4df0
2014-02-17 17:51:43 +00:00
Dianne Hackborn
f75f6e323c am 32acb5e9: am 97de064a: am 133f6826: am 89492190: Merge "Runtime resource overlay, iteration 2, test cases"
* commit '32acb5e9d130ac858f34d83526e7460c624b41c7':
  Runtime resource overlay, iteration 2, test cases
2014-02-12 23:01:30 +00:00
Jeff Sharkey
ebf8ad5d91 Update DrmOutputStream to use raw FileDescriptor.
This allows DownloadManager to use FDs, paving the way for downloading
directly to content:// Uris.

Also return flag indicating if deleteOlderFiles() actually deleted
anything.  Update tests to verify.

Bug: 5287571
Change-Id: I2579e5e2113f31b2860d7b021bd61c91b6310963
2014-02-06 09:47:38 -08:00
Maxim Siniavine
b15c0e512c Using large file for download manager test.
This should decrease the chance of the file being downloaded too quickly and
confusing the test.

Change-Id: I8f4debbb51798162493d6a8005e1aa142738dbd4
2014-02-04 18:19:08 -08:00
Mårten Kongstad
ad6ed950db Runtime resource overlay, iteration 2, test cases
Add automated test cases for runtime resource overlay, iteration 2.

The test cases are a mixture of 'adb shell' commands and regular
instrumentation tests. The device is rebooted between tests to setup
different overlay scenarios for framework-res.apk.

To verify Runtime resoure overlay, iteration 2, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py

For a list of supported options, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py --help

Change-Id: I692aa1a7ad073efd116b24f9ec7f197dfd65dfef
2014-02-03 11:20:33 +01:00
Jeff Sharkey
4ca728c064 Detect removable and emulated secondary storage.
Also rename existing secondary storage API to match naming
convention in rest of class.

Bug: 11536709
Change-Id: I2684c817de4982b414893d2d9927a21e3f171d53
2014-01-15 17:00:56 -08:00
Narayan Kamath
98fcf484ef am d2098682: am 3f2843a4: am c47b7d37: am 9d4ebdca: am cf1aa551: Merge "XmlUtils#readThisMapXml should handle null keys."
* commit 'd2098682ab269d311dd482a38e8557df6717ee17':
  XmlUtils#readThisMapXml should handle null keys.
2014-01-07 10:17:04 +00:00
Narayan Kamath
f748257eee XmlUtils#readThisMapXml should handle null keys.
Both readThisValueXml & writeThisValueXml have been
implemented to handle values with "null" names.

Change readThisMapXml to allow such names as well, and
map them to the null key in the resulting HashMap.
readThisListXml and readThisSetXml already support
null names.

bug: https://code.google.com/p/android/issues/detail?id=63463

Change-Id: I1c93976656e45e7733113eb67d29b6bad5d25f1f
2014-01-06 11:18:21 +00:00
Lorenzo Colitti
4598ea4e5e am 263c4788: am 30253d7a: am 2daa0c93: Merge "Add address flags and scope to LinkAddress."
* commit '263c4788dcf45f104f8668fd6621d1a7c39689b9':
  Add address flags and scope to LinkAddress.
2013-12-09 18:34:44 +00:00
Lorenzo Colitti
2daa0c93c4 Merge "Add address flags and scope to LinkAddress." 2013-12-07 02:43:04 +00:00
Lorenzo Colitti
64483947fd Add address flags and scope to LinkAddress.
This is necessary so that the framework can know whether an IPv6
address is likely to be usable (i.e., if it's global scope and
preferred). Also, it will simplify the address notification
methods in INetworkManagementEventObserver, which currently take
the address, the flags, and the scope as separate arguments.

1. Add flags and scope to the class and update the unit test.
   Use the IFA_F_* and RT_SCOPE_* constants defined by libcore.
   Since most callers don't know about flags and scope, provide
   constructors that default the flags to zero and determine the
   scope from the address. Addresses notified by the kernel will
   have these properly set. Make multicast addresses invalid.
   Update the class documentation.
2. Provide an isSameAddressAs() method that compares only the
   address and prefix information between two LinkAddress
   objects. This is necessary because an interface can't have
   two addresses with the same address/prefix but different
   flags.
3. Update LinkProperties's addLinkAddress and removeLinkAddress
   to identify existing addresses to add/remove using
   isSameAddressAs instead of implicit equals(). Specifically:
   - If addLinkAddress is called with an address that is already
     present, the existing address's flags and scope are updated.
     This allows, for example, an address on an interface to go
     from preferred to deprecated when it expires, without it
     having to be removed and re-added.
   - If removeLinkAddress is called with an address that is
     present but with different flags, it deletes that address
     instead of failing to find a match.
4. Update the INetworkManagementEventObserver address
   notification methods to take just a LinkAddress instead of
   LinkAddress, flags, and scope. While I'm at it, change the
   order of the arguments for consistency with the other
   functions in the interface.

Change-Id: Id8fe0f09a7e8f6bee1ea3b52102178b689a9336e
2013-12-06 13:54:35 +09:00
The Android Open Source Project
ebcb32f58a Merge commit 'bac61807d3bcfff957b358cb9ad77850bd373689' into HEAD
Change-Id: I29374270c8e0c2f2859efaf1d55af9f73da0f8d7
2013-12-05 13:10:46 -08:00