Commit Graph

6736 Commits

Author SHA1 Message Date
TreeHugger Robot
70650a5747 Merge "Add annotation for CHANGE_COMPONENT_ENABLED_STATE permission" 2018-05-11 22:40:43 +00:00
Chad Brubaker
3875ce09fa Add annotation for CHANGE_COMPONENT_ENABLED_STATE permission
Test: builds
Bug: 79583362
Change-Id: Id7259d22b24ffdd0506ede28cce7307bdc44bd9b
2018-05-11 13:42:38 -07:00
Todd Kennedy
f6f2f50745 Merge changes from topic "b_78809704" into pi-dev am: 92b64bb1bb
am: f08b40642a

Change-Id: I2e71d83df38b87e2379b6d0bbc2a09cfe6bed4bc
2018-05-11 11:59:39 -07:00
Mrten Kongstad
44a1a24da1 OMS: rebase settings when overlays update am: 2f1944bf0e
am: 0ddacd34de

Change-Id: I7efbcefacbb1d8c7811587889382386fe1513cc8
2018-05-11 11:55:48 -07:00
Mrten Kongstad
0ddacd34de OMS: rebase settings when overlays update
am: 2f1944bf0e

Change-Id: I1691fa4251182adf9484cafb12484aa8003cbf3c
2018-05-11 11:09:25 -07: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
331cf5af98 Merge "Document system activity intents that may not be implemented" into pi-dev am: f9dbd76be3
am: b11cfdbb68

Change-Id: Ibbf7e19e942dd63774fd43f10e66d5c87e2aa8aa
2018-05-10 20:15:41 -07: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
Patrick Baumann
adc9fb5651 Merge "Expands javadocs for Intent.FLAG_ACTIVITY_MATCH_EXTERNAL" into pi-dev am: a1e56fb23b
am: 896935a5f8

Change-Id: I718e45fb57d900d8ff191f266575f7406cf30e92
2018-05-10 15:10:49 -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
Régis Décamps
0bece9db0d Merge "Reuse String literals rather new instance in UriMatcher" 2018-05-10 09:07:02 +00:00
Régis Décamps
e6dc996bf1 Reuse String literals rather new instance in UriMatcher
Micro-optimization: Instead of using a new instance of "#" and "*", reuse the
String literals. This will save 18 bytes for each "*" and "#" used in Uri
matchers.

Also, use switch/case rather than if/else for string matching.

Finally, add test and move TestClass in same package.

Bug: 32502682
Change-Id: Id672138a2213f68e05cafb4e88ed3c1e61c735a4
Test: Unit test
source build/envsetup.sh
lunch aosp_x86-eng
m -j 8
emulator -system out/target/product/generic_x86/system-qemu.img
make FrameworkCoreTests
adb -e install out/target/product/generic_x86/testcases/FrameworksCoreTests/FrameworksCoreTests.apk
adb -e shell am instrument -w -r -e class android.content.UriMatcherTest  com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
2018-05-10 09:39:56 +02: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
8c6d1f0d59 Merge changes I5851dd16,Id196307f into pi-dev am: 8d6571aeed
am: bcbe8d1999

Change-Id: Ic39f37084708a70d98a887762175160204706120
2018-05-09 10:29:37 -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
android-build-team Robot
2ec88c4050 Merge "Allow to influence how loadSafeLabel works" 2018-05-09 15:28:33 +00: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
5cb741a42b Merge "Make android:cantSaveState an optional feature." into pi-dev am: 330dd0b244
am: 5e2cf45571

Change-Id: Id8c89fa40853b41e19359540aa00c0aaaaf34f91
2018-05-08 11:43:18 -07:00
Philip P. Moltmann
a6f5c70b91 Allow to influence how loadSafeLabel works
Also remove all references to old loadSafeLabel method to prevent
proliferation of old method via copy+paste.

The implementation assumes that there are three cases:
- Short labels that don't have anything wrong with them
- Labels that are fine, but are a little too long
- Intentionally bad label that try to break stuff and slow things down.

In the first two cases no characters are marked for removal, in the
third case we have an implementation that does not use a lot of memory
and has linear performance when there are a lot of bad characters.

Test: gts-tradefed run gts-dev -m GtsContentTestCases
Bug: 77964730
Change-Id: I3feb17b2a12018cd5407c88fe3603f2ebbc9d14e
2018-05-08 11:27:41 -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
66fca3e43f Merge "Propagate calling UID to AM from CrossProfileApps" into pi-dev am: 7bfb942e2d
am: 3f1c2382c9

Change-Id: If002ec36dfa98c5699b5f6270eb60e22b1dffa87
2018-05-04 12:58:27 -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
4b17b1b399 Merge "Make safe label more safe" into pi-dev am: 06637b97dd
am: 118408f6ca

Change-Id: Icfadc3afecb91f12c77712d0b29e961f4414215e
2018-05-03 09:10:19 -07: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
290879a583 Merge "old paths contains all entries when updating" into pi-dev am: f5cb5e5525
am: 9cfb90e85b

Change-Id: I63f21a16b8e5f59c1fd6cefb242b8b22dd564eaa
2018-05-03 06:48:01 -07: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
cc11c4b79a Merge "Fix leak of WeakReferences on mThemeRefs list." into pi-dev am: 7790f2a4e1
am: 9413533125

Change-Id: Ia626ee1d5975ead16e5fe487d8b35ccbfde39443
2018-05-03 06:21:52 -07: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
996652c4ae Merge "Update Configuration#isScreenWideColorGamut doc" into pi-dev am: 067749725e
am: 4f6d5393cb

Change-Id: Ieffece2062f99dba6f99c16934393f71f2e486a1
2018-05-02 14:41:42 -07: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
b02996cb14 Merge "Require READ_CALL_LOG permission to see phone numbers in phone state." into pi-dev am: 7f556daa41
am: d6aef2176f

Change-Id: Id4b1f204061f6c7f6c12c2faa392015ade4c4b7f
2018-05-01 13:52:35 -07: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
633c4d9875 Merge "Propagate calling UID to AM from LauncherApps" into pi-dev am: eac8a05d19
am: f683c14bd4

Change-Id: I3c1d47b97d39bb2e1f1a7e3639375251b69110a6
2018-05-01 09:14:44 -07: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
e3efaf80fd Merge "Add documentation for what to use for SS changes" into pi-dev am: 7f1944a365
am: c7e3dbf76e

Change-Id: Ie9469c6399436309f09b6094d63aa96d75598acb
2018-04-30 11:34:49 -07: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
Philip P. Moltmann
33115156f9 Expose APIs used by CtsPermissionTestCases
Test: atest CtsPermissionTestCases
Bug: 77604428
Change-Id: Ib5e9b678e98aab86dac90610ed071eb89f14fce9
2018-04-26 09:40:57 -07:00
Jeff Sharkey
3b25e5306c Merge "Protect usage data with OP_GET_USAGE_STATS." into pi-dev am: ddb15c471c
am: 37bbe98e86

Change-Id: If8cfddaf96d28b3815dd6dca6aa52a7b9bd15da6
2018-04-19 20:08:03 -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
Makoto Onuki
c5e8e23e57 Merge "SyncManager: Dump per-source last sync time too." into pi-dev am: d329ae8010
am: 5bb2f9b14d

Change-Id: I0a7c222e33cf8ff95ab8834c4ec31c7a69e0e605
2018-04-19 11:09:57 -07:00