Commit Graph

7077 Commits

Author SHA1 Message Date
TreeHugger Robot
c79ca1476b Merge "Q Upstream: Use ParcelFileDescriptor for storing large clip data." 2018-11-12 02:19:55 +00:00
Varun Shah
25eb63ac4a Merge "Exposes Intent.METADATA_SETUP_VERSION as SystemApi for SUW." 2018-11-10 00:23:56 +00:00
TreeHugger Robot
2f6bfcbd6f Merge "Calling opChanged on package suspend / unsuspend" 2018-11-09 23:02:59 +00:00
Alan Stokes
07317d001c Merge "DexLoadReporter needs to handle arbitrary class loaders." am: f2d5ace011 am: 1e29264790
am: 0a0559c0ce

Change-Id: I3a89a9da435cf557fd296066df7b9c5b316e87c2
2018-11-09 14:23:00 -08:00
Philip P. Moltmann
cb35c807ea Merge "Allow location provider to deep link into permissions UI" 2018-11-09 17:29:35 +00:00
Alan Stokes
0a0559c0ce Merge "DexLoadReporter needs to handle arbitrary class loaders." am: f2d5ace011
am: 1e29264790

Change-Id: I41caab25c48d496722ac4d044908dd781df1705d
2018-11-09 03:20:40 -08:00
Satoshi Niwa
472371c6ad Q Upstream: Use ParcelFileDescriptor for storing large clip data.
This patch enables copy&paste-ing large data for Q and below.
Using content URI is the idiomatic way to transfer large data,
but none of the major editor apps (Docs, Evernote, Word, Gmail, etc.)
support content URI in clipboard as of today.
We will ask app developers to use content: URI and remove this function
in API 30 (R).

Bug: 111577843
Test: ClipboardManagerTest
Test: Manualy tested copying a large HTML text
Change-Id: If1798c5abcec691f4b17a45e583ed314b1c16ac2
2018-11-09 14:35:50 +09:00
Suprabh Shukla
3017fe4f51 Calling opChanged on package suspend / unsuspend
checkAudioOperation returned MODE_IGNORED when a package was suspended,
but any AppOpsWatcher registered for audio operation did not callback
when a package got suspended. This lead to inconsistent state for
services that were watching for app op changes.

Test: atest FrameworksServicesTests:SuspendPackagesTest

Bug: 112486945
Bug: 110077884
Change-Id: Ibfc378dd4ea8dd38ef002c1ac668c479afa8fd47
2018-11-08 19:40:13 -08:00
Philip P. Moltmann
64da5e6e44 Merge changes from topic "TestSplitRuntimePermissions"
* changes:
  Apply fg/bg state in default grant policy
  Do not inherit grant of background location
  Split permissions inherit state from their parents
  Have a map of background -> foreground permssions
  Give 'restorePermissionState' a better name
2018-11-08 22:57:43 +00:00
Philip P. Moltmann
17f65afe3b Split permissions inherit state from their parents
The old hack to grant permissions on upgrade was removed. The new code
applies to
- platfrom upgrade
- initial package installation
- package update

Inheriting the grant state is the default behavior for split permissions.
Special cases will be added later.

Also make sure to revoke the permission once the app declares that it is
aware of the permission.

Test: atest CtsPermissionTestCases:SplitPermissionTest
Change-Id: Ie51971530607f0b585cf7a3e11b01b11a28e1de9
2018-11-08 09:32:01 -08:00
Philip P. Moltmann
ed98828335 Allow location provider to deep link into permissions UI
Test: Built
Bug: 118437704
Change-Id: I566acaf09bad27a47ec3822816c136c01b18bfc9
2018-11-08 09:11:05 -08:00
Patrick Baumann
0aff9b1d08 Revert "Revert "Adds new atomic install API""
This reverts commit 7e1c9d75bc.

This change adds the new atomic install system API to
PackageInstaller and plumbs it through to PackageManager. It also
adds support for committing multiple sessions via command line.

Bug: 109941548
Test: Manually install 2 apps from command line
Reason for revert: Forward fix build breakage

Change-Id: I1e518f7b8998599c849fb0e8c040be974e4ac821
2018-11-08 06:41:50 -08:00
TreeHugger Robot
d0f153d270 Merge "Add thermal service into system_server" 2018-11-08 01:43:14 +00:00
Jie Song
ccf59d6f21 Merge "Revert "Adds new atomic install API"" 2018-11-07 23:14:45 +00:00
Jie Song
7e1c9d75bc Revert "Adds new atomic install API"
This reverts commit 44da627fd5.

Reason for revert: <fix build>

Change-Id: I6f9ae2fc7606547e6bf6f9d8d6c2fc309b5a4538
2018-11-07 22:59:18 +00:00
Wei Wang
bad7c20606 Add thermal service into system_server
This system service will listen to ThermalHAL for throttling events and
take actions accordingly, e.g. shutdown device and/or sending
notification to registered listeners to IThermalSerivce.

Bug: 79443945
Bug: 118510237
Bug: 111086696
Bug: 116541003
Test: Boot and test callback on ThermalHAL 1.1
Test: Boot and test callback on ThermalHAL 2.0
Test: Kill ThermalHAL process
Test: Change device threshold to trigger shutdown
Change-Id: I1f4066c9f1cf9ab46c1738a0a4435802512e4339
2018-11-07 13:38:57 -08:00
TreeHugger Robot
0f60a8defc Merge "Adds new atomic install API" 2018-11-07 21:23:08 +00:00
Alan Stokes
b6c3a604b0 DexLoadReporter needs to handle arbitrary class loaders.
Also made sure we can handle null classpaths.

Test: atest -p services/core/java/com/android/server/pm/dex
Bug: 111336847
Change-Id: Idabf3fb9a09a0764e805679ac29cd8455e8dc267
2018-11-07 12:00:42 +00:00
Varun Shah
8823180ac4 Merge "Updated documentation for OnSharedPreferenceChangeListener." 2018-11-07 03:30:05 +00:00
Varun Shah
a253644272 Updated documentation for OnSharedPreferenceChangeListener.
Clarified that #onSharedPreferenceChanged does not get called after
Editor#clear.

Bug: 117752822
Test: atest cts/tests/tests/content/src/android/content/cts/SharedPreferencesTest.java#testSharedPrefsChangeListenerIsCalledOnCommit
Test: atest cts/tests/tests/content/src/android/content/cts/SharedPreferencesTest.java#testSharedPrefsChangeListenerIsCalledOnApply
Change-Id: I6fd33d13ae706882131dafdfe0d095f9b48a1744
2018-11-06 15:07:52 -08:00
Patrick
44da627fd5 Adds new atomic install API
This change adds the new atomic install system API to
PackageInstaller and plumbs it through to PackageManager. It also
adds support for committing multiple sessions via command line.

Bug: 109941548
Test: Manually install 2 apps from command line
Change-Id: I71d77026a55a40c76925e55e6956fb76efe16224
2018-11-06 21:16:11 +00:00
Felipe Leme
e348dc3486 Initial implementation of the IntelligenceService pipeline.
It's still full of TODOs, but at leats it now provides an end-to-end
workflow from the activity creation / destruction to the service implementation.

Test: mmm -j packages/experimental/FillService && \
      adb install -r ${OUT}/data/app/FillService/FillService.apk && \
      adb shell settings put secure intel_service foo.bar.fill/.AiaiService
Bug: 111276913

Change-Id: Id5daf7b8b51e97c74d9b6ec00f953ddb02b48e46
2018-11-06 10:01:02 -08:00
Nicolas Geoffray
c6c856912b Merge "Make shared library dependencies explicit in SharedLibraryInfo" 2018-11-06 13:58:01 +00:00
Dario Freni
b1eeab34a6 Merge "Initial support for installing APEX via adb." 2018-11-06 10:18:38 +00:00
Kevin Chyn
8d45688b6d Merge "Add placeholders for IrisManager/Service" 2018-11-06 06:29:22 +00:00
Kevin Chyn
51676d293a Add placeholders for IrisManager/Service
With the system services in place, we can add SELinux policies

Bug: 116530289

Test: Builds
Change-Id: I0fd0dfbbbf258eb4a0ef9019247baaf323578959
2018-11-05 18:57:15 -08:00
Nicolas Geoffray
10b0779df8 Make shared library dependencies explicit in SharedLibraryInfo
bug: 112405321
Test: boots, PackageParserTest
Change-Id: I591c29f72ad95b2a8adb4a2242f1e764e0e29007
2018-11-06 00:32:34 +00:00
Ryan Mitchell
3064067908 Merge "Copy common resources between styles" 2018-11-05 23:56:39 +00:00
Seigo Nonaka
0a2786cc5d Merge "Refactor Typeface construction logic" 2018-11-05 21:09:23 +00:00
Dario Freni
d8bf22e8c6 Initial support for installing APEX via adb.
Test: adb install package-signed.apex (succeeds)
adb install package-unsigned.apex (fails)
Change-Id: I3ac7971ce6923511a7d574291fe9002c5d55fa1b
2018-11-05 09:24:58 +00:00
Kenny Root
8b0a22dbad Merge changes from topic "usb-adb-separation"
* changes:
  Update USB tests for ADB split
  Move AdbDebuggingManager to AdbService
  AdbService: move source of truth for enabled
  Add empty AdbHandler
  Add systemReady call for AdbService
  Add function to query ADB state
  Register USB as an ADB transport type
  Add ADB transport skeleton
  Add empty AdbManagerInternal for system server
  Add empty AdbService to SystemServer
  Move ADB debugging manager to core
  Rename to AdbDebuggingManager
  Move UsbDebuggingManager to new package
2018-11-02 00:43:05 +00:00
Ryan Mitchell
b3ae42e976 Copy common resources between styles
The docuemntation of setTo states that the resources two styles from
different AssetManagers have in common will be set in the destination
theme. This change adds this functionality. The package ids of the
attributes, the package ids of reference values, and the cookie of
attribute values have to be rewritten to match the destination
AssetManager. This change can later be made more generic if rewriting
references between packages is needed elsewhere.

Bug: 115897657
Test: libandroidfw_tests and manual test of app specified in the bug
Change-Id: Iee999ea2cc8473168cac11aaf3c34e14c958e5ae
2018-11-01 17:01:28 -07:00
Chris Craik
ce58754645 Merge "Add 'profileable' application manifest tag" 2018-11-01 21:28:58 +00:00
TreeHugger Robot
2c87f2ead8 Merge "Add an intent to launch the app permission usage screen." 2018-10-31 19:28:03 +00:00
Patrick Baumann
1f9b8850a2 Only adds hidden app detail for normal apps
The new hidden app detail activity was being added to all packages being
installed, even static shared libraries, which may not have any
activities and which we do not want to surface to the user in launcher.

Change-Id: I80e7d379abed04f2464d1dc7e8b75456e43063f4
Fixes: 118145903
Test: atest android.os.cts.StaticSharedLibsHostTests
2018-10-31 15:51:02 +00:00
Kenny Root
f74bfdee01 Add empty AdbService to SystemServer
Create skeleton service to migrate functions from UsbService in later
change.

Bug: 63820489
Test: make
Change-Id: I07672fe87cfae188fe77c173fc49119e182c6b05
2018-10-31 16:11:01 +09:00
Seigo Nonaka
ee4b6d85dc Refactor Typeface construction logic
API refactoring:
- Replace Font.getWeight()/getSlant() with Font.getStyle().
- Change Typeface.CustomFallbackBuilder.setItalic() to setSlant()

Implementation refactoring:
- Add hidden builder API for asset manager with cookie. The cookie is
internal, so hide the API as well.
- Replace createFromResources with Typeface.Builder
- Reimplement Typeface.Builder with Typeface.CustomFallbackBuilder

Ground work for b/114479228
- Keep list of FontFamily in the Typeface.

Bug: 114479228
Test: atest CtsTestCases
Test: atest CtsGraphicsTestCases
Test: atest CtsWidgetTestCases
Change-Id: Ifaaa58ddea147644a93158aa075394c2f645617c
2018-10-30 12:18:12 -07:00
Chris Craik
ce0302890a Add 'profileable' application manifest tag
Bug: 117841084
Test: atest CtsAtraceHostTestCases:AtraceHostTest

Allow apps to opt-in to important profiling features (systrace, binder
tracing), without requiring debuggable=true. Debuggable has
significant performance overhead, and is undesirable for profiling.

Profileable is set to true when debuggable is true.

Change-Id: I16aaa7bc60dee4b1b262e169ac285759d57d8198
2018-10-30 10:24:31 -07:00
TreeHugger Robot
64f878e0a9 Merge "Add RoleManager into the system." 2018-10-30 10:03:39 +00:00
Varun Shah
b9fd6bedbc Exposes Intent.METADATA_SETUP_VERSION as SystemApi for SUW.
Bug: 114363691
Test: manual (run setup wizard)
Change-Id: I4f2b9ee04a641421b7061c87380fa71235967683
2018-10-29 20:17:17 -07:00
Jeff Sharkey
00e3e1b203 Merge "Force apps to request permissions for teamfooding." 2018-10-30 00:19:57 +00:00
Jeff Sharkey
669e6b1178 Force apps to request permissions for teamfooding.
To support teamfooding of the new storage privacy features coming
in Q, we need apps to request new AUDIO/VIDEO/IMAGES permissions, but
most of those apps are prebuilts that won't land updates until
several months in the future.

So add system properties so teamfooders can "force" apps to request
these permissions, making them work on Q builds.  Only takes effect
when isolated feature is enabled, and guarded with STOPSHIP to ensure
we remove it.

Here's a typical set of commands to use with this CL:

    adb shell setprop persist.fw.force_legacy 1
    - or -
    adb shell setprop persist.fw.force_audio com.google.android.music
    adb shell setprop persist.fw.force_video com.google.android.apps.photos
    adb shell setprop persist.fw.force_images com.google.android.apps.photos,com.google.android.apps.messaging
    - then -
    adb shell setprop persist.sys.isolated_storage 1
    adb reboot

Bug: 118504670
Test: manual
Change-Id: I631819648334994255256b6046bb4c8aec07ce3a
2018-10-29 15:03:28 -06:00
Zhi An Ng
1c866f4f5a Merge "Add new queue to offload slow broadcasts" 2018-10-29 18:57:28 +00:00
Joel Galenson
78ec58d209 Add an intent to launch the app permission usage screen.
Bug: 63532550
Test: Launched the new screen with this intent.
Change-Id: I0b690b742ad4e89fcbd6e613675f5e08ed3dc644
2018-10-29 08:41:56 -07:00
Hai Zhang
b777668584 Add RoleManager into the system.
A role is a unique name within the system associated with certain
privileges. There can be multiple applications qualifying for a role,
but only a subset of them can become role holders. To qualify for a
role, an application must meet certain requirements, including
defining certain components in its manifest. Then the application will
need user consent to become the role holder.

Upon becoming a role holder, the application may be granted certain
privileges that are role specific. When an application loses its role,
these privileges will also be revoked.

Bug: 110557011
Test: build
Change-Id: Icd453a3b032857a8fd157048de8b9609f04e28b8
2018-10-27 11:14:32 -07:00
Jeff Sharkey
5f97b7ee27 Merge "Magic to keep "_data" paths working." 2018-10-26 19:31:08 +00:00
Sudheer Shanka
041d55c1e0 Merge "Update StorageManagerService handling of packages info." 2018-10-26 17:29:24 +00:00
Jeff Sharkey
bc2ae00878 Magic to keep "_data" paths working.
As part of the storage changes in Q, we're removing the ability for
apps to directly access storage devices like /sdcard/.  (Instead,
they'll need to go through ContentResolver.openFileDescriptor() to
gain access.)  However, in several places we're returning raw
filesystem paths in the "_data" column.  An initial attempt to simply
redact these with "/dev/null" shows that many popular apps are
depending on these paths, and become non-functional.

So we need to somehow return "_data" paths that apps can manually
open.  We explored tricks like /proc/self/fd/ and FUSE, but neither
of those are feasible.  Instead, we've created a cursor that returns
paths of this form:

/mnt/content/media/audio/12

And we then hook Libcore.os to intercept open() syscalls made by
Java code and redirect these to CR.openFileDescriptor() with Uris
like this:

content://media/audio/12

This appears to be enough to keep most popular apps working!  Note
that it doesn't support apps that try opening the returned paths
from native code, which we'll hopefully be solving via direct
developer outreach.

Since this feature is a bit risky, it's guarded with a feature flag
that's disabled by default; a future CL will actually enable it,
offering a simple CL to revert in the case of trouble.

Bug: 111268862, 111960973
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ied15e62b46852aef73725f63d7648da390c4e03e
2018-10-26 09:32:29 -06:00
Nicolas Geoffray
7fa407f752 Merge "Attach SharedLibraryInfo to a Package." 2018-10-26 12:56:01 +00:00
Sudheer Shanka
2ac25a96e7 Update StorageManagerService handling of packages info.
Instead of maintaining local copy of all appIds and sandboxIds,
StorageManagerService will just get required packages info
from PackageManagerService when an user starts and passes it
to vold.

Bug: 117988901
Test: manual
Change-Id: Ib7411645bd0c5e2801bc998d92fda00bceb9c258
2018-10-25 17:42:20 -07:00