Commit Graph

6757 Commits

Author SHA1 Message Date
Howard Chen
f17f42b0df Add the DynamicAndroid Service
Define the DynamicAndroid with AIDL.
  Add a java implementation.
  Start a service instance in the system server.
  Add a permission test.

Bug: 122015653
Test: Build & Test on a pixel phone with following command \
  ./frameworks/base/services/tests/runtests.py -e class com.android.server.DynamicAndroidTest

Merged-In: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
Change-Id: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
2019-01-31 15:10:21 +08:00
Adrian Roos
b852f6636f Merge "API: Fix missing @NonNull annotations" 2019-01-30 09:31:58 +00:00
Remi NGUYEN VAN
3193598566 Add INetd to SystemServiceRegistry
Includes @SystemApi for Context.NETD_SERVICE so system apps (including
the network stack) can obtain the service.

Test: m
Bug: 112869080
Change-Id: Ida63747cd30abb7b3c19559803353eb0e42e6efa
2019-01-28 12:13:08 +09:00
Adrian Roos
1de5c629eb API: Fix missing @NonNull annotations
In pi-dev, those annotations were added out of band in
tools/metalava/manual/master.txt. The annotations were also
supposed to be added to master, but for some this did not happen.

Bug: 123221743
Test: m api-stubs-docs-check-last-released-api
Change-Id: Ia7589dfcc7f63923890e609dbf03175d2b035d29
Merged-In: Ia7589dfcc7f63923890e609dbf03175d2b035d29
(cherry picked from commit 918c4f1043)
2019-01-24 14:19:39 +01:00
Paul Duffin
87c1081c42 Merge "Include OrgApacheHttpLegacyUpdater unconditionally" 2019-01-24 11:12:47 +00:00
Brad Ebinger
4e65f803a3 Add FEATURE_TELEPHONY_IMS definition
Bug: 118823723
Test: manual
Change-Id: Ic1e65cfba8ecb117199db6ebd636e0d39007b6c6
2019-01-23 23:52:26 +00:00
Mathieu Chartier
52cf4adf70 Merge "[view compilation] Add --compile-layouts flag to pm compile" 2019-01-23 17:02:31 +00:00
Eric Holk
b1a736d49c [view compilation] Add --compile-layouts flag to pm compile
This allows us to generate precompiled layouts for installed applications.

If the system property view.precompiled_layout_enabled is set, then
PackageMannager will also automatically generate precompiled layouts for apps at
install or upgrade time.

Bug: 111895153
Test: manual
Merged-In: If6455e1b9b0542a36882af9f3e29d0185a53393c
Change-Id: Iea40f5bc90bca0d2605c3c5221159cef13e1e447
2019-01-22 17:40:47 +00:00
Tyler Gunn
d8f76c857b Mark NEW_OUTGOING_CALL broadcast as deprecated.
Mark NEW_OUTGOING_CALL broadcast as deprecated and document that callers
should use the CallRedirectionService API.

Test: Build APIs.
Bug: 64959558
Change-Id: I9192b50b16be2ff0cdc0f864ee99b42b83e261e9
2019-01-22 08:09:24 -08:00
Paul Duffin
025bfab929 Include OrgApacheHttpLegacyUpdater unconditionally
Previously, OrgApacheHttpLegacyUpdater was added to the bootclasspath
(in the framework-oahl-backward-compatibility library) if and only if
the org.apache.http.legacy.jar was not on the bootclasspath. Its
presence caused the runtime to maintain backwards compatibility by
adding org.apache.http.legacy.jar to the app's classpath for apps that
target < P.

The org.apache.http.legacy.jar was permanently removed from the
bootclasspath in P and so the framework-oahl-backward-compatibility
library, and hence OrgApacheHttpLegacyUpdater, are always on the
bootclasspath and so there is no need to treat it as optional. To that
end this change:
1) Includes it in the main framework target, previously it was
   explicitly excluded.
2) Removes the code for handling the case when it is not present.
3) Removes tests for when it is not present.
4) Removes documentation describing what happens when it is not
   present.

Bug: 18027885
Test: cts/tests/signature/runSignatureTest.sh
Change-Id: I3892ead8cd2a8bf17e57bf08e3bf6ee65afac0a1
2019-01-22 14:16:14 +00:00
Remi NGUYEN VAN
bf1ecd1957 Add startActivityAsUser to SystemApi
Normal applications do not have permissions to use this method.

Test: m
Bug: 112869080
Merged-In: I693b3bf56f3be71f0790776e3aad5694717786ef
Change-Id: Ibe91c1bc4c94883a313e799cb0a37db7696fc62e
2019-01-22 08:27:21 +09:00
Nandana Dutt
3386fb7172 Add a privileged API for capturing and consuming bugreports
The API is mostly implemented; except for hooking up the listener
and handling an already running bugreport.

BugreportManager is the handle to the new API exposed to apps.

Generating bugreports requires root privileges. To limit the footprint
of the root access, the actual bugreport generation in Dumpstate binary,
is accessed as a oneshot service and dies after it finishes
running.

System server accesses Dumpstate via a binder interface since it does
not have root privileges.

Starting a oneshot service is done via setting a system property, which
needs to be done from system server. BugreportManagerService is the
new system server service that does this. BugreportManager calls into
BugreportManagerService via a binder interface, since the former is in
the app's process.

Both app to system server as well as system server to native service
calls are via implementations of IDumpstate binder interface.

Bug: 111441001
Test: builds. Flashed & verified it boots.
Test: wrote a test client (not included) and verified invoking
startBugreport works.

Change-Id: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
Merged-In: I4abeb753388c055c36ae0dd916af1ec8d40b7bf0
2019-01-11 13:29:09 +00:00
Chalard Jean
8c141bdb8f [MS01] Add the IP memory store service.
Bug: 116512211
Test: Added initial tests
Change-Id: I9d9af4097e3e2d7afd9956b9cbfa29a9f9558ae0
2019-01-11 15:00:36 +09:00
Ruchi Kandoi
96fe50bc1b Deprecate Android beam APIs and create a feature flag to gate them
Test: Test application trying to invoke the API
Bug: 117519147
Change-Id: Icd3187e4f3e0f180cb42d36011f60895fb395002
2019-01-04 21:49:00 +00:00
Ruchi Kandoi
54502d68ea Merge changes from topic "multi-se-support"
* changes:
  Add a mechanism to register AIDs to specific off-host SE
  Add Off-Host Card Emulation Features
2019-01-04 19:56:41 +00:00
Ruchi Kandoi
ebf267a2a4 Add Off-Host Card Emulation Features
Test: CTS test; manual
Bug: 117253962
Change-Id: I7c35b1bffbc57870bb8c67704811a2649854d94e
2019-01-03 23:00:59 +00:00
Treehugger Robot
645a9d1253 Merge "Fix @NonNull -> Nullable for Intent.replaceExtras()." 2019-01-02 22:49:30 +00:00
Mathew Inwood
55418eada5 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00
Remi NGUYEN VAN
c094a5402c Add NetworkStack app
The app is not started yet, and does not contain any service for now.

Test: built, booted
Bug: b/112869080
Change-Id: Id5a0fd02c891100e85d86b1040e53beec3581950
2018-12-25 11:42:42 +09:00
Tobias Thierer
139911745d Fix @NonNull -> Nullable for Intent.replaceExtras().
extras == null is documented to result in all extras being
erased, and the implementation handles it correctly. The
@NonNull annotation on Bundle extras is therefore wrong.
This CL replaces it with the correct annotation, @Nullable.

The incorrect annotation was introduced in April 2017
(commit 30e06bb668). I've
looked through the other changes to Intent.java in that
commit but have found no further nullability annotation
errors.

Bug: 121438778
Test: Treehugger
Test: Looked through the other nullability annotations on
      Intent.java introduced by the same commit
      30e06bb668 (Apr 2017)
      but found no further errors.

Change-Id: Iebbe17abc5c97146533e82114fbaf1d7036fd03a
2018-12-23 14:26:08 +00:00
Sahin Caliskan
4929a0d782 Merge "Move RCS APIs to android.telephony.ims" 2018-12-13 20:48:34 +00:00
Sahin Caliskan
7719db2b16 Move RCS APIs to android.telephony.ims
This is due to being compatible with other RCS related changes by by other engineers.
Test: Existing tests pass

Bug: 109759350
Change-Id: Id56df22e9c313c5e0700eda3b2c489d2f84ea0cd
Merged-In: Id56df22e9c313c5e0700eda3b2c489d2f84ea0cd
2018-12-13 16:50:28 +00:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Treehugger Robot
f64909587b Merge changes from topic "apex_adb"
* changes:
  Add MATCH_APEX flag to getInstalledPackages.
  Rename APEX installPackage method to stagePackage.
  Initial support for installing APEX via adb.
2018-12-04 12:29:06 +00:00
David Brazdil
ec62f08f8c Merge "hiddenapi: Add constants for 'greylist-max-p'" 2018-12-04 10:07:59 +00:00
Dario Freni
e8129a31bb Add MATCH_APEX flag to getInstalledPackages.
If set, PackageManager will query apexservice and ask for activated
packages.

Test: wrote a small app to test the new query.
Bug: 117589375
Merged-In: I498bd97896f3eab65c88e9684874a30713be585e
Change-Id: I498bd97896f3eab65c88e9684874a30713be585e
2018-12-03 22:29:31 +09:00
Dario Freni
e186f9981a Initial support for installing APEX via adb.
Test: adb install package-signed.apex (succeeds)
adb install package-unsigned.apex (fails)
Merged-In: I3ac7971ce6923511a7d574291fe9002c5d55fa1b

Change-Id: I53bd15286b62a2a4ae6c2c5746b2ed039bc6ff77
2018-12-03 22:28:15 +09:00
Nicolas Geoffray
e7753e084f Merge "Start using shared libraries class loader." 2018-12-02 20:39:38 +00:00
Nicolas Geoffray
972b39e4e4 Start using shared libraries class loader.
Change 1/2. Change 2/2 will setup the class loader namespace for
shared libraries.

This change sets up shared libraries class loaders for applications
and for dexopt.

bug: 111174995
Test: DexoptUtilsTest, device boots
Exempt-From-Owner-Approval: PS1 was approved by owner, PS2 is a build fix.

(cherry picked from commit 8d144eb8bd)
Merged-In: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d

Change-Id: I76383308418485ad6739f8a404d02c2771e4afe4
2018-12-02 20:39:29 +00:00
Jeff Sharkey
3e26b7db55 Extend SQLiteQueryBuilder for update and delete.
Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks.  This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.

Extend it to support selection arguments being provided when
appending appendWhere() clauses, meaning developers no longer need
to manually track their local selection arguments along with
remote arguments.

Extend it to support newer ContentProvider.query() variant that
accepts "Bundle queryArgs", and have all query() callers flow
through that common code path.  (This paves the way for a future
CL that will offer to gracefully extract non-WHERE clauses that
callers have tried smashing into their selections.)

Updates ContentValues to internally use more efficient ArrayMap.

Bug: 111268862
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Merged-In: I60b6f69045766bb28d2f21a32c120ec8c383b917
Change-Id: I60b6f69045766bb28d2f21a32c120ec8c383b917
2018-12-01 17:23:04 -07:00
David Brazdil
5cd148fc7a hiddenapi: Add constants for 'greylist-max-p'
New category of hidden API has been created. Update the script
generate_hiddenapi_lists.py with the new flag name.

Test: m, phone boots
Change-Id: I79e5478678880939e20e500cb8dad9b2a56fc84f
2018-11-29 15:43:02 +00:00
Sahin Caliskan
170c382729 Merge "Fix RcsManager and add empty RcsThread class" 2018-11-16 17:29:49 +00:00
Sahin Caliskan
1256486a8f Fix RcsManager and add empty RcsThread class
This change fixes the RcsManager setup and adds an empty RcsThread class. Please see go/rcs-in-telephony-doc for details.

Test: Builds fine
Bug: 109759350
Merged-in: Ie3fe476ab11d515ffab6dcc6ccf5ec801a4c9057
Change-Id: Ie3fe476ab11d515ffab6dcc6ccf5ec801a4c9057
2018-11-15 23:28:24 +00:00
Nicolas Geoffray
5e498b087a Make shared library dependencies explicit in SharedLibraryInfo
bug: 112405321
Test: boots, PackageParserTest
(cherry picked from commit 10b0779df8)

Change-Id: I506cdfdf0d2cb7948eacd3e2658d187f6259f4b9
Merged-In: I591c29f72ad95b2a8adb4a2242f1e764e0e29007
2018-11-15 20:31:31 +00:00
David Brazdil
a37a1edd73 Merge "Simplify HIDDEN_API_ENFORCEMENT_ flags" 2018-11-15 15:04:47 +00:00
Nicolas Geoffray
103454f0d6 Attach SharedLibraryInfo to a Package.
bug: 112405321
Test: boots, PackageParserTest
Change-Id: Ib218dac8f554505188990436cae4147666f3aece
Merged-In: Ib218dac8f554505188990436cae4147666f3aece
(cherry picked from commit abcd58e4a2)
2018-11-15 13:26:26 +00:00
David Brazdil
df1c7dc03d Simplify HIDDEN_API_ENFORCEMENT_ flags
Remove the distinction between pre-P and P apps and simplify the flags
to ENABLED, DISABLED and JUST_WARN.

Test: m
Merged-In: I87ef00a15ac9a3abfaeb011bbd8804b216f26c90
Change-Id: I31a6464bd95143e6242d043547a6a9ae8f9888bb
2018-11-14 16:49:42 +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
Nathan Harold
f5cf9f24ed Merge "Move some members to the "Q blacklist"." 2018-10-23 21:53:51 +00:00
Mathew Inwood
45d2c252b1 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 8c854f86a4)
2018-10-22 17:28:24 -07:00
Treehugger Robot
06182b0764 Merge "pm: Disallow HIDL libs from boot jars >= Q." 2018-10-22 07:08:10 +00:00
Jeff Sharkey
35f31cbac4 Recover shady content:// paths.
The path-permission element offers prefix or regex style matching of
paths, but most providers internally use UriMatcher to decide what
to do with an incoming Uri.

This causes trouble because UriMatcher uses Uri.getPathSegments(),
which quietly ignores "empty" paths.  Consider this example:

    <path-permission android:pathPrefix="/private" ... />

    uriMatcher.addURI("com.example", "/private", CODE_PRIVATE);

    content://com.example//private

The Uri above will pass the security check, since it's not
technically a prefix match.  But the UriMatcher will then match it
as CODE_PRIVATE, since it ignores the "//" zero-length path.

Since we can't safely change the behavior of either path-permission
or UriMatcher, we're left with recovering these shady paths by
trimming away zero-length paths.

Bug: 112555574
Test: atest android.appsecurity.cts.AppSecurityTests
Test: atest FrameworksCoreTests:android.content.ContentProviderTest
Merged-In: Ibadbfa4fc904ec54780c8102958735b03293fb9a
Change-Id: Ibadbfa4fc904ec54780c8102958735b03293fb9a
(cherry picked from commit c084ddbf82)
2018-10-20 00:17:43 +00:00
Amith Yamasani
553bb7c6a2 Keep app in high memory adjust if moving from TOP to FGS
If an app was in the TOP state and immediately moved
to a foreground service state, then try harder to keep it
in memory for another 20 seconds before releasing the
memory to bound foreground services. Using an oom_adj value
of 50 which is between "fore" and "vis". So BFGS apps might
get killed ("vis") before this recently FGS'ed app. That
way any app that has a lot of state in memory that it needs
to persist before getting killed has a chance to do so.

Also bind NotificationListeners with a special bind flag
to rank them below FGS (perceptible adj) so that they
can be killed before any other foreground services or
bound services get killed.

Bug: 110969183
Test: Manual for now. Take a bunch of portrait
      pictures and hit home, while being under memory
      pressure with a bunch of notification listeners.
Change-Id: Ie8934c2331afe6450c582b209869aeca7272f58a
Merged-In: Ie8934c2331afe6450c582b209869aeca7272f58a
(cherry picked from commit b735830a1e)
2018-10-20 00:17:38 +00:00
Steven Moreland
ae88825916 pm: Disallow HIDL libs from boot jars >= Q.
These two libraries:
android.hidl.base-V1.0-java
android.hidl.manager-V1.0-java

were removed from BOOT_JARS. This change disallows them to be used on
the classpath >= Q. They are still allowed to be used <= P for legacy
reasons.

Test: atest android.content.pm.AndroidHidlUpdaterTest
Test: build & boot Pixel 2
Fixes: 77307025

Change-Id: I7752812318030cbaa15f42301c168371ceade901
2018-10-17 18:17:33 -07:00
Chen Xu
652ec06948 Merge "refactor data/voice roaming states"
am: 6bd29ab2df

Change-Id: Iac8184fe2dfdb7ff4c3d93ecb7c0c9dd9a7a46a5
2018-10-12 11:20:18 -07:00
Chen Xu
6bd29ab2df Merge "refactor data/voice roaming states" 2018-10-12 18:02:17 +00:00
chen xu
0281169e6d refactor data/voice roaming states
1. migrate set/get roamingType from ServiceState to
NetworkRegState.set/get roamingType
2. migrate set/get roamingStateFromRegstate from ServiceState
to NetworkRegState.regState
3. new System API for neworkRegistration.isRoaming().

Bug: 116127096
Test: ServiceStateTest, ServiceStateProviderTest

Change-Id: Ib89744089c98713819c8d313240d629ddb77d0bf
2018-10-11 15:10:32 -07:00
Scott Kennedy
cecccf6258 Merge "Mark getInstallerPackageName @Nullable"
am: c41a5d6bc0

Change-Id: I9500bd37c872fac143074d9a79402d07b0c0419d
2018-10-10 14:57:22 -07:00
Scott Kennedy
98b5f8901b Mark getInstallerPackageName @Nullable
Test: Just an annotation

Change-Id: Ida4f40e77abec2bbf3791a6b38fdb729f6083811
2018-10-09 17:37:58 -07:00
Josh Gao
5c775ffdc8 Merge "Fix typo in IntentFilter documentation."
am: ada39fe63d

Change-Id: I9da782211b8a6766ceb6b17fdec3b31e2e884676
2018-09-17 19:59:26 -07:00