Commit Graph

8389 Commits

Author SHA1 Message Date
Tony Huang
40d8da39d2 Merge "Prevent return giant size thumbnail" 2019-10-30 06:39:53 +00:00
Philip P. Moltmann
128b70364e Note with featureId from ContentProvider
This takes the Context#getFeatureId from the calling context and pipes
it all way through to the noteOp calls done by the content provider.

Bug: 136595429
Test: atest CtsAppOpsTestCases (new test added to capture this case)
            TelecomUnitTests:CallLogManagerTest
	    ContentProviderClientTest
	    TelecomUnitTests:MissedCallNotifierImplTest
	    TelecomUnitTests:BasicCallTests
	    MediaInserterTest
	    PreferencesHelperTest
	    RankingHelperTest
	    PinnedSliceStateTest
	    FrameworksCoreTests:ContentResolverTest
Change-Id: I53b1035626229c920b353509a5bece157b52fb51
2019-10-29 15:41:28 -07:00
Varun Shah
69a85b9733 Merge "Remove XML write functions from UsageStats." 2019-10-28 18:03:52 +00:00
Tony Huang
de42137e55 Prevent return giant size thumbnail
Use Math.max rather than min to avoid return giant size thumbnail.

Fix: 143267761
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Change-Id: Ib7ddc6f4daa364a6402f72852e0b7995a3c9ec0c
2019-10-28 14:23:19 +08:00
Roshan Pius
748c9c61a9 Merge "Add a new BatteryStatsManager class" 2019-10-27 00:09:50 +00:00
Roshan Pius
848513ebe6 Add a new BatteryStatsManager class
Wifi/telephony mainline modules uses IBatteryStats which is an AIDL &
hence cannot be made a @SystemApi. Create a new manager class to wrap
around this AIDL to expose @System Api.

Bug: 138806762
Test: Device boots up & connects to wifi networks.
Change-Id: Ib8816c3df17ccc562b9664e7bea1ef01ab61f697
2019-10-26 14:43:59 -07:00
Hui Yu
6d5c3b9636 Do not print Intent ClipData in logcat/dumpsys output.
Change-Id: I7472248777bcff01a8db3be707c19dfab098213a
Fix: 142834800
Test: the reproduce steps in b/142834800
2019-10-25 23:05:22 +00:00
TreeHugger Robot
ab42f6761b Merge "Delete VerificationParams." 2019-10-24 19:34:20 +00:00
Pinyao Ting
6dcd113c15 include a requireContext method for better kotlin inter-operability
Bug: 139754067
Change-Id: I3dd0e2c7b08ecf69bcbdab6e146c6fddb7d64783
Test: Manual
2019-10-23 17:09:48 +00:00
Varun Shah
21c82c3ebd Remove XML write functions from UsageStats.
UsageStats has moved away from XML and is now using protos. This removes
dead XML write functions which should ideally never be triggered. A
warning will be logged when reading XML data and a WTF when some
codepath attempts to write data in XML.

Certain tests are now marked as ignored since the XML write functions are
removed. It was decided to not move those functions into the test context
since the read/write code is so intertwined within the database logic.

Bug: 143187610
Test: atest UsageStatsDatabaseTest
Change-Id: If622b646e0edfe389e49aec9b51accdb9fbf1f45
2019-10-22 21:42:32 -07:00
Kevin Hufnagle
c129fea207 Merge "docs: App doesn't receive "first launch" broadcast" into qt-dev am: 0823f1b508 am: e7832d514b am: d6105c8316
am: 76dd46c992

Change-Id: Ie81d37ffde2e639929fa3a72dbbdc92b9d8e7b4d
2019-10-21 16:09:38 -07:00
Kevin Hufnagle
76dd46c992 Merge "docs: App doesn't receive "first launch" broadcast" into qt-dev am: 0823f1b508 am: e7832d514b
am: d6105c8316

Change-Id: Ie4a9c26029d31be6b31a29856423f298274b3dff
2019-10-21 15:57:10 -07:00
Kevin Hufnagle
d6105c8316 Merge "docs: App doesn't receive "first launch" broadcast" into qt-dev am: 0823f1b508
am: e7832d514b

Change-Id: Ib2590dc07f3aa284c993bd4c65772277ea457727
2019-10-21 15:51:06 -07:00
TreeHugger Robot
7bd4314e4e Merge "Add a native aidl API." 2019-10-21 18:29:47 +00:00
Anthony Hugh
1fdc3dcf5c Merge "Update UserInfo.supportsSwitchToByUser to support Headless User Mode" 2019-10-21 17:26:55 +00:00
Alan Stokes
baa2b8c467 Delete VerificationParams.
It's no longer used anywhere except in its tests which are also
deleted. This wasn't removed as part of b/24542768 but there no longer
seems to be any reason to retain it.

Test: Still builds
Change-Id: I08584959a215b37cbca77cd438d42a6db0369ecd
2019-10-21 15:13:11 +01:00
TreeHugger Robot
4465222d58 Merge "Context#createFeatureContext is not implemented by superclass" 2019-10-19 17:06:40 +00:00
Felipe Leme
3cbb257821 Fix UserInfo Parcel
am: 5284336dec

Change-Id: I3af8a8c64137320124df6a1adc698cb0501f68d4
2019-10-18 13:32:17 -07:00
Felipe Leme
6400043a6e Added option to pre-create user templates to optimize first user creation time.
am: 7ad2f6bdad

Change-Id: I8594bfe6912e56b32b7cda0ee1a321f098264d5b
2019-10-18 13:07:52 -07:00
Felipe Leme
5284336dec Fix UserInfo Parcel
ag/9372503 put the order of reading preCreated from a UserInfo parcel
in the wrong spot. We fix it here.

Test: none
Merged-In: I4502e901ff2aac977c584fa8c5a3d1263be33572
Change-Id: I4502e901ff2aac977c584fa8c5a3d1263be33572
(cherry picked from commit e80af14d33)
2019-10-18 13:07:13 -07:00
Fan Zhang
5431ef5394 Introduce telecom api to launch emeregency dialer.
Test: manual
Bug: 136194151
Change-Id: I5c9732062e5123539343843fb9a9ae3ca7111890
2019-10-18 18:12:15 +00:00
Felipe Leme
7ad2f6bdad Added option to pre-create user templates to optimize first user creation time.
Initial user creation is slow because the system must prepare per-user data (like storage and
permissions) whose cost is proportional to the number of pre-installed apps. On automovive's
reference implementation, it can take more than 10s, which is a bad user experience.

This change lets OEMs pre-create some users , so that high initial-creation cost is "paid" during
the initial boot. On automotive, it improves the creation of an additional user (or guest user)
in about 7s (from ~17s to 9s).

Bug: 111451156
Bug: 132111956
Bug: 140750212
Bug: 140868593

Test: manual verification
Test: atest FrameworksServicesTests:UserControllerTest#testStartTemplateUser_background

Merged-In: I81de1b5376dc9c42b63be8853d7204c88826401f
Change-Id: I81de1b5376dc9c42b63be8853d7204c88826401f
(cherry picked from commit c1ca4410e1)
2019-10-18 11:05:06 -07:00
Philip P. Moltmann
f1a634cbd7 Context#createFeatureContext is not implemented by superclass
Throw a exception so that no dev assumes that it is.

Test: CtsAppOpsTestCases (the only code calling the API for now)
Change-Id: I8ff2a8288ec908d49ec708b710045a230333e5d0
2019-10-18 09:10:56 -07:00
Philip P. Moltmann
c9bb90c0e0 Merge "Add feature context" 2019-10-18 02:26:08 +00:00
TreeHugger Robot
c0581181c8 Merge "Ensure #openTypedAssetFileDescriptor doesn't lose extras." 2019-10-18 01:11:23 +00:00
Varun Shah
840a9c4ea4 Ensure #openTypedAssetFileDescriptor doesn't lose extras.
ContentResolver#openTypedAssetFileDescripor was not passing extras from
the file descriptor when creating the AssetFileDescriptor. This ensures
the extras are passed along as well.

Fixes: 135510219
Test: atest ContentResolverTest
Test: atest ContentResolverWrapTest
Test: atest ContentProviderClientTest
Change-Id: I2a7ed6d1bf0bcd31feb632be5c84baeae15e7024
2019-10-17 16:12:42 -07:00
Philip P. Moltmann
59076d8957 Add feature context
Currently only used by app-ops, but can be used by other modules too.

AppOps will collect app-ops based on feature. Only the most basic
parts of app-ops are supporting features yet. The rest will be added
later.

Test: atest CtsAppOpsTestCases
      atest RunSettingsLibRoboTests
      atest com.android.server.wm.ActivityStarterTests
      m -j doc-comment-check-docs
Bug: 136595429
Change-Id: Ia664f4ff1c1c2ceea721d76dc491ec50c237e9ce
2019-10-17 14:15:07 -07:00
Anthony Hugh
75908bcb4d Update UserInfo.supportsSwitchToByUser to support Headless User Mode
Updates UserInfo.supportsSwitchToByUser() to support the headless system
user mode.

Fixes: 142492424
Test: Check user picker in UI and see that it works
Change-Id: I46addf60b02025b882c705c292bca3335d0f0596
2019-10-17 13:51:01 -07:00
Chen Xu
3321171cc7 Merge "non-mainline telephony related AIDL refactor/decoupling" 2019-10-17 18:27:13 +00:00
atrost
685cbc125a Don't call platformCompat on system apps.
To avoid boot time regression in tests, as compat doesn't care about
system apps.
Also fix the fallback condition to be correct.

Bug: 30188076
Bug: 142558883
Test: atest google/perf/boottime/boottime-test -v - no binder calls,
no time regression.

Change-Id: I15fd39ad7e0ed70fcd880a13cffa40d70c5bba55
2019-10-17 15:42:45 +01:00
atrost
874883536a Add a native aidl API.
Introduce a platform_compat_native service that just calls the
platform_compat service.
The new service is needed as it needs a slightly different (more
limited, no ApplicationInfo in cpp) aidl API, and a class can only
extend one stub.

Test: Call the service from dumpsys.cpp (http://aosp/1142055)
Bug: 138275545
Change-Id: Ic46cc34b4c1dd4ebc6bcc996fb3f8503607214ac
2019-10-17 11:53:47 +01:00
Chen Xu
1f6cfa5399 non-mainline telephony related AIDL refactor/decoupling
1. decouple IOnSubscriptionChangedListener AIDL from telephonyMainline
2. other refactor. moving APIs which will not be included in
telephony mainline to frameworks/base/core/java/android/telephony.
Moving internal classes like AIDL which will not be included in
telephony mainline to
framework/base/core/java/com/android/internal/telephony

Bug: 140908357
Test: Build & unit test
Change-Id: I9413ef758cceadd251d03f3b5ea1054cc48ef044
2019-10-16 15:30:24 -07:00
Varun Shah
8c80a3f774 Remove manual descriptions of nullability in docs.
Auto-documentation adds nullability info for parameters in docs. The
manual info about nullability causes confusion and might not always be
up to date so remove it from the ContentProvider docs.

Fixes: 140541978
Test: n/a
Change-Id: I3847bbb35601f516c11370e74dd8b6734c289f68
2019-10-16 12:21:19 -07:00
Alan Stokes
69d2abf4c5 Add InstallSource to hold trustable installer information.
Create a new class which will hold persisted information about how an
app was installed that cannot be modified, even by the installer of
record or an app with INSTALL_PACKAGES permission.

Add a first field to hold the package name of the app that initiated
the install session.

Plumb this into SessionParams, PackageInstallerSession, InstallParams,
InstallArgs, PackageSettings, PackageProto, ActiveInstallSession etc.

Various minor refactorings along the way.

Bug: 134746019
Test: atest -p services/core/java/com/android/server/pm
Change-Id: I96d9b5034bc98af8c63088df2341e6d4a1fb1b6e
2019-10-16 09:55:24 +01:00
Ryan Mitchell
d2eebf1840 Merge "Revert "Revert "Remove overlay logic from package manager and parser""" 2019-10-15 22:06:41 +00:00
Kevin Hufnagle
49d171d595 docs: App doesn't receive "first launch" broadcast
Test: make ds-docs -j32

Bug: 116543817
Change-Id: I9aa1f1851ce236397ad2e1a36ea487b96daa55c5
2019-10-15 19:47:38 +00:00
Abhijit Adsule
95862c5724 Add feature to disable slices
Bug: 142022263
Change-Id: I090b4c1460fcc4784e9e901847829ee61bfc31ef
2019-10-15 10:11:16 -07:00
TreeHugger Robot
6b905bca2f Merge "Explicitly take flags in createContextAsUser()" 2019-10-15 04:11:04 +00:00
Makoto Onuki
e5449f0b34 Explicitly take flags in createContextAsUser()
Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id2e3d5ffe5887a4916e0872a7e85d62cbb439744
2019-10-14 11:09:00 -07:00
Roshan Pius
73266f2f64 Add a new wifi protection level
Wifi mainline module needs some permissions which are currently only
granted to signature components. Since mainline modules are not going to
be signed with OEM's signature, we need a new protection level to grant
some of these permissions to the wifi mainline APK.

Bug: 142234604
Test: Verified that wifi can get INTERACT_ACROSS_USERS_FULL permission
Change-Id: I26b0edff62497b5e08c2f2f504b0cd5f950682ad
2019-10-12 20:23:10 +00:00
Chen Xu
176dd6b7aa Merge "add a new telephony protection level" 2019-10-12 05:58:56 +00:00
Chen Xu
45c183d201 add a new telephony protection level
for oems which take telephony mainline module, all telephony related
apks will be signed with non-platform certificate. that said apks won't
be able to grant platform signature permission. Solution is to add a new
telephony protection level.

Bug: 141479803
Test: cts & manual
Change-Id: Ib3be016080d42fd76e7c131f4e44d815ce431e6e
2019-10-11 13:46:01 -07:00
Winson Chiu
8e4f087cc1 Merge "Add ResourceLoader API with .apk and .arsc support" 2019-10-11 18:05:00 +00:00
Jeff Sharkey
1a4223e543 Merge "Reveal color standard, transfer, and range." 2019-10-11 17:21:01 +00:00
Jeff Sharkey
588c15e56e Reveal color standard, transfer, and range.
We've already been parsing them for many years, and they're well
defined by other public APIs, so let's reveal them in MediaStore.

Also get some storage-related documentation updated to guide
developers towards replacements in a post-scoped-storage world.

Bug: 140247264, 139185855, 141523097, 139185322
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: Id39a74a9972a330b3f83913b2eef5100ec59627d
2019-10-10 17:44:57 -06:00
Winson
9947f1e4fa Add ResourceLoader API with .apk and .arsc support
ResourceLoaders allow inserting another .apk/.arsc into AssetManager's
resource resolution search. The effect is similar to overlays,
where a entry of >= config later in the path list will return that
ApkAsset's resource value instead.

Because loading from an .arsc is supported, which doesn't contain
any actual files, ResourceLoader exposes loadDrawable and
loadXmlResourceParser to allow an application load those files from
anywhere or create them in code.

The data being loaded is either pushed into an .apk or .arsc that
mocks itself as the package being "overlaid" and is passed in
through ResourcesProvider, an interface with static methods that
supports loading from a readable path on disk or a FileDescriptor.

The APIs are accessed through a Context's getResources(), which
has been changed to be unique per "Context-scope", which is usually
the lifetime of the Java object. The exception is that Activities
who get their Resources object persisted across recreations
maintain that logic for persisting ResourceLoaders.

Bug: 135270223

Test: atest FrameworksResourceLoaderTests

Change-Id: I6929f0828629ad39a21fa155e7fec73bd75eec7d
2019-10-10 15:41:03 -07:00
Mårten Kongstad
bff3fd7500 OMS: fix Javadoc copy-and-paste error
The Javadoc for OverlayManager#invalidateCachesForOverlay was mistakenly copied
from OverlayManager#getOverlayInfosForTarget.

Test: builds
Change-Id: I1e12e8f52262619e9ac55fdeb8833cd8a110fa55
2019-10-10 12:45:07 -07:00
Makoto Onuki
701edd6c0c Merge "Add Context.createContextAsUser()" 2019-10-10 18:52:49 +00:00
Ryan Mitchell
e6d7a2d022 Revert "Revert "Remove overlay logic from package manager and parser""
This reverts commit 08e4756fd3.

Change-Id: I10fda3e01e9dcdaa282a299e910e0c70b3c9fd56
2019-10-10 18:01:46 +00:00
Makoto Onuki
b844001d6a Add Context.createContextAsUser()
Without it, apps (mainline modules) will need to use createPackageContext...,
which is a bit painful.

Bug: 142472686
Test: atest android.content.cts.ContextTest#testCreateContextAsUser
Change-Id: Id640e03862462724df1a4a3101f0b08faafba22f
2019-10-10 15:58:20 +00:00