Commit Graph

6661 Commits

Author SHA1 Message Date
Rhed Jao
c19da78203 Hide system apps until installed (1/2)
Applying this mechanism for system carrier apps to make visibility
reasonable from the user's perspective. In other words, before
hidden system apps have been installed, they wouldn't be listed
via APIs in PackageManager which are used at all apps list and
search in Settings and so on.

Test: atest CarrierAppUtilsTest
Test: atest PackageManagerTest
Test: cts DeviceOwnerTest
Test: gts ManagedProfileProvisioningHostsideTest
Bug: 74068582
Change-Id: I1f23aba589b98351a1871a44a3058b67c416f351
2018-06-26 02:21:10 +00:00
Chris Forbes
98f34402cc pm: Exposing Vulkan 1.1 does not guarantee AHB extension support
Bug: b/109875843
Change-Id: Ib53fb1a4f7a5a6c055b575b4d8775f8bd62db7a8
2018-06-07 16:41:19 -07:00
Andrew Sapperstein
bae9b1a71c Merge "Revert "Hide system apps until installed (1/2)"" into pi-dev 2018-06-07 16:15:57 +00:00
TreeHugger Robot
39f04a7da4 Merge "Document -n option on intent specification." into pi-dev 2018-06-07 00:36:10 +00:00
Sanry Huang
afef5daaf9 Revert "Hide system apps until installed (1/2)"
This reverts commit 40ede29ed6.

Bug: 74068582
Bug: 80444486
Bug: 80316870
Bug: 109803325
Bug: 109642189
Bug: 109660260
Bug: 109649585
Bug: 109647120
Bug: 109648512
Bug: 109648513
Bug: 109647122
Change-Id: I0e50ceebeaecae89f461f541450e24d9c148527d
2018-06-06 19:42:39 +00:00
TreeHugger Robot
0c6929ec04 Merge "Revert "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS"" into pi-dev 2018-06-04 23:27:42 +00:00
Hongming Jin
64896541d4 Merge "Add shell command handler for account manager to allow enabling service binding for instant app. Test: cts-tradefed run cts -m CtsAccountManagerTestCases cts-instant-tradefed run cts-instant -m CtsAccountManagerTestCases Bug: 79367659" into pi-dev 2018-06-04 20:38:46 +00:00
Andrew Sapperstein
4da326c0d6 Revert "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS"
This reverts commit 44c4ca41d8.

Reason for revert: Wanted to go with a different option and this was mistakenly Dr. No'ed.

Bug: 80444486
Test: clean revert
Change-Id: I7fdd13a5bc0f4d9fabf91f3e5497c4065008b531
2018-06-04 20:34:31 +00:00
TreeHugger Robot
15ebbeb9fd Merge "Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS" into pi-dev 2018-06-04 20:32:30 +00:00
Hongming Jin
8e2bfc11ce Add shell command handler for account manager to allow enabling service
binding for instant app.
Test: cts-tradefed run cts -m CtsAccountManagerTestCases
cts-instant-tradefed run cts-instant -m CtsAccountManagerTestCases
Bug: 79367659

Change-Id: I3ac968ebc20be68da08293d9b685a01920f11b76
2018-06-04 09:41:01 -07:00
Jackal Guo
44c4ca41d8 Update checking of flag MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS
Update the logic in PackageParser to avoid unistalled system app
can't be found.

Test: follow steps on b/80444486 and can add account normally
Test: PackageManagerTest
Bug: 80444486
Change-Id: Ifafac34111d883e51563018be793655c25d09fba
2018-06-01 12:22:38 +08:00
Hongming Jin
83e162615f Enforce permission check before returning application info
Test: atest CtsAppSecurityHostTestCases:ApplicationVisibilityTest
Bug: 77821568

Change-Id: I7554805c36c0c2552163dad7b07cfc5f552b624e
2018-05-31 17:20:14 -07:00
Todd Kennedy
ef9acb6ed9 Ensure permission held for MATCH_KNOWN_PACKAGES
There's an escape clause that passes the cross user permissions
if the caller UID is identical to the target user ID [eg. we're not
operating across users]. However, the method getInstalledPackagesList()
uses android.permission.INTERACT_ACROSS_USERS to filter the results and
a calling UID check is not sufficient. Ensuure the permission is
actually held, regardless of the calling UID or target user.

Change-Id: Iebf88668766d387a15246d6eea6420610665105a
Fixes: 80435086
Test: atest CtsAppSecurityHostTestCases:ApplicationVisibilityTest
2018-05-30 13:56:17 -07:00
Glenn Kasten
a5d8c3718d Merge "Resolve conflict between javadoc and CDD re: audio output" into pi-dev 2018-05-29 19:09:31 +00:00
TreeHugger Robot
9d19487b1c Merge "Added TestApi to ActivityInfo.isTranslucentOrFloating" into pi-dev 2018-05-26 02:23:25 +00:00
Wale Ogunwale
30eab1f430 Added TestApi to ActivityInfo.isTranslucentOrFloating
This would be use to determine the right activity state during CTS
test for products that have windowSwipeToDismiss set.

Also, dump ActivityRecord.fullscreen to proto for the same reason.

Bug: 76207986
Bug: 79167358
Test: atest CtsActivityManagerDeviceTestCases:ActivityLifecycleTests
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerAssistantStackTests
Change-Id: Iadc088e9129be088b8a083ebbafd8d20fe26b673
2018-05-25 10:24:14 -07:00
Makoto Onuki
621fd20f55 Merge "Tweak exemption for sync requests made by FG apps" into pi-dev 2018-05-24 23:22:09 +00:00
sanryhuang
40ede29ed6 Hide system apps until installed (1/2)
Applying this mechanism for system carrier apps to make visibility
reasonable from the user's perspective. In other words, before
hidden system apps have been installed, they wouldn't be listed
via APIs in PackageManager which are used at all apps list and
search in Settings and so on.

Test: manual
Test: atest CarrierAppUtilsTest
Test: atest PackageManagerTest
Bug: 74068582
Change-Id: Id3ff138ad529b909d9bbf6719af3a553b909ccbb
2018-05-23 16:29:31 -07:00
Makoto Onuki
d5f25d2cd8 Tweak exemption for sync requests made by FG apps
Exemption given to a sync request made by a foreground app (including
PROCESS_STATE_IMPORTANT_FOREGROUND).
At the schedule time, we promote the sync adapter app for a higher bucket:
- If the device is not dozing (so the sync will start right away)
  promote to ACTIVE for 1 hour.
- If the device is dozing (so the sync *won't* start right away),
promote to WORKING_SET for 4 hours, so it'll get a higher chance to be started once the
device comes out of doze.
- When the sync actually starts, we promote the sync adapter app to ACTIVE for 10 minutes,
so it can schedule and start more syncs without getting throttled, even when the first
operation was canceled and now we're retrying.

Test: atest cts/tests/tests/syncmanager/
Test: Manual test with "requestsync -f" and "am set-standby-bucket", while checking
"dumpsys usagestats"
Test: settings put global app_idle_constants \
  exempted_sync_scheduled_nd_duration=1,exempted_sync_scheduled_d_duration=2,exempted_sync_start_duration=3
  and check "dumpsys usagestats" and make sure the constants are properly updated.
Fixes: 72443754

Change-Id: I233d8e4be85769150830bac798abc04810f4cc7b
2018-05-23 14:50:05 -07:00
TreeHugger Robot
d0897f2b65 Merge "Remove MANAGE_USERS from setPackagesSuspended" into pi-dev 2018-05-21 20:01:36 +00:00
Glenn Kasten
0a111ad6d0 Resolve conflict between javadoc and CDD re: audio output
As CDD text is likely to change in this area, rather than attempt to
keep them in sync we'll just defer to CDD for the official definition.

Test: N/A
Bug: 79440478
Change-Id: Ibd352af626f192eac9a4dfa2fafe675a3955270e
2018-05-17 08:57:48 -07:00
Suprabh Shukla
14405c9ac3 Remove MANAGE_USERS from setPackagesSuspended
MANAGE_USERS is a widely used permission and setPackagesSuspended is a
dangerous API. Also having a lot of apps which can use the api can lead
to complications like them suspending each other.

Test: Existing tests with SUSPEND_APPS pass:
atest com.android.server.pm.SuspendPackagesTest

Existing permission tests without SUSPEND_APPS pass:
atest GtsSuspendAppsPermissionTestCases

Bug: 79773970
Change-Id: I49d81c0254c6ba528c50ece960a0db277c0afd7f
2018-05-16 20:41:02 -07:00
lpeter
318abc9324 [IdleController] Support dock scenario on idle or active judgement
In the current design, IdleController of Job service considers devices as ‘idle’ after 71 minutes of screen off. But under docking use scenario, devices screen might remain on for a very long time and it’s not necessary implying the device being interactive with users.
So create a mechanism for device to enter the ‘idle’ state that JobScheduler can kick off idle tasks.

Bug: 79183658
Test: atest DeviceStatesTest
Change-Id: I5b307ca51e28ffca63f79a9c43984c3b76e51629
2018-05-17 02:23:02 +00:00
Todd Kennedy
92b64bb1bb Merge changes from topic "b_78809704" into pi-dev
* changes:
  OMS: teach the OMS about static RROs
  OMS: rebase settings when overlays update
2018-05-11 17:44:53 +00:00
Christopher Tate
72da1e6f78 Document system activity intents that may not be implemented
All of these activity-start intents might be unimplemented on some
Android products.  Document this to make sure that developers are
aware of the need to safeguard against this.

Bug: 68300743
Bug: 62201251
Bug: 69587018
Fixes: 77282739
Test: atest CtsContentTestCases:.AvailableIntentsTest
Change-Id: Ia2346d03ccb7f2bdad2b84ba9efff72413fdc3c2
2018-05-10 17:55:26 -07:00
TreeHugger Robot
a1e56fb23b Merge "Expands javadocs for Intent.FLAG_ACTIVITY_MATCH_EXTERNAL" into pi-dev 2018-05-10 18:23:07 +00:00
Patrick Baumann
92ae2c6665 Expands javadocs for Intent.FLAG_ACTIVITY_MATCH_EXTERNAL
This change adds much needed detail to the new MATCH_EXTERNAL flag,
explaining some of the behavior changes that come with using it.

Test: none
Bug: 63117034
Bug: 79325769
Change-Id: Iab320d2171ffe8d8012a2928656ea61d5e0f0862
2018-05-10 10:13:53 -07:00
Philip P. Moltmann
56c1b4f704 DO NOT MERGE: Allow to control behavior of loadSafeLabel
(Minimal change for P, full change already in master)

Test: looked at package installer UI and saw that labels are not
truncated anymore.
Bug: 77964730

Change-Id: Ia181288a90501f4f563d24dacd6edb0c81406b82
2018-05-09 12:51:43 -07:00
android-build-team Robot
8d6571aeed Merge changes I5851dd16,Id196307f into pi-dev
* changes:
  OMS: harden permission checks
  Add missing fields to OverlayInfo.hashCode
2018-05-09 16:55:26 +00:00
Mårten Kongstad
a525e2239a OMS: teach the OMS about static RROs
Teach the OMS about static RROs (those with <overlay isStatic="true">)
and add a new OVERLAY_ENABLED_STATIC state to OverlayInfo. This makes
isStatic less of an edge case and something that can be reasoned about
together with the other states.

Bug: 78809704
Test: atest OverlayHostTests OverlayDeviceTests
Change-Id: Ia785554ed2bcf7679888c3ccdaeaedca1430a477
2018-05-09 09:15:05 -07:00
Mårten Kongstad
2f1944bf0e OMS: rebase settings when overlays update
When an overlay package has been upgraded, OMS needs to reconcile any
previous settings about the overlay with the new state of affairs.
Sometimes it is possible to rebase the OMS settings on the new
information [e.g. the overlay has changed categories]; sometimes the OMS
settings have to be scrapped [e.g. the overlay has changed target
package]. Update OMS to do The Right Thing.

Bug: 78809704
Test: manual (adb shell stop, adb push specially prepared overlays, adb shell start, adb exec-out cmd overlay dump)
Change-Id: Icd1ae633dbee5b5ca957fa6b652af6209b4b1260
2018-05-09 09:10:28 -07:00
Mårten Kongstad
3e9331125a Add missing fields to OverlayInfo.hashCode
OverlayInfo.category was inadvertently omitted when calculating the hash
code for an OverlayInfo.

Bug: 78809702
Test: atest OverlayHostTests OverlayDeviceTests
Change-Id: Id196307f75569d851503ffd8ef778aec50c2de37
2018-05-08 15:38:22 -07:00
Dianne Hackborn
c8e4fad862 Make android:cantSaveState an optional feature.
This doesn't make sense on things like watches and appliances,
so make this an optional feature that the device must enable.
If the feature is not set, then the system will ignore
the app's request.

Bug: 76213401
Test: atest CtsAppTestCases:ActivityManagerProcessStateTest
Change-Id: I91abf9d86ec14fa632e3bcc83c4a3febade5d2e4
2018-05-07 15:01:57 -07:00
android-build-team Robot
7bfb942e2d Merge "Propagate calling UID to AM from CrossProfileApps" into pi-dev 2018-05-04 19:35:44 +00:00
android-build-team Robot
06637b97dd Merge "Make safe label more safe" into pi-dev 2018-05-03 15:46:10 +00:00
android-build-team Robot
f5cb5e5525 Merge "old paths contains all entries when updating" into pi-dev 2018-05-03 13:26:50 +00:00
Richard Uhler
7790f2a4e1 Merge "Fix leak of WeakReferences on mThemeRefs list." into pi-dev 2018-05-03 13:02:35 +00:00
Todd Kennedy
6e40395882 Make safe label more safe
* limit the absolute maximum size of the label to 50000 characters
[which is probably far more than necessary, but, can be dialed down]

* use a string buffer while processing the string [instead of creating
multiple string objects]

Bug: 62537081
Test: Manual. Install APK in bug and see that it can be uninstalled
Change-Id: Ibf63c2691ad7438a123e92110d95b1f50050f8b1
2018-05-03 12:12:04 +01:00
Todd Kennedy
b9656a93aa old paths contains all entries when updating
In certains circumstances, only the base and split APKs were included in
the "old paths" list when updating the application info. Instead, this
list should contain _all_ elements, including any additional libraries
that may be added to the overall classpath.

Bug: 77342775
Test: Manual. Install a package. Install a split with --dont_kill. See that the path doesn't contain duplicate entries
Change-Id: Id9739cce215ab07bff1b17966583c0cf51a0b34a
2018-05-03 11:02:30 +01:00
Richard Uhler
dd6a0dbf2f Fix leak of WeakReferences on mThemeRefs list.
Periodically remove references from the list whose referents have been
garbage collected.

Bug: 73961798
Test: Device boots.
Test: Take a heap dump of systemui and manually check that the state of
      ThemeRefs looks reasonable.

Change-Id: I691027feb5dd217bcb60406b28897b9614e2a845
2018-05-03 10:12:24 +01:00
Chia-I Wu
53e86ba235 Update Configuration#isScreenWideColorGamut doc
Clarify that the method does not imply the screen is color-managed.
A global color transform may still be applied depending on the user
settings, such as night light, accessibility, Boosted, or Stretched.

Bug: 78012876
Test: builds
Change-Id: Ie9cdf455cf4ca93be2357a5313cd63555ab91ff9
2018-05-02 10:25:48 -07:00
Tony Mak
de32b83499 Propagate calling UID to AM from CrossProfileApps
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/CrossProfileAppsHostSideTest.java
Test: atest FrameworksServicesTests:com.android.server.pm.CrossProfileAppsServiceImplTest
Test: Try the API in TestDPC

Fixes: 78869781

Change-Id: I9b8721f6b5189e566345c2afee7d559a57670e71
2018-05-02 10:54:03 +01:00
Tyler Gunn
7f556daa41 Merge "Require READ_CALL_LOG permission to see phone numbers in phone state." into pi-dev 2018-05-01 20:27:15 +00:00
Makoto Onuki
eac8a05d19 Merge "Propagate calling UID to AM from LauncherApps" into pi-dev 2018-05-01 15:50:37 +00:00
android-build-team Robot
7f1944a365 Merge "Add documentation for what to use for SS changes" into pi-dev 2018-04-30 17:59:04 +00:00
Makoto Onuki
1a34274336 Propagate calling UID to AM from LauncherApps
- So that AM can perform all the necessary caller checks, except for the cross-profile/user check.

- Note PixelLauncher is the recent app which gets extra privileges. So I used ShortcutLauncherDemo
and a 3p launcher for manual tests.

Fixes: 78635323
Test: manual test, with a 3p launcher. (nova)
- Launch primary profile app -> launches fine
- Launch work profile app-> launches fine
- Launch suspended work profile app -> "can't open this app" dialog is shown.
- Launch the primary counterpart of the suspended work profile app -> launches fine.
- Launch work profile app in quiet mode, with separate work challenge
  -> "turn on work profile"? dialog is shown
    -> then "cancel" -> nothing happens.
    -> then "turn on" -> "re-enter your pin" is shown -> type pin -> work profile app starts fine.
- Launch work profile app without separate work challenge
  -> "turn on work profile"? dialog is shown
    -> then "cancel" -> nothing happens.
    -> then "turn on" -> work profile starts and the app starts fine.
- "App info" on work profile app -> Setting page opens fine.
- "App info" on primary profile app -> Setting page opens fine.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest*.java
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/LauncherApps*.java

Change-Id: Ie665a8890407d05c1d877f04d9c5c3a1caad18e1
2018-04-27 09:31:56 -07:00
Tyler Gunn
f955e56d51 Require READ_CALL_LOG permission to see phone numbers in phone state.
Incoming and outgoing call phone numbers are visible in the phone state
broadcast and via the PhoneStateListener.  To enhance user privacy, change
to require the READ_CALL_LOG permission in order to receive the call
phone numbers.

This means to see phone numbers:
1. android.intent.action.PHONE_STATE - requires READ_PHONE_STATE and
READ_CALL_LOG permission.
2. PhoneStateListener#onCallStateChanged - now required READ_CALL_LOG
permission.

To support this new behavior, added sendBroadcastAsUserMultiplePermissions
method to context to allow sending the broadcast to all users while
requiring the two permissions.

Bug: 78650469
Test: Created PHONE_STATE broadcast receiver in test app and verified that
when no permissions are granted, the phone number is empty for incoming
and outgoing calls.
Test: Granted Phone state permission to test app and verified that phone
number is not populated.
Test: Granted test app read call log permission and verified that phone
number is populated.
Test: Created PhoneStateListener in test app and verified that when no
permissions are granted, phone number is empty for incoming and outgoing.
calls.
Test: Granted read call log permission to test app and verified that both
the incoming and outgoing numbers are populated.

Change-Id: I857ea00cc58a0abbb77960643f361dd6dd9c8b56
2018-04-27 08:44:07 -07:00
Felipe Leme
4e02e255d4 Document -n option on intent specification.
Test: adb shell am|grep "\-n "
Bug: 74618452

Change-Id: I5bc86abdd1ce244aa91c0f1110e525778c1da39a
2018-04-20 11:27:52 -07:00
Jeff Sharkey
ddb15c471c Merge "Protect usage data with OP_GET_USAGE_STATS." into pi-dev 2018-04-20 02:38:01 +00:00
Jeff Sharkey
0ad6283da7 Protect usage data with OP_GET_USAGE_STATS.
APIs that return package usage data (such as the new ArtManager)
must ensure that callers hold both the PACKAGE_USAGE_STATS permission
and the OP_GET_USAGE_STATS app-op.

Bug: 77662908
Test: atest vendor/xts/gts-tests/hostsidetests/dexapis/host/
Change-Id: I7a85d959f1682d2bd5cf3684415e368fece88101
2018-04-19 15:46:59 -06:00