Commit Graph

7334 Commits

Author SHA1 Message Date
TreeHugger Robot
84686f1140 Merge "Resolve all browsers even if there is a default browser." 2019-01-19 06:55:12 +00:00
Eric Holk
a1485f61e9 [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
Change-Id: If6455e1b9b0542a36882af9f3e29d0185a53393c
2019-01-18 18:14:54 -08:00
Ryan Mitchell
d906d809fb Merge "Add enforcement of overlayable targetName" 2019-01-19 02:01:23 +00:00
Hai Zhang
e029713362 Resolve all browsers even if there is a default browser.
PackageManager.queryIntentActivities() handles browser intent
differently when there is a default browser, and only returns the
default browser. Previous code for querying all the browsers all
passed in the PackageManager.MATCH_ALL flag and filtered the result
manually, so we move that logic into RoleBehavior.

Bug: 110557011
Test: build
Change-Id: I928f13d27aca64d49f625dd1ffbd3262b42a06cd
2019-01-18 16:58:56 -08:00
Winson Chiu
235ab33363 Merge "Fallback to regular XML Drawable if ColorStateList loading fails" 2019-01-19 00:00:25 +00:00
Varun Shah
de77b6fee7 Merge "Clarified CrossProfileApps API and documentation." 2019-01-18 23:25:07 +00:00
TreeHugger Robot
20581a3578 Merge "Revert "Suppress injected launcher activity for apps that are vouched"" 2019-01-18 23:12:57 +00:00
Nick Kralevich
1bf9eb3c3e Revert "Suppress injected launcher activity for apps that are vouched"
This reverts commit 8b45da9025.

Reason for revert: Local TOT is crashing with framework restarts, with the following stacktrace:

01-18 12:22:51.536  9326  9352 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.bg
01-18 12:22:51.536  9326  9352 E AndroidRuntime: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.PACKAGE_CHANGED dat=package:com.verizon.mips.services flg=0x5000010 (has extras) } in com.android.server.pm.LauncherAppsService$LauncherAppsImpl$VouchesChangedMonitor@c231445
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1554)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at android.os.Looper.loop(Looper.java:209)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:65)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to read from field 'android.os.Bundle android.content.pm.PackageItemInfo.metaData' on a null object reference
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at com.android.server.pm.LauncherAppsService$LauncherAppsImpl.updateVouches(LauncherAppsService.java:485)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at com.android.server.pm.LauncherAppsService$LauncherAppsImpl.updateVouches(LauncherAppsService.java:481)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at com.android.server.pm.LauncherAppsService$LauncherAppsImpl.access$200(LauncherAppsService.java:121)
01-18 12:22:51.536  9326  9352 E AndroidRuntime: at com.android.server.pm.LauncherAppsService$LauncherAppsImpl$VouchesChangedMonitor.onPackageModified(LauncherAppsService.java:916)

Change-Id: If22d2355e17101bbf3e958b42ee101828f3ec532
2019-01-18 20:32:14 +00:00
Winson
9653d66a75 Fallback to regular XML Drawable if ColorStateList loading fails
Before ag/4829987, if a drawable.xml was misplaced in res/color, but was loaded as a drawable, ResourcesImpl would correctly load it as drawable instead of a color.

Post those changes, the file name is checked, and all res/color files are forcibly loaded as colors. This adds a fallback such that if loading as color fails, an attempt is made to load as a normal drawable.

Bug: 122025886

Test: validated using test application loading layer-list inside res/colors

Change-Id: Ieed9b4d22bc85fdc7390de700fad7b03c9aad511
2019-01-18 12:11:55 -08:00
Ryan Mitchell
a362846d4d Add enforcement of overlayable targetName
Adds android:targetName to the overlay manifest attributes and
PackageParser reads the name into PackageInfo. Specifying
android:targetName on an overlay allows the overlay to be associated
with a particular set of overlayable resources. The overlay can only
override the values of the resources defined within the target
overlayable element.

Test: idmap2_tests
Bug: 119390855
Bug: 110869880

Change-Id: I1128274af4cae983f61ae15cdfcbface63233ff2
2019-01-18 11:47:20 -08:00
Aurimas Liutikas
feccee99fa Merge "Remove old private constant from ResourceId." 2019-01-18 16:53:46 +00:00
Ricky Wai
8b45da9025 Suppress injected launcher activity for apps that are vouched
Test: atest com.android.server.pm.LauncherAppsServiceTest
Bug: 120904599
Change-Id: Iad66a69113d077604f108786d57c9252d2beb8a2
2019-01-18 14:16:37 +00:00
Varun Shah
bdb849f8b1 Clarified CrossProfileApps API and documentation.
Changed CrossProfileApps#startAnyActivity to #startAcitivty.

Updated documentation for the usage of startActivity vs startMainActivity.
Also clarified that the INTERACT_ACROSS_PROFILES permission is a two-way
channel between personal and managed profiles.

Bug: 122886462
Test: n/a (documentation changes only)
Change-Id: I67772aef0cf24110432a2dbde0f87c91354fd4a0
2019-01-17 22:56:03 -08:00
Mehdi Alizadeh
b4367b7bab Merge changes from topic "shortcuts-for-sharing"
* changes:
  Disable the use of new share target API in ShareSheet
  Loads direct share targets from ShortcutManager in ShareSheet
2019-01-18 02:42:32 +00:00
Mehdi Alizadeh
fd4055bb0c Merge "Adds API to set persons and isLongLived in ShortcutInfo" 2019-01-18 01:12:01 +00:00
Aurimas Liutikas
d8ebfefcee Remove old private constant from ResourceId.
Bug: 122967079
Test: make -j builds
Change-Id: I3e999044df02549e84208d38bb77d2ce1d1bd73b
2019-01-17 12:51:58 -08:00
Aurimas Liutikas
01c7237439 Merge "Add ID_NULL constant to Resources." 2019-01-17 20:47:59 +00:00
Mehdi Alizadeh
406e8b36a1 Loads direct share targets from ShortcutManager in ShareSheet
Bug: 111698461
Test: Manual test using test app
Change-Id: I4f315d186363cc76578ee551cc55349e3e266593
2019-01-17 11:52:39 -08:00
Aurimas Liutikas
8338623a70 Add ID_NULL constant to Resources.
Bug: 122967079
Test: cts in same topic
Change-Id: Ic6e2da137554a967b379b30c0d2d37341941a117
2019-01-17 18:20:27 +00:00
Stanislav Zholnin
2452709418 Merge "Added a new set of permissions for DeviceConfig API." 2019-01-17 10:16:25 +00:00
TreeHugger Robot
9ab55d9a14 Merge "Fix default of extractNativeLibs in parseBaseApplication" 2019-01-16 23:26:46 +00:00
Aurimas Liutikas
428ddacfa4 Merge "Add source style for each TypedValue." 2019-01-16 21:48:46 +00:00
TreeHugger Robot
8e0e5722f8 Merge "Pre-grant location permisson to location extra packages." 2019-01-16 21:17:40 +00:00
Stanislav Zholnin
596437fd4e Added a new set of permissions for DeviceConfig API.
Permissions READ_DEVICE_CONFIG and WRITE_DEVICE_CONFIG are required to
use DeviceConfig API. Actual checks for new permissions are not added
as we are waiting for gmscore to include them into manifest.

Also added "configurator" protection flag.

Test: atest FrameworksCoreTests:DeviceConfigTest
      atest FrameworksCoreTests:SettingsProviderTest
      atest SettingsProviderTest:DeviceConfigServiceTest
Bug:109919982
Bug:113100523
Bug:113101834
Bug:117663715
Change-Id: I66c256b57c5491201c6c7834620a287b6c81c23c
2019-01-16 10:50:51 +00:00
Aurimas Liutikas
ce7c99c661 Add source style for each TypedValue.
This API will be used by Android Studio layout inspector to
query where a given resource attribute originated from to allow
developers to have an easier way to find what needs to be changed
to affect a given resource attribute.

Test: CTS added in the topic
Bug: 111439551
Change-Id: Ifbb52b39912ed0444030a86164290a1cd4155250
2019-01-15 16:11:23 -08:00
TreeHugger Robot
ac729c48e9 Merge "PackageParser: Add support for parsing codeNames with fingerprints." 2019-01-15 22:42:52 +00:00
Nikita Dubrovsky
c834fd1133 Merge "Update deprecation javadocs of APIs related to preferred activities" 2019-01-15 21:50:44 +00:00
Narayan Kamath
71fcc14e3f PackageParser: Add support for parsing codeNames with fingerprints.
In addition to supporting manifest declared codenames of the form
"[codename]", also support codenames of the form "[codename].[fingerprint]".

Also makes cosmetic changes to PackageParserTest to produce better
failure messages when the test fails.

Test: PackageParserTest

Change-Id: If5e38614a1a3aa04035f14acfda41d0c1cd86e15
2019-01-15 20:13:48 +00:00
Winson Chiu
55d9a6042b Merge "Add function to return path for last resolved resource" 2019-01-15 18:38:17 +00:00
Nikita Dubrovsky
7e9d5e1ed7 Update deprecation javadocs of APIs related to preferred activities
Bug: 121324615
Test: build (javadoc-only change)
Change-Id: Ibe0ef25a9186f371ae7f8bf769abb6c9d09bec60
2019-01-15 08:09:22 -08:00
Michal Karpinski
a9002d56be Merge "Make PermissionInfo.PROTECTION_FLAG_OEM @TestApi" 2019-01-15 14:36:41 +00:00
Michal Karpinski
517959e484 Make PermissionInfo.PROTECTION_FLAG_OEM @TestApi
So it can be used in CTS.

Bug: 110956953
Test: atest PermissionPolicyTest#testPlatformPermissionPolicyUnaltered
Change-Id: I1682376845dfa390f01b0e869444c307e6c3d3be
2019-01-15 11:26:36 +00:00
Victor Hsieh
12dd9cd46c Fix default of extractNativeLibs in parseBaseApplication
This is a missed change in 4e54b521bc.

Test: adb install, check that libs are really not extracted.
Bug: 112037137
Change-Id: I0b819d656eb427c4b7b35e027808b87f3aad3c15
2019-01-14 20:56:40 -08:00
TreeHugger Robot
1efe5f627a Merge "Add intent action and extra for managing a single default app." 2019-01-15 00:47:40 +00:00
TreeHugger Robot
09203ca2be Merge "Adding an api to mark a package as distracting" 2019-01-14 23:53:02 +00:00
Winson
2f3669b767 Add function to return path for last resolved resource
After an AssetManager.FindEntry call is made, either directly or from any of the resource entry calls, a stack of the steps taken to resolve the resource is saved. Those steps can be retrieved as a log later on by calling AssetManager.GetLastResourceResolution, which returns a formatted string of the resource ID/name and path taken, including the configs and package names of each step.

Logging and the saving of the steps to memory can be enabled/disabled with the @hide .setResourceResolutionLoggingEnabled() method on AssetManager.

Bug: 122374289

Test: cases for single and multi ApkAssets loaded
Test: case for no resolution made
Test: made test app to display log on device
Test: added debugging call to source and ran through on-device apps

Change-Id: I6a32b8d4020c3f8510032ff7f431510089fff43f
2019-01-14 14:52:00 -08:00
Wei Wang
ffb94e69c3 Pre-grant location permisson to location extra packages.
Grant location permission to extra packages configurated in xml config
file. This is necessary as pre-grant happens right after system starts,
before location provider sets the *real* location extra package.

Bug: 119225658
Test: Manual, atest GtsPermissionTestCases:com.google.android.permission.gts.DefaultPermissionGrantPolicyTest

Change-Id: Ibbfbfb78aa062fa6dc013a1001ea3486d62f4331
2019-01-14 22:34:52 +00:00
Hai Zhang
3a21289896 Add intent action and extra for managing a single default app.
This change adds Intent.ACTION_MANAGE_DEFAULT_APP and
Intent.EXTRA_ROLE_NAME for managing a single default app, which will
be launched from Settings' App info page. The new
Intent.EXTRA_ROLE_NAME also replaces RoleManager.REQUEST_ROLE_NAME.

Bug: 110557011
Test: build
Change-Id: Ice81150b0e960d050d24d963ade04254852a4ee4
2019-01-14 10:41:08 -08:00
Hyunyoung Song
9114be68cd Merge "Add @SystemApi to OverlayManager that ThemePicker needs" 2019-01-14 17:53:17 +00:00
Issei Suzuki
9178eee8b1 Merge "Add inheritShowWhenLocked System API to activity." 2019-01-14 14:34:45 +00:00
Issei Suzuki
74e1eb2220 Add inheritShowWhenLocked System API to activity.
Let an activity show on top of the lock screen if the activity behind
this can be shown on top of the screen. This is pre-requisite for
showing permission dialog on top of the lock screen only when it makes
sence.

Bug: 109754623
Test: atest server.am.KeyguardTests
Change-Id: Ideaa2b77519649a70c682bc95277e451e149adad
2019-01-14 13:42:24 +01:00
TreeHugger Robot
fd1e036205 Merge "Add EXTRA_PERMISSION_GROUP_NAME" 2019-01-12 04:29:33 +00:00
Hyunyoung Song
880a9510c2 Add @SystemApi to OverlayManager that ThemePicker needs
Test: builds and tested in local theme picker

Bug: 121328713

Commands executed:
$ make system-api-stubs-docs-update-current-api
$ make api-stubs-docs-update-current-api

Cts tests to follow

Change-Id: Id26d32f482c1bbab3497b517b7a553d145a1e3df
Signed-off-by: Hyunyoung Song <hyunyoungs@google.com>
2019-01-11 15:02:24 -08:00
Eugene Susla
40335c1be9 Merge "Mirgate default SMS app handling to RoleManager" 2019-01-11 21:23:34 +00:00
Winson Chung
fb922e9bac Merge changes from topic "prediction_suggestion_services"
* changes:
  Initial commit of Content Suggestions (overview long press) Manager.
  Adding initial implementation of Prediction client/service API
2019-01-11 20:21:19 +00:00
TreeHugger Robot
e433ab6ee8 Merge "Add ApplicationInfo.isEncrpytionAware() as a system API." 2019-01-11 19:57:48 +00:00
Dianne Hackborn
5d55a4c907 Merge "Fix issue #122615120: Add bind flag to require associations" 2019-01-11 17:09:10 +00:00
Zhi An Ng
a8f68e24b1 Merge "Do not load xml metadata for unchanged packages in RegisteredServicesCache" 2019-01-11 17:05:47 +00:00
TreeHugger Robot
cbdbc4d9c6 Merge "Add a privileged API for capturing and consuming bugreports" 2019-01-11 12:37:33 +00:00
Chalard Jean
fc758be231 Merge changes from topic "IPMS1" am: 3627deac88 am: 54d91e605c
am: 2304c7c508

Change-Id: I6908f68b1b9e7079384c4cc9f11c4e46cce694ce
2019-01-11 04:13:38 -08:00