Commit Graph

3347 Commits

Author SHA1 Message Date
Svetoslav
263b6e6983 Merge "Prevent certain actions of app has revoked permissions" into mnc-dev 2015-06-25 18:20:16 +00:00
Svetoslav
7008b51817 Prevent certain actions of app has revoked permissions
bug:21808294

Change-Id: I7214c1fe47c15fe185423a54a74b58caf8d82daa
2015-06-25 10:55:11 -07:00
Christopher Tate
413020a6ca Require that verified intent filters only have http/https <data> decls
It is malformed to write a single intent filter like this:

  <intent-filter android:autoVerify="true">
    <data android:host="foo.example"
          android:path="/"
          android:scheme="http" />
    <data android:host="*"
          android:path="/custom"
          android:scheme="fooexamplecustomscheme" />
  </intent-filter>

In practice this app is accidentally defining a filter that will match
"http://*".  This is now detected, and will never be auto-verified for
any of the mentioned domains.

Verified intent filters must *only* handle the http & https schemes.

Bug 21920537

Change-Id: I933cddbea23185d242565cac940e1e7a7e4e289b
2015-06-24 13:16:20 -07:00
Svetoslav Ganov
2c99ea3524 Merge "Remove not needed contacts related permissions." into mnc-dev 2015-06-23 23:04:20 +00:00
Svetoslav Ganov
6d2c0e5ee2 Remove not needed contacts related permissions.
This reverts commit ed5ff51b2c.

Change-Id: If2407e4e474a438d95e1b7ad1aa6f441bb3ace08
2015-06-23 23:03:55 +00:00
Jeff Davidson
8d9ad19341 Merge "Default permissions for carrier apps." into mnc-dev 2015-06-23 20:43:06 +00:00
Amith Yamasani
0bf8f7cc39 Runtime permissions cannot be set on legacy apps by device policy
Clarify docs that runtime permissions can be granted or revoked by
a profile owner/device owner only for MNC apps and not legacy apps.

Check the targetSdkVersion and return false if legacy app.

Remove all policy flags from permissions when cleaning up
a device or profile owner.

Bug: 21835304
Bug: 21889278
Change-Id: I4271394737990983449048d112a1830f9d0f2d78
2015-06-23 12:01:36 -07:00
Jeff Davidson
2a88031208 Default permissions for carrier apps.
Grant permissions in the PHONE and LOCATION buckets to default carrier
apps as defined by the telephony stack. Provide a system API to grant
default permissions for carrier apps, as the set of apps may change
when a new SIM is inserted.

Since the phone process is separate from the system process, we need
to allow for binder calls to these APIs.

Also fix a log tag that is too long (android.util.Log drops messages
silently if the tag is > 23 characters).

Bug: 21696731
Change-Id: I98ca0c49c69f621f835ba57c1fd0505f2cec0d0d
2015-06-23 09:55:23 -07:00
Dianne Hackborn
6af40c8338 Merge "Fix issue #21799741: AbstractThreadedSyncAdapter crashes..." into mnc-dev 2015-06-23 16:45:50 +00:00
Christopher Tate
6d2268a576 Merge "Back up / restore default app and intent filter verification state" into mnc-dev 2015-06-23 01:02:12 +00:00
Dianne Hackborn
d01ed46c63 Fix issue #21799741: AbstractThreadedSyncAdapter crashes...
...when permissions aren't granted

Eat the SecurityException, turn it into a new callback.

Change-Id: Ibeffce061aa51beba097c90f431de07ce70b3c4e
2015-06-22 17:41:44 -07:00
Christopher Tate
6038d15cbc Back up / restore default app and intent filter verification state
For apps not present on device, the state inherited from the ancestral
device is applied when the app is ultimately installed.

Bug 20144515

Change-Id: Ie05b4f1751357fc62f14e259da174b8cf465e913
2015-06-22 17:20:26 -07:00
Matthew Williams
8b1db0746f Merge "Cancel Syncs that aren't making progress." into mnc-dev 2015-06-22 21:41:49 +00:00
Matthew Williams
1967c8ddd5 Cancel Syncs that aren't making progress.
BUG: 18266674
1) If a sync has up/downloaded less than 10bytes in 60 seconds it is
considered to be making no progress and is summarily cancelled.

2) Apply a 30min hard time-out to initialization syncs.

Note that there is little proof that cancelling a sync has an
impact. All it results in is a Thread.interrupt on the sync
thread, which the adapter must itself implement. To this effect
this CL also updates the javadoc to make this clearer, and adds
some (unimplemented) threats about killing the hosting process.

Change-Id: I83c447648152ccbf76bb1fbd7e9216e01a37952f
2015-06-22 14:36:36 -07:00
Kenny Guy
434235496c Merge "Fix LauncherApps registerCallback adding duplicate callbacks." into mnc-dev 2015-06-22 16:50:05 +00:00
Svet Ganov
1e575a0f32 Merge "Only grant runtime permissions to special components." into mnc-dev 2015-06-19 22:26:32 +00:00
Svet Ganov
adc1cf4604 Only grant runtime permissions to special components.
Now runtime permissions are granted only to components that are
part of the system or perform special system operations. For
exmple, the shell UID gets its runtime permissions granted by
default and the default phone app gets the phone permissions
granted by default.

bug:21764803

Change-Id: If8b8cadbd1980ffe7a6fc15bbb5f54a425f6e8f9
2015-06-19 15:17:56 -07:00
Amith Yamasani
b94761d0a4 Merge "App Standby : Association between content providers and their sync adapter" into mnc-dev 2015-06-19 22:08:13 +00:00
Amith Yamasani
37a40c24de App Standby : Association between content providers and their sync adapter
Set sync adapters to active if the associated content providers are used
at foreground process state.

Minimize how frequently published content providers are reported by
keeping track of last reported time.

Also cache sync adapters associated with an authority in SyncManager.

Bug: 21785111
Change-Id: Ic2c8cb6a27f005d1a1d0aad21d36b1510160753a
2015-06-19 15:04:58 -07:00
Kenny Guy
172a21697d Fix LauncherApps registerCallback adding duplicate callbacks.
LauncherApps wraps the callback passed so checking
using List.contains isn't valid.

Bug: 21947184
Change-Id: Ice0973935574adda15e295073faedb62374ff627
2015-06-19 17:21:28 +01:00
Wale Ogunwale
15b9fd268a Don't write IntentFilter autoVerify field to xml if false.
Bug: 21205789
Change-Id: I650265eeec99d470ae2f089d8ae3ef3c866c0096
2015-06-19 08:59:52 -07:00
Sudheer Shanka
a408061cc7 Merge "Use the intent filter icon in ResolveInfo for managed profile." into mnc-dev 2015-06-19 09:25:59 +00:00
Christopher Tate
728b7500b3 Merge "Document possible null returns in PackageManager" into mnc-dev 2015-06-18 20:53:12 +00:00
Christopher Tate
abe6580199 Document possible null returns in PackageManager
In particular queryIntentServices() but also a few others.

Bug 19127758

Change-Id: I590605ce4870b2ab300385678df8917cfade60f9
2015-06-18 13:48:42 -07:00
Dianne Hackborn
a750a63d63 Fix issue #21814207 and issue #21814212 (alarm manager)
Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks.

Introduce a whole new infrastructure for providing options when
sending broadcasts, much like ActivityOptions.  There is a single
option right now, asking the activity manager to apply a tempory
whitelist to each receiver of the broadcast.

Issue #21814212: Need to allow configuration of alarm manager parameters

The various alarm manager timing configurations are not modifiable
through settings, much like DeviceIdleController.  Also did a few
tweaks in the existing DeviceIdleController impl.

Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
2015-06-17 11:41:45 -07:00
dcashman
acc2df21de Merge "Add keyset support for ECDSA public keys." into mnc-dev 2015-06-16 22:14:35 +00:00
Dianne Hackborn
1958e5e787 Fix issue #21813831: Need API for asking to be added to power whitelist
Add the API.  Clean up a few related things.

Change-Id: I190adad1812f36f6095b98a1001fedb94874e8b5
2015-06-15 11:53:59 -07:00
Makoto Onuki
bd25b5f602 Merge "Fix ArrayIndexOutOfBoundsException in Transport.query" into mnc-dev 2015-06-13 00:28:20 +00:00
Makoto Onuki
34bdcdb105 Fix ArrayIndexOutOfBoundsException in Transport.query
The bug was that it used getCount() instead of getColumnCount().

Bug 21727804

Change-Id: I3ed6ed3be60c2cb25316340f588f993bac70f52b
2015-06-12 17:16:23 -07:00
Jeff Sharkey
54b65ff300 Merge "Annotate ContentProviderClient arguments." into mnc-dev 2015-06-12 16:57:56 +00:00
Jeff Sharkey
73ed509d44 Annotate ContentProviderClient arguments.
Explicitly mark if they're @Nullable or @NonNull.

Bug: 21560515
Change-Id: Id0a208a38c5a9ea19dddbe60c65d285645d08bb0
2015-06-12 09:49:31 -07:00
Dianne Hackborn
8a435ced67 Merge "Fix APIs." into mnc-dev 2015-06-12 16:34:38 +00:00
Jeff Sharkey
34796bd07f Sigh, some apps are sending null ContentValues.
Bug: 21560515
Change-Id: Id5a62611781a2d9da47ad3e522d3d43f860b1f70
2015-06-11 21:55:32 -07:00
Jeff Sharkey
673db44fb3 Annotate ContentResolver/Provider arguments.
Explicitly mark if they're @Nullable or @NonNull.

Bug: 21560515
Change-Id: I5f671c241dfe65e5ab8bc06b2382fbf5a82bdb20
2015-06-11 21:45:05 -07:00
Jeff Sharkey
4f5e8b3ca4 Valid filenames have length limits!
ext4 filenames are at most 255 bytes.  vfat filenames are bit more
lax, but we're often saving them on ext4 through a FUSE daemon, so
limit them the same way.

Since package names are used as directory names, verify that they're
valid filenames.

Tests to verify behavior.

Bug: 18689171
Change-Id: If7df4c40d352954510b71de4ff05d78259c721ed
2015-06-11 19:16:27 -07:00
Dianne Hackborn
ece0f4f519 Fix APIs.
Issue #21039494: API Review: android.os.PowerManager.isDeviceIdleMode()
Issue #21347000: API Review: android.content.IntentFilter
Issue #20654534: API Review: android.app.assist

Also allow use of ActivityManager.setWatchHeapLimit on any platform
build as long as the calling app is debuggable.

Change-Id: Ic597e596fa772fcdf2553b64f444b3d9269e8b92
2015-06-11 18:07:43 -07:00
Svet Ganov
e545bd36a4 Merge "Permission group is granted if one permission is granted for UI purposes." into mnc-dev 2015-06-11 08:17:43 +00:00
Svet Ganov
1ed0e553c6 Permission group is granted if one permission is granted for UI purposes.
bug:21761217

Change-Id: I02c78225e3883106565d304d5b268e496bca7d89
2015-06-11 01:17:07 -07:00
Svetoslav
75a0ee081f Merge "Add system API to watch for permission changes" into mnc-dev 2015-06-11 08:02:06 +00:00
Svetoslav
f7c06eb03a Add system API to watch for permission changes
Change-Id: I1ce450a59fb326c14848f46732d877dea33f33c7
2015-06-10 21:24:13 -07:00
Jeff Brown
3c9614a03a Merge "Expose Context.getSystemServiceName()." into mnc-dev 2015-06-11 02:37:29 +00:00
Jeff Brown
5b65a36d59 Merge "Add docs for ContentProviderOperations." into mnc-dev 2015-06-11 02:32:13 +00:00
Jeff Brown
40f58d910a Expose Context.getSystemServiceName().
Expose this method so that subclasses can declare new types of services
that can be returned by getSystemService(Class<T>).

Bug: 21343770
Change-Id: I08bdfa61153d19298645dc495deb2d535e54f9f0
2015-06-10 17:47:52 -07:00
Jonathan Basseri
95120bbb6f Merge "Fix typo possibly -> possible." into mnc-dev 2015-06-11 00:44:46 +00:00
Jeff Brown
764e95ec4f Add docs for ContentProviderOperations.
Bug: 21343769
Change-Id: Ia122b58785cf98f16664f82eb00a1f6bd9366885
2015-06-10 17:39:29 -07:00
dcashman
1616f30b0c Add keyset support for ECDSA public keys.
Bug: 21363613
Change-Id: If9eafc725dec4800276251722a7456382dfe207d
2015-06-10 13:32:42 -07:00
Makoto Onuki
e6d8ffb40f Merge "Add more result extras for ACTION_GET_PERMISSIONS_COUNT" into mnc-dev 2015-06-10 16:38:55 +00:00
Jeff Sharkey
e687929f33 Merge "Flags to select storage volume for app installs." into mnc-dev 2015-06-10 04:43:18 +00:00
Jeff Sharkey
ab2340996a Flags to select storage volume for app installs.
Remote callers can now provide the "--install-location" value from
the APK to help select a location, or they can explicitly force a
volume by UUID.

Bug: 21676789
Change-Id: Iefc92d770a851fc33e37edbf259fdb8df2b14ae5
2015-06-09 21:42:22 -07:00
Yao Chen
a0d41262d4 Merge "Copy lockTaskLaunchMode from target activity to its alias." into mnc-dev 2015-06-10 03:28:29 +00:00