Commit Graph

13597 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
Pavel Grafov
2b60849c5c Whitelist packages from VPN lockdown: DPM API.
Bug: 77468593
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7508070f828fb7150df5d9e34846535d57c6a7c3
Merged-In: I7508070f828fb7150df5d9e34846535d57c6a7c3
2019-01-29 21:49:07 +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
Dan Albert
9f73671651 Merge "Revert "Whitelist packages from VPN lockdown."" 2019-01-24 21:08:46 +00:00
Dan Albert
ee8e6a0fae Revert "Whitelist packages from VPN lockdown."
This reverts commit bb9cef04c5.

Reason for revert: broke pi-dev-plus-aosp

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68
2019-01-24 21:05:39 +00:00
Treehugger Robot
8b5917965d Merge "Add API for proxy configuration over VPN." 2019-01-24 17:52:22 +00:00
Pavel Grafov
bb9cef04c5 Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
Merged-In: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
2019-01-24 16:17:11 +00:00
Irina Dumitrescu
044a436ac9 Add API for proxy configuration over VPN.
Test: runtest -x
frameworks/base/tests/net/java/com/android/server/ConnectivityServiceTest.java
&& atest HostsideVpnTests
Bug: 76001058
Change-Id: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a
Merged-In: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a
2019-01-24 16:07:20 +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
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
Paul Duffin
bf76cf7c82 Remove uses of libcore.io DropBox and EventLogger
DropBox and EventLogger provide hooks for use by framework to intercept
messages sent by libcore. However, neither of these mechanisms are
actually used by libcore so there is no point in framework code using
it.

(cherry picked from commit ecb6124d54)

Bug: 119748341
Test: make checkbuild, flash
Merged-In: I9dbd1b6dea92f7441efb6d0a579efd13bc0e5139
Change-Id: I65425e49ab9ad9752b65772d27f788d1a674eeff
2018-12-17 12:10:11 +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
Adrian Roos
a48e431113 Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi (2/2)" 2018-12-13 13:19:25 +00:00
Treehugger Robot
a32f898720 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" 2018-12-13 05:45:20 +00:00
Adrian Roos
45bd532822 API: Clean up redundant and ineffective usages of SystemApi and TestApi (2/2)
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Change-Id: I6d370e8ffcb9e7cd2859c310c555a2a847c70ae8
Exempt-From-Owner-Approval: API cleanup
2018-12-12 19:11:50 +01:00
Adrian Roos
6115769c16 API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-12 15:02:26 +01: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
David Brazdil
385c42a2e9 Merge "Move DexLoadReporter setup before AppComponentFactory calls" 2018-12-07 09:04:56 +00:00
David Brazdil
991ff90e73 Move DexLoadReporter setup before AppComponentFactory calls
BaseDexClassLoader has a callback for reporting all loaded secondary dex
files to DexManager. The callback needs to be set up:
(a) after the default app class loader is initialized, so as to not
report the app's main APK being loaded, and
(b) before control is handed over to the app for the first time, so as
to not miss any BaseDexClassLoader instantiations.

The latter used to mean setting up the callback before
Application.onCreate() but AppComponentFactory calls happen even
earlier. Hence move the call into LoadedApk where the borderline between
(a) and (b) lies.

Test: manually check dex loads from instantiateClassLoader are reported
Change-Id: I7961913de302bcede6c231304544d21d8db806a8
2018-12-03 10:59:45 +00: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
SzuWei Lin
1c7ae31e97 Nullify the default wallpaper component if it does not exist
The default wallpaper component cannot be found after GSI is flashed.
The home screen background will have no wallpaper and be black.
It will also cause the following CTS tests to fail:

- KeyguardTests#testDialogShowWhenLockedActivity
- KeyguardTests#testTranslucentShowWhenLockedActivity

The patch will check if the package of the default component exists.
If not, it will fall back to null, which is the AOSP default value, and
display the wallpaper in framework resource.

Bug: 119895131
Bug: 111909699
Test: flash GSI aosp_arm64-userdebug on a crosshatch, got AOSP wallpaper
Test: flash full crosshatch-userdebug on a crosshatch, got crosshatch wallpaper
Change-Id: I9d618d05458a03a675324cb2f861decf31c5bf18
2018-11-30 13:33:55 +08:00
Neil Fuller
b8383a10b9 Track move of timezone classes to libcore.timezone
Some time zone related libcore classes are moving from
libcore.util to libcore.timezone.

Bug: 119026403
Test: build only
Change-Id: Ic807977a85276b888362295d1d305effe33076fc
2018-11-27 14:44:59 +00:00
David Brazdil
b319ccfdcc Create AppComponentFactory.instantiateClassLoader API
Adds a hook to AppComponentFactory to allow control over the
instantiation of the main app class loader. LoadedApk creates
the default class loader and uses it to load the base APK. If
AppComponentFactory is declared in the manifest, its new method
instantiateClassLoader is called and its result becomes the
class loader used by LoadedApk to instantiate other classes
declared in the manifest. By default this is simply the class
loader created by LoadedApk.

Second method provides AppComponentFactory with a copy of
ApplicationInfo. The factory otherwise cannot locate any of the
app's resources, including its APK or the data folder.

Bug: 111342996
Test: atest CtsClassLoaderFactoryPathClassLoaderTestCases
Test: atest CtsClassLoaderFactoryInMemoryDexClassLoaderTestCases
Merged-In: Id21d9afaf00b9cb64a107bc9893b952407cff0b5
Change-Id: Id21d9afaf00b9cb64a107bc9893b952407cff0b5
(cherry picked from commit fd6dcc21d9)
2018-11-19 17:47:13 +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
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
David Brazdil
c2a8de549b Remove non-SDK API toast
It served its purpose but it's time to remove it.

Test: m
Change-Id: Idc36cacae89e74f5ce01bcf51dce24cdedfda40f
2018-11-01 10:05:28 +00:00
Tim Murray
12f511e1ab ActivityThread: purge jemalloc at appropriate times
Don't let jemalloc sit around with unused pages.

Test: boots, works
bug 117795621

Change-Id: I1fc3fcf5aa2798c67ea8cada6eeec852b2bebee7
(cherry picked from commit 7745ba061a0ef3e20470ed98267e2062b407ba79)
2018-10-26 20:57:20 +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
Mike Ma
8964390dd3 Merge "Avoiding potential NPE when dumping to proto."
am: a52b601ef3

Change-Id: I9d5e520654877e6a46ea19ad3eddd3a901e58699
2018-09-11 18:26:45 -07:00
Kweku Adams
ce8e43f8d2 Avoiding potential NPE when dumping to proto.
Inspired by aosp/736453. Cherry-picked from ag/4934453

Bug: 113087610
Test: Android builds
Change-Id: I9f0dae9cd5a839947c7ed150980eb30b928beef7
2018-09-11 19:21:52 +00:00
Mathew Inwood
2e5fdd0051 Merge "Add @UnsupportedAppUsage annotations"
am: 9137ecafbd

Change-Id: I467341cc8f70554f58266ddc28ff3a648ec5cc18
2018-08-30 08:57:54 -07:00
Mathew Inwood
71da3a1fe4 Add @UnsupportedAppUsage annotations
For all remaining unannotated code.

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I32861fa341a08f11a9c50c07a1ef7404dadf6bb6
Merged-In: I67c8b71ea535ebffb10bf577948bd4ccb8ca069d
2018-08-30 13:38:01 +01:00
Jorim Jaggi
e387ce18d8 Merge "BootAnimation: Fix boot animation with hidden cutout" into pi-dev 2018-08-22 23:06:35 +00:00
Adrian Roos
9ee5dff83c BootAnimation: Fix boot animation with hidden cutout
We do this by storing the masking inset in a persistent property.
The boot animation then animates itself to where it would be if that
masking inset were applied, then changes the viewport.

For this to work, we also need to make sure the DisplayManagerService
has the right overlay right at the start.

Bug: 112876936
Test: Hide cutout, then reboot. Verify boot animation is smooth.
Change-Id: I3e988b2340b2e0d2be3939bdc6878704c234ccc8
2018-08-22 21:37:39 +01:00
Jorim Jaggi
2bd9a25007 DO NOT MERGE Kill most processes when display size changes
This isn't something apps generally can handle, so we kill all of
them for now.

Test: Change cutout overlay that changes display size
Test: Rotate screen
Bug: 112876936
Change-Id: Ic3b0f1b3ae1e9bd93ac8f2c6952aa093878602b8
2018-08-22 14:22:56 +02:00
TreeHugger Robot
c9443e3894 Merge "Improved AutofillManager and Activity dump() methods:" into pi-dev 2018-08-21 01:18:09 +00:00
Richard Uhler
a6ab55dc11 ResourceManager: Disable APK Assets cache for real.
Test: atest -v google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test
Bug: 111385832
Change-Id: I5610b42b51d3b12cc8587cae6556557362bf67d0
(cherry picked from commit 93090515b9)
2018-08-20 16:05:35 +01:00
Narayan Kamath
77e9589274 ResourceManager: Disable APK Assets cache.
The WeakReference based cache of Assets in use elsewhere in the
process remains unchanged.

Note that this change is larger than it needs to be because it is
an error to create an LruCache of size zero.

There seems to be no measurable difference as measured by the standard
app startup benchmarks.

Test: atest -v google/perf/app-startup/benchmark-app-hermetic/cold-dropcache-test
Bug: 111385832
(cherry picked from commit bc95621811)

Change-Id: Ib7a52bd03f6f13cdb76b82abc307d17227c4c1dc
2018-08-20 16:04:21 +01:00
Felipe Leme
4226033998 Improved AutofillManager and Activity dump() methods:
- Print compatibility mode info and activity token on AutofillManager.dump().
- Add --autofill option on Activity so it just dump autofill state.

Also fixed checkstyle import warnings on ActivityManagerShellCommand.

Bug: 112417431
Bug: 112584717

Test: adb shell dumpsys activity top --autofill

Change-Id: Id56b56a5d7e591d5204663a1da1322a15f8ef3aa
(cherry picked from commit b546ca7916)
2018-08-17 14:18:37 -07:00
Laura Davis
43e75d98d8 Docs: Inserted links to relevant guide pages.
This is the proof of concept for adding relevant
links in API pages to narrative content.
The design doc is hosted at:
https://docs.google.com/document/d/1Y6bFua27Gs7ONZ27gz0nHz3Djv0WND_V_rX-XvbeB3U/edit?usp=sharing

Test: make ds-docs

Bug: 112478848
Change-Id: Ic3842629c802fe89582d4d7b4a153e54d4ba1713
2018-08-16 16:57:18 -07:00
Mathew Inwood
62a722476a Merge "Add @UnsupportedAppUsage annotations"
am: d08509363c

Change-Id: I380a6ba241998dbc694716986521dfcbf66fa7d2
2018-08-15 07:57:40 -07:00
Mathew Inwood
4fb17d17ca Add @UnsupportedAppUsage annotations
For packages:
  android.app.usage
  android.app.trust
  android.app.timezonedetector
  android.app.timezone
  android.app.timedetector
  android.app.job
  android.app.backup
  android.app.assist
  android.app.admin
  android.app

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I5d15d50344d7178617418846917f693cfabf006b
Merged-In: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
2018-08-14 14:25:44 +01:00
Malcolm Chen
9afe59bf1c Have proper permission check in getConfigForSubId
In CarrierConfigManager, add pass context in constructor, so that
when calling CarrierConfigLoader#getConfigForSubId, it can pass
callingPackage.

Bug: 73136824
Test: regression
Change-Id: I4bbff4ea30e2d5473c14d24d6833bf3ca3c595ec
Merged-In: I4bbff4ea30e2d5473c14d24d6833bf3ca3c595ec
2018-07-31 18:43:01 -07:00
Malcolm Chen
05ab439039 Have proper permission check in getConfigForSubId
In CarrierConfigManager, add pass context in constructor, so that
when calling CarrierConfigLoader#getConfigForSubId, it can pass
callingPackage.

Bug: 73136824
Test: regression
Change-Id: I4bbff4ea30e2d5473c14d24d6833bf3ca3c595ec
Merged-In: I4bbff4ea30e2d5473c14d24d6833bf3ca3c595ec
2018-07-30 17:08:27 -07:00