Commit Graph

6144 Commits

Author SHA1 Message Date
Philip P. Moltmann
81e46d9232 Doc that SharedPreferences is IO-expensive
Tried to find the right middle ground in between
- not exposing potentially changing implementation details
- being clear on what it is for and what not
- being too alarmist vs. being to weak

Test: compiled
Bug: 69177691
Change-Id: Ifb40e350a18bf72c113229f31e129b7e8fdacd2a
2017-11-15 13:31:56 -08:00
TreeHugger Robot
07201a7922 Merge "Enforce REQUEST_DELETE_PACKAGES for PackageInstaller.uninstall()" 2017-11-15 01:09:06 +00:00
Philip P. Moltmann
d9bb39abdf Enforce REQUEST_DELETE_PACKAGES for PackageInstaller.uninstall()
Fixes: 64576642
Test: Uninstalled apps
Change-Id: Ia7f3c047bb9c725228ca45e4c34e51a2d9177120
2017-11-14 14:37:38 -08:00
TreeHugger Robot
341775bfef Merge "Adds client API for interacting with statsd." 2017-11-14 20:25:09 +00:00
TreeHugger Robot
a379f499c8 Merge "Allow assistant app to access any shortcuts" 2017-11-14 18:41:50 +00:00
David Chen
adaf8b344e Adds client API for interacting with statsd.
This API will primarily be used by GmsCore to send updated configs.
Also, sending a config will implicitly notify the StatsD that this
client wants to know when it should request data for this config.

We send a broadcast so that all interested subscribers can know if
data needs to be pulled.

Test: Manually tested that sending broadcast works via new adb
command added in StatsService.

Change-Id: I23cdd1df706036e14b32c3d01af30c3d4af819fa
2017-11-13 19:37:12 -08:00
TreeHugger Robot
29cd580e4a Merge "Deprecate framework Fragments and Loaders" 2017-11-13 22:34:34 +00:00
Ian Lake
0a1feb8192 Deprecate framework Fragments and Loaders
Redirect developers to use the Support Library
versions of Fragments and Loaders to ensure that
they get consistent behavior across versions of
Android and all devices as well as access to
Lifecycle improvements.

Test: Confirmed APIs deprecated in current.txt
BUG: 68381801
Change-Id: I58ec599e557fc93c8547c45ba7c9ced96b0c8616
2017-11-13 10:55:59 -08:00
TreeHugger Robot
3bba35111e Merge "Introduce CrossProfileApps API" 2017-11-13 06:43:44 +00:00
Jeff Sharkey
cbc5867ede Merge "Allow blocking calls when protected against ANRs." 2017-11-10 06:01:40 +00:00
Jeff Sharkey
5918948db7 Allow blocking calls when protected against ANRs.
ContentProviderClient has a nice setDetectNotResponding() method
that detects hanging calls to remote providers, and it can trigger
an ANR to kill the app and release the blocked thread.

We typically don't want to perform blocking calls from the system
server, but we're okay allowing them on CPCs that are using
setDetectNotResponding() to watch for hung clients.

Test: builds, boots
Bug: 69128093
Change-Id: I223aaf1d0cef0f8dee28f800d9e3c101d7449952
2017-11-09 18:32:37 -07:00
Christian Williams
ce19db9e48 Merge "Add missing break to switch in resourceQualifierString()." 2017-11-09 22:58:36 +00:00
Makoto Onuki
35559d6125 Allow assistant app to access any shortcuts
Bug: 68760723
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Change-Id: I8c0f0ba1f01c1da7df44bb235abdaa94c36d86d3
2017-11-08 15:52:23 -08:00
Ricky Wai
1a6e667cb6 Add Network security watchlist service
Network security watchlist service is a service to monitor all potential
harmful network traffic. By setting a network watchlist, any connections
that visit any site from watchlist will be logged.

Logs will be aggregated everyday and encoded using differential
privacy before exporting it from framework.

This feature is disabled now, run "setprop ro.network_watchlist_enabled true" to enable it.

All network events are handled in an async bg thread, it should not
cause any delay in netd. Also, it uses the hooks in enterprise network logging,
so we can run netd_benchmark to measure the impact to netd.

Here are the things not included in this CL:
- ConfigUpdater to get and set watchlist
- Differential privacy encoding logic and reporting
- CTS
- Memory and performance optimization for internal watchlist data structure

Test: manual - turn on the feature, hard code a watchlist xml, process
that visited that domain is being logged in sqlite.
Test: run netd_benchmark - seems no obvious performance change.
Test: bit FrameworksCoreTests:android.net.NetworkWatchlistManagerTests
Test: runtest frameworks-net
Test: runtest frameworks-services -p com.android.server.net.watchlist

Bug: 63908748

Change-Id: I09595178bac0070a867bc5e0501a7bf2c840e398
2017-11-08 18:57:46 +00:00
Nikolas Bravo
6283100a87 Fixes javadoc documentation of PackageInstaller.SessionParams#setOriginatingUid(int)
* Current "See also" link in https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams.html#setOriginatingUid(int) is not only wrong, but also broken
* Added a missing "the"

Test: none
Change-Id: I90410ed3393b5c37afdf0476eb70821fae9f63fd
2017-11-07 21:11:40 +00:00
Christian Williams
b709f3c322 Add missing break to switch in resourceQualifierString().
Change-Id: Ia90b4dd6a2697896ac59fc93bbd61d0d9748f437
2017-11-02 17:19:27 -07:00
TreeHugger Robot
90a789e122 Merge "Give VoiceInteractionService access to shortcuts." 2017-11-02 22:26:40 +00:00
Jeff Davidson
5280b4205e Merge "Expose Intent#EXTRA_REASON as a SystemApi." 2017-11-02 20:10:18 +00:00
Dianne Hackborn
c160fa4cc4 Give VoiceInteractionService access to shortcuts.
The shortcut manager now has a set of additional packages that
have access, which the voice interaction system service feeds in
to.

Bug: 68760723
Test: CtsVoiceInteractionTestCases
Change-Id: I2a69f83569eb350f405bdd548998570ceef9ea7e
2017-11-02 10:51:03 -07:00
Sunny Goyal
b2985209fe Preventing recursive referrence in drawables am: 99b25d2817
am: ced997ec10

Change-Id: Iab88125b030bfe21aad82a1b287495cb9e3f54a2
2017-11-02 04:55:36 +00:00
Sunny Goyal
ced997ec10 Preventing recursive referrence in drawables
am: 99b25d2817

Change-Id: I1c23d40e590d6d8bb21f6734a106d0ee217b6672
2017-11-02 04:46:07 +00:00
Sunny Goyal
99b25d2817 Preventing recursive referrence in drawables
Bug: 68706673
Bug: 66498711
Test: Added CTS tests
Change-Id: I8034f49d16f9a7bc1749714fd6d6231bba5088d0
2017-11-02 04:31:12 +00:00
Bryce Lee
fbddd89e93 Merge "DO NOT MERGE Remove orientation restriction to only fullscreen activities." into oc-mr1-dev
am: 0be61c662b

Change-Id: I8db0cda8ce289423b9f63d3dc1b2598e951e1e2d
2017-11-02 01:14:49 +00:00
Jeff Davidson
a0c7d1fb3c Expose Intent#EXTRA_REASON as a SystemApi.
It's expected to be set with ACTION_FACTORY_RESET intents, and this
action was exposed as a @SystemApi in b/32974361.

Change-Id: Ib29ffb8d62460eb4ec0208076331bbba3272f290
Fixes: 67751036
Test: Just TreeHugger; no functional changes
2017-11-01 18:07:32 -07:00
Tony Mak
1b708e68b3 Introduce CrossProfileApps API
CTS will be in next CL.
APIs for labels/ icons of profile switching are not implemented yet.

Test: Wrote a test app to play around the APIs
Test: bit FrameworksServicesTests:com.android.server.pm.crossprofile.CrossProfileAppsServiceImplTest
BUG: 67765768

Change-Id: I27714aa4a8d61c6df398cbc5112cb4c35316a3fb
2017-11-01 10:11:51 +00:00
Bryce Lee
e83f34cde7 Remove orientation restriction to only fullscreen activities.
This changelist removes checks that enforce that only fullscreen,
opaque activities may request orientation changes. An application
may itself be compatible with the change and update their SDK level.
However, it is possible they use a library that has not itself been
updated and still leverages this feature for non-fullscreen
activities.

Change-Id: Ie1d300e3531fc8c588d2124dea698e4a876713c2
Fixes: 68684796
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests
2017-10-31 20:25:15 -07:00
Bryce Lee
a89b183ef9 DO NOT MERGE Remove orientation restriction to only fullscreen activities.
This changelist removes checks that enforce that only fullscreen,
opaque activities may request orientation changes. An application
may itself be compatible with the change and update their SDK level.
However, it is possible they use a library that has not itself been
updated and still leverages this feature for non-fullscreen
activities.

Fixes: 68684796
Test: bit FrameworksServicesTests:com.android.server.wm.AppWindowTokenTests

Change-Id: Ib5a60f0b660ad145d07e953e541a0a1b801aeef2
2017-10-31 18:29:34 -07:00
Dianne Hackborn
ca3872ce36 Fully implement "install" and "install-write" in PackageManagerShellCommand.
We can use the new mechanism to ask the calling shell to open
a file in order to implement the rest of these commands, allowing
you to give the path to an apk to install.  That API is thus
extended to allow you to open readable files, not just opening
file for writing.

Doing this however means we no longer can pass a file path to
AssetManager for the apk to parse, we only have an already open
fd for that.  Extending AssetManager to allow adding apks from
fds is not that hard, however, since the underlying zip library
already supports this.

This main thing this changes is in AssetManager.cpp where we
retrieve the open zip file for a particular apk that has been
added.  This used to look up the zip file by path every time
it was needed, but that won't work anymore now that we can have
things added by fd.  Instead, we keep track of each opened zip
in the AssetManager, so we can just directly retrieve it from
the asset_path representing the item that was added.  As a
side-effect, this means for normal paths we no longer need to
look up by name, but just have the opened zip file directly
accessible.  (This is probably good, but it does mean that we
no longer run the logic of seeing if the zip file's timestamp
has changed and re-opening it if it has.  We probably shouldn't
be relying on that for an active AssetManager anyway, and maybe
it is even good that we don't allow the zip file to change
under it?)

A follow-up change will finally remove the Pm.java implementation
and turn the pm "command" into a simple shell script that runs
cmd package.

Test: manual

Change-Id: Ie103e3bdaa5b706796cc329254f2638151a3924f
2017-10-31 10:54:31 -07:00
TreeHugger Robot
34d4130fd4 Merge "Enable variation settings for fonts in XMLs" 2017-10-30 14:29:45 +00:00
Mihai Popa
690e62bb68 Enable variation settings for fonts in XMLs
Bug: 37853920
Test: bit FrameworksCoreTests:android.content.res.FontResourcesParserTest

Change-Id: I1acf9767fb1cecc5f4982b79405f92280b31bfa7
2017-10-30 11:48:54 +00:00
TreeHugger Robot
7b9f263781 Merge "Move grantPermission to permission manager" 2017-10-25 20:44:24 +00:00
TreeHugger Robot
2dfd5c375e Merge "Docs: clarify WebView support for cleartext traffic" 2017-10-24 23:07:00 +00:00
Todd Kennedy
c29b11a5f6 Move grantPermission to permission manager
Last major movement of permission logic from the
package manager to the permission manager.

Bug: 63539144
Test: Manual. Builds and runs
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.PermissionsHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermissionTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
Test: bit FrameworksServicesTests:com.android.server.pm.PackageManagerSettingsTests
Change-Id: I3225405fad4334917b8df0b08bb1936a58744480
2017-10-24 06:40:59 -07:00
Todd Kennedy
460f28c2f0 Move mPermissionGroups
Bug: 63539144
Test: Manual. Builds and runs
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.PermissionsHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermissionTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsPermission2TestCases
Test: bit FrameworksServicesTests:com.android.server.pm.PackageManagerSettingsTests
Change-Id: I3b019babc81997d1d70c14675a34b6a8bec5387d
2017-10-24 06:23:16 -07:00
Nate Fischer
6a2a541fb1 Docs: clarify WebView support for cleartext traffic
No change to logic, docs change only.

WebView added support for android:usesCleartextTraffic for apps
targeting O and above (API level 26). This CL clarifies WebView's
support in the Android documentation.

This also fixes a preexisting presubmit error in
NetworkSecurityPolicy.java (unused import).

Bug: 67714197
Test: N/A
Change-Id: If6bfd36bc65926a1b032813598c85146ccfde969
2017-10-23 18:02:41 -07:00
TreeHugger Robot
893798e272 Merge "Remove an extra line in a comment." 2017-10-20 23:03:45 +00:00
Svet Ganov
6f0e008318 Merge "Preserve ranking attrs of resolve infos for installing a feature split" into oc-mr1-dev am: 8f231b7aa6
am: 9a7a6e2000

Change-Id: I4e359a54b1eb6a681e4e6fabe31e0cf20a1c87a9
2017-10-19 14:41:26 +00:00
Mihai Popa
9069f17981 Merge "Enable the public TTC index attribute for fonts" 2017-10-19 10:12:09 +00:00
Svet Ganov
9a7a6e2000 Merge "Preserve ranking attrs of resolve infos for installing a feature split" into oc-mr1-dev
am: 8f231b7aa6

Change-Id: Id85257c481a7d4e387ffc6ee628bfd2986ab5b3c
2017-10-19 03:26:00 +00:00
Svet Ganov
d96953ad7a Preserve ranking attrs of resolve infos for installing a feature split
If an intent resolves to an activity in a fearture split not on the device
we create a synthetic resolve info to involve the installer that replaces
the resolve info for the missing activity. The synthetic resolve info was
not inheriting the priority/preferred order/default status resulting in a
different result ranking than what original resolve info would produce,
hence affecting resolution. Activities in a feature split should resolve
as if they are present on the device.

Also when downloading a feature split we involve the instant app installer
which resuls in a disabmiguation UI item "Instant app" with an instant app
icon despite that in this case the synthetic resolve info is for downloading
a piece of an already installed app (standard or instant). When installing
a feature spluit the user should see UI as if the piece of the app would
handle the intent.

Test: manual

bug:67710878

Change-Id: I8dd356c7b2c9742144f10e5b48daf5b28f6934ad
2017-10-18 17:29:28 -07:00
Jason Monk
8a77c22205 Merge "Unhide slice data APIs" 2017-10-17 21:59:15 +00:00
Yi Jin
d6759d46f9 Enable dumpsys package in incidentd
Test: manually tested on device.
Change-Id: I963fd42684d9e2302f64fdd6cd729e077a9b37ac
2017-10-16 17:39:28 -07:00
Tim Zheng
8d5bb577f4 Remove an extra line in a comment.
This line seems to have been added back inadvertently.

Test: Comment change only.
Change-Id: I64496b70ad7095d14577eedc10f1557d10460315
2017-10-16 15:15:26 -07:00
Jason Monk
d18651fa89 Unhide slice data APIs
Test: CTS
Change-Id: Ie2a05e30e5ac6c830b6a9a14b2d207b7e2fbe9da
2017-10-16 14:38:18 -07:00
TreeHugger Robot
c7c0519618 Merge "Add signature permission to allow access to shortcuts for sysui" 2017-10-14 03:21:50 +00:00
Makoto Onuki
634cecb899 Add signature permission to allow access to shortcuts for sysui
Bug 34715012
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases

Change-Id: I922f9fb872e27b25d1016b3894165a0e63faa9b5
2017-10-13 17:36:42 -07:00
Makoto Onuki
a96f6a0a14 Merge "Return canned messages from getDisabledMessage for..." 2017-10-13 15:53:18 +00:00
Mihai Popa
e34ad1871b Enable the public TTC index attribute for fonts
This change adds support for specifying the TTC index on font entries,
relevant in the context of .ttc font files used to deliver multiple
fonts in the same file.
Bug: 37853920
Test: adb shell am instrument -w -e class android.content.res.FontResourcesParserTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I3f74e87dec78e1f5a68ccead80b0f637af1aa7a3
2017-10-13 12:44:21 +01:00
Yi Jin
7376615ca6 Merge "Implement Activity Manager Broadcasts dump protos" 2017-10-13 00:51:31 +00:00
Makoto Onuki
b1588c0d39 Return canned messages from getDisabledMessage for...
shortcuts that haven't been restored.

Bug 62451035
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases

Change-Id: I8678adbbb7074bc28fe4b1b440fb11a6acfc9fdf
2017-10-12 15:43:09 -07:00