246 Commits

Author SHA1 Message Date
Yi Jin
8a54ff3fdb Merge "Fix cts." into pi-dev
am: 3e389a8490

Change-Id: I9d9ddb90f8917904187a022e27a7139e61276c75
2018-06-07 10:06:13 -07:00
Yi Jin
fae177363c Fix cts.
Bug: 109837886
Test: atest CtsIncidentHostTestCases:com.android.server.cts.IncidentdTest
Change-Id: I8cfc36b652fff4b7b4d752f57fba922ac479cd12
2018-06-06 18:08:01 -07:00
Sundong Ahn
1d0038a843 Merge "Build java.obex with java_sdk_library" am: ad769993a9
am: efb4ce221e

Change-Id: I31f65699193f026c7ed64a182b360791eee35608
2018-05-29 19:54:35 -07:00
Sundong Ahn
1c53cc161d Build java.obex with java_sdk_library
javax.obex is built with java_sdk_library and api files are added by
running "make update-api".
Remove java.obex is from platform.xml, since it will be generated
automatically by soong when the library is built with java_sdk_library.

Bug:77577799
Test: make -j
      make checkapi

Change-Id: Ib94955e62582ffbdfc7eb88cd0e494c61757c7aa
2018-05-30 00:19:01 +00:00
Jiyong Park
c73b9e9e17 Shared lib def for org.apache.http.legacy comes from java_sdk_library
org.apache.http.legacy is now built using java_sdk_library. Since the
share lib defintion file for the lib is automatically created and
installed, we don't need to have duplicated entry for the lib.

Bug: 77577799
Test: m -j
Test: adb shell cmd package list libraries shows an entry for
org.apache.http.legacy

Merged-In: I06b356c2ba08abc6c1cece81daf7c1773ed93ed0
Change-Id: I06b356c2ba08abc6c1cece81daf7c1773ed93ed0
(cherry picked from commit 49c0a869550dc6a80f75fb08fd38e11ee84bc33d)
2018-05-22 20:43:51 +09:00
Jiyong Park
0201dc3911 Shared lib def for org.apache.http.legacy comes from java_sdk_library
org.apache.http.legacy is now built using java_sdk_library. Since the
share lib defintion file for the lib is automatically created and
installed, we don't need to have duplicated entry for the lib.

Bug: 77577799
Test: m -j
Test: adb shell cmd package list libraries shows an entry for
org.apache.http.legacy

Merged-In: I06b356c2ba08abc6c1cece81daf7c1773ed93ed0
Change-Id: I06b356c2ba08abc6c1cece81daf7c1773ed93ed0
(cherry picked from commit 49c0a869550dc6a80f75fb08fd38e11ee84bc33d)
2018-05-22 20:16:14 +09:00
Jeff Sharkey
936c0868f8 Merge "Protect usage data with OP_GET_USAGE_STATS." into pi-dev 2018-04-17 00:04:53 +00:00
Jeff Sharkey
6b64925737 Protect usage data with OP_GET_USAGE_STATS.
APIs that return package usage data (such as the new StatsManager)
must ensure that callers hold both the PACKAGE_USAGE_STATS permission
and the OP_GET_USAGE_STATS app-op.

Add noteOp() method that can be called from native code.

Also add missing security checks on command interface.

Bug: 77662908, 78121728
Test: builds, boots
Change-Id: Ie0d51e4baaacd9d7d36ba0c587ec91a870b9df17
2018-04-16 12:44:32 -06:00
Tyler Gunn
8a9ad362cd Add permission whitelist for EmergencyInfo app.
This is the "Emergency Info" screen available from the lock screen.
It requires the CALL_PRIVILEGED permission in order for it to be able to
place emergency calls.  This can occur if a user adds an emergency number
to their emergency contacts.

Test: make checkbuild
Bug: 76086838
Merged-In: I2cfc893f8e636790a837e0f71f9f42ea723c8e31
Change-Id: I2cfc893f8e636790a837e0f71f9f42ea723c8e31
(cherry picked from commit cdc555f4890479813c72a928f67bcbaf0e6847d8)
2018-04-16 15:12:46 +00:00
Tyler Gunn
f1e7cf499b Add permission whitelist for EmergencyInfo app.
This is the "Emergency Info" screen available from the lock screen.
It requires the CALL_PRIVILEGED permission in order for it to be able to
place emergency calls.  This can occur if a user adds an emergency number
to their emergency contacts.

Test: make checkbuild
Bug: 76086838
Change-Id: I76e8318c5c05bbbbdf02d2c6951f742c3bd67ea6
2018-04-11 11:05:32 -07:00
Mathew Inwood
9d89543d48 Exempt platform-cert signed apps from hidden API checks.
This means that APKs signed with the platform cert are allowed to use
hidden APIs, even if they are not on the package whitelist, and if they are
not in the system image. It will also allow a number of packages to be
removed from the package whitelist.

Also remove all platform cert signed apps from the package whitelist, as
there is no longer any need for them to be in there.

Bug: 64382372
Test: device boots
Change-Id: Id805419918de51f946c1f592581bab36ae79de83
2018-04-04 17:49:48 +01:00
Nicolas Geoffray
117367a4ec Add com.android.development to the package whitelist.
bug: 77477866
Test: m
Change-Id: I9ac27dd3e7ee0d764d61ab9a8d2ae1065ce151e5
2018-04-03 16:51:56 +01:00
Sunny Goyal
b8e2fa707e Whitelisting Launcher3 for hidden APIs
Bug: 76169471
Test: N/A
Change-Id: I72d4ab22acec3ea5095d6f8fb9fe6ff11df097a8
2018-03-26 17:31:19 -07:00
Mathew Inwood
2e9ba053c1 Amend package whitelist.
Now that Antons cleanup of all packages is complete, we can generate this
whitelist from those packages that specify

  LOCAL_PRIVATE_PLATFORM_APIS := true

This is the resulting list of packages. This change also includes fixes to
the method; previously, packges that didn't specify any certificate may
have been exluded.

Test: Verify that device boots.
This is a cherry-pick of change I1f578322135274b80708d4bb7664f7732ac33cc7
from AOSP.

Bug: 64382372
Change-Id: Iada043cb85f9b3281893ed9a2828771b8f1ef045
2018-03-21 09:30:12 +00:00
Winson Chung
58fb749d42 Allow the shell to start task overlay activities.
- Fix issue with testFinishPipActivityWithTaskOverlay failing due to
  new permission check in the system

Bug: 71716434
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerPinnedStackTests#testFinishPipActivityWithTaskOverlay

Change-Id: Ifbcd6c182d928f5aa5372d2db9fa71a142dc8474
2018-03-19 18:48:15 -07:00
Mathew Inwood
25be36376b Amend package whitelist.
Now that Antons cleanup of all packages is complete, we can generate this
whitelist from those packages that specify

  LOCAL_PRIVATE_PLATFORM_APIS := true

This is the resulting list of packages. This change also includes fixes to
the method; previously, packges that didn't specify any certificate may
have been exluded.

Test: Verify that device boots.
Change-Id: I1f578322135274b80708d4bb7664f7732ac33cc7
2018-03-15 14:06:29 +00:00
David Brazdil
d32fc7d20a Add PrintRecommendationService to hidden API package whitelist
This app builds directly against the platform. Add it to the whitelist.

Bug: 64382372
Test: make
Test: device boots
Change-Id: I16574374d2c233221cd1305f031f78aca1947f05
(cherry picked from commit 06c8a439f7641b59e3648f691ae1a1921244c68e)
2018-03-14 11:27:52 +00:00
David Brazdil
06c8a439f7 Add PrintRecommendationService to hidden API package whitelist
This app builds directly against the platform. Add it to the whitelist.

Bug: 64382372
Test: make
Test: device boots
Change-Id: I16574374d2c233221cd1305f031f78aca1947f05
2018-03-13 16:14:03 +00:00
David Brazdil
2ed5548a61 Add PrintSpooler to system app whitelist
This app builds directly against the platform. Add it to the whitelist.

Bug: 64382372
Test: make
Test: device boots
Change-Id: Ia77df2db78adf62a525f08549d71360924f1a3f6
Merged-In: I4c308d93d66391da2d3691eb45e5d7b1c1fdd582
(cherry picked from commit f7e625c19c8fbf0fc6cac5b7a724fe6548d5821f)
2018-03-12 13:19:47 +00:00
David Brazdil
f7e625c19c Add PrintSpooler to system app whitelist
This app builds directly against the platform. Add it to the whitelist.

Bug: 64382372
Test: make
Test: device boots
Change-Id: I4c308d93d66391da2d3691eb45e5d7b1c1fdd582
2018-03-09 13:45:37 +00:00
Jason Monk
23b73c45fb Merge "Remove BIND_SLICE" into pi-dev 2018-03-07 18:01:26 +00:00
Jason Monk
0f73c65958 Remove BIND_SLICE
Its not being used anymore and shouldn't be API.

Test: update-api
Fixes: 74240589
Change-Id: I27d8e3fa5e0570ff268e6160c683d7190c96ef9b
2018-03-06 18:39:15 +00:00
mswest46
3f4c99d3eb Add set-time and set-timezone shell cmds to alarm service
These commands allow a user to set the time and the timezone
from the shell. The shell now has signature|privileged
SET_TIME and SET_TIME_ZONE permissions.

Bug: 67751701
Test: manual - correctly sets the time and timezone from unrooted adb.
Change-Id: I1d2820fd7dadd8b1f3900c0592eb28210370ce88
2018-03-05 19:50:12 +00:00
Mathew Inwood
93d7d0e56e Merge "Populate hiddenapi whitelist." am: 2519de11c3 am: 37d670a083
am: ca7e42317f

Change-Id: I9549a42daaf469d286b92b249881838b3a50fab6
2018-02-22 19:26:19 +00:00
Mathew Inwood
2f09c3bc5b Populate hiddenapi whitelist.
This list of packages is derived from all packages in the tree that do not
specify LOCAL_SDK_VERSION in their Android.mk. It was done by:

1.  Modifying biuld/core/package_internal.mk to output a warning for all
    packages that do not specify LOCAL_SDK_VERSION, including some
    metadata about the target.

2.  Parsing the output fom the build, then filtering out those that specify
    a test certificate, or with LOCAL_MODULE_TAGS := tests, that depend
    on android.test.runner or whose name includes "Test"

3.  Look up the java package name of each & build the list from these.

Test: N/A, this change is a no-op while all system apps are excluded
from the checks.

BUG: 73244707

Change-Id: Ie3dcb1b4b83c32e93609bc58dc7a1cd513eeea64
2018-02-22 11:05:15 +00:00
Mathew Inwood
787c193ee5 Package whitelist for hiddenapi checks.
Some packages in the system image are not built against the SDK, so
enforcing hiddenapi checks for these will break them. Add a whitelist
for such packages.

For now, just add the contacts provider to the whitelist. The list will be
further populated later.

Test: Added test app package name to whitelist to verify.

Bug: 73244707

Merged-In: I94746b7f12dd9371d5068bb235eb853f63ee4d97
Change-Id: I1cbbd220c61b1b4b767c301f97096607ee902a7b
2018-02-22 11:05:14 +00:00
Hall Liu
017afff112 Merge "Check for location access on TelephonyRegistry" am: 31230bb193 am: f581580fdb
am: 9b31dd86da

Change-Id: Icd2feab82a9350fa2b6539617863ad91a44e5208
2018-02-22 00:43:12 +00:00
Hall Liu
31230bb193 Merge "Check for location access on TelephonyRegistry" 2018-02-21 22:42:08 +00:00
Mathew Inwood
4693a75eda Package whitelist for hiddenapi checks.
Some packages in the system image are not built against the SDK, so
enforcing hiddenapi checks for these will break them. Add a whitelist
for such packages.

For now, just add the contacts provider to the whitelist. The list will be
further populated later.

Test: Added test app package name to whitelist to verify.

Bug: 73244707
Change-Id: I94746b7f12dd9371d5068bb235eb853f63ee4d97
2018-02-21 12:50:45 +00:00
Svetoslav Ganov
2d20fb47f4 APIs to watch active op changes
System singed components can watch for starting/finishing of
long running app ops. Also protected the APIs to watch op mode
changes with a singature permission for the cross-uid use case.

Test: atest com.android.server.appops.AppOpsActiveWatcherTest

bug:64085448

Change-Id: Id7fe79ce1de4c5690b4f52786424ec5a5d9eb0fa
2018-02-16 18:29:04 -08:00
Holly Jiuyu Sun
052fbabc35 Public EuiccManager APIs.
Public EuiccManager and other related necessary files.
Mark EuiccCardManager and other related necessary files as @SystemApi.
Solve lint errors and warnings.

Bug: 35851809
Test: test on phone
Change-Id: I8a2c78804cae56b679d311d613edca5be4bc2522
Merged-In: I68853e134e1e31fa9b91a83af6c491a2a8cca971
2018-02-13 12:53:45 -08:00
Holly Jiuyu Sun
4f73b9c09a Public EuiccManager APIs.
Public EuiccManager and other related necessary files.
Mark EuiccCardManager and other related necessary files as @SystemApi.
Solve lint errors and warnings.

Bug: 35851809
Test: test on phone
Change-Id: I68853e134e1e31fa9b91a83af6c491a2a8cca971
2018-02-08 11:12:30 -08:00
Hall Liu
520b975ded Merge "Revert "Check for location access on TelephonyRegistry"" am: 39393f889a am: 772d17c263
am: 07e1d78346

Change-Id: I9ab304409e6f777593e6c927bb0d76b8f82038fc
2018-02-07 03:16:29 +00:00
Hall Liu
5fb337ff85 Check for location access on TelephonyRegistry
When sending outbound callbacks on CELL_INFO and CELL_LOCATION, check to
make sure that the user has authorized us and the receiving app to get
information on their location.

Bug: 69637693
Test: manual: telephony testapp
Change-Id: Iacfc894428b11a7ec973567d7a797eedb281355f
2018-02-06 14:01:47 -08:00
Hall Liu
39393f889a Merge "Revert "Check for location access on TelephonyRegistry"" 2018-02-06 21:15:42 +00:00
Hall Liu
3d30946e8e Revert "Check for location access on TelephonyRegistry"
This reverts commit 8d584f0a91b0709b28ebc64abf0a6063429c8d58.

Reason for revert: b/72967560

Change-Id: I9ca3c4a586e740a7b7d4cc5940ca8d4e4ebf3654
2018-02-06 18:13:36 +00:00
Jeff Sharkey
b49b3f1e57 Merge "Media process should run with "write" access." 2018-02-04 00:12:22 +00:00
Jeff Sharkey
86684240eb Media process should run with "write" access.
The WRITE_MEDIA_STORAGE permission had inadvertently been giving apps
the "default" view of storage.  This had worked for a long since,
since we also gave them the "sdcard_rw" permission, but a recent
security patch broke this for secondary users.

Apps holding this permission should have been mounted "write" all
along, and relied on that view to access storage devices.  This also
means they no longer need the "sdcard_rw" GID.

Test: builds, boots, secondary user media/camera works
Bug: 72732906, 71737806, 72224817
Change-Id: I5cd687a1e128024f33b4acd93c15e75192ed1c85
2018-02-03 15:33:04 -07:00
Treehugger Robot
0276f4290f Merge "Added permission for binding data service" 2018-02-03 04:40:06 +00:00
TreeHugger Robot
59c490f29b Merge "Renamed BIND_DATA_SERVICE to BIND_TELEPHONY_DATA_SERVICE" 2018-02-03 02:01:46 +00:00
Jack Yu
568b81ac3f Renamed BIND_DATA_SERVICE to BIND_TELEPHONY_DATA_SERVICE
Also grated the permission to the phone process.

Test: Manual
Bug: 64132030
Change-Id: I1fc82a4e8038b1b05b56dcfa43c0c94955967700
2018-02-02 22:04:43 +00:00
Jack Yu
87b6963740 Added permission for binding data service
This is to make sure only the system can bind the data service.

Test: Manual
Bug: 64132030
Merged-In: Iaf4e4a604396ec37c83516f1d1f163614ef23c3d
Change-Id: Iaf4e4a604396ec37c83516f1d1f163614ef23c3d
2018-02-02 13:52:20 -08:00
Hall Liu
54ab6b91a8 Merge "Check for location access on TelephonyRegistry" am: 871202da2f am: cf59665a75
am: 56e6bd2cd1

Change-Id: If9989e10138a4fe923439c919807ca745d616043
2018-02-02 08:12:32 +00:00
Tyler Gunn
e2a66df86c Merge "Add call recording tone support." am: 8d5b08c430 am: eb74233ff9
am: 29d94726be

Change-Id: I67496b63f6a7f6362faed8c6a8cbff7cd665876c
2018-02-02 08:02:44 +00:00
Hall Liu
871202da2f Merge "Check for location access on TelephonyRegistry" 2018-02-01 23:05:22 +00:00
Hall Liu
8d584f0a91 Check for location access on TelephonyRegistry
When sending outbound callbacks on CELL_INFO and CELL_LOCATION, check to
make sure that the user has authorized us and the receiving app to get
information on their location.

Bug: 69637693
Test: manual: telephony testapp
Change-Id: Ib4c8c6a9765f504823016e538dd46768d1032792
2018-02-01 01:00:52 +00:00
Tyler Gunn
acdb686635 Add call recording tone support.
Adding carrier configuration option to specify whether the carrier requires
the incall recording tone be played.
Added phone account extra used in Telephony to communicate this to
Telecom.
Added permission pregrant for Telecom for MODIFY_AUDIO_ROUTING; this is
needed as Telecom listening to the AudioRecordingConfiguration callback
from the audio framework.  It needs the permission so that it can be
informed of the package names of recording apps.

Test: Manually enabled for local carrier and confirmed that recording
tone plays to remote party when a recording app is started on the device.
Bug: 64138141

Change-Id: I1ab521b79cbeeb4ff4dcbf83de7c17c539637bdc
2018-01-30 11:38:54 -08:00
Paul Duffin
2a9cd14900 Merge "Conditionally remove android.test.base from bootclasspath" 2018-01-30 11:20:50 +00:00
Alison Cichowlas
76f0ccb5f1 Revert "Security model for moving sharesheet to systemui"
This reverts commit 88f3d4dbe1dbc08316d8a9e25edce1ad16fe2eab.

Bug: 72554856
Test: repro instructions in bug
2018-01-29 16:34:33 -05:00
Paul Duffin
a3b692113c Conditionally remove android.test.base from bootclasspath
This makes the runtime handling of the android.test.base library
conditional based on a build flag REMOVE_ATB_FROM_BCP.

When REMOVE_ATB_FROM_BCP=true:
* The framework-atb-backward-compatibility is added to the
  bootclasspath instead of android.test.base.
* Any APK that targets pre-P (or has a dependency on android.test.runner)
  has android.test.base added to their library list.

Otherwise:
* The android.test.base library is added to the bootclasspath.
* Any APK that explicitly specifies that it depends on the
  android.test.base library has the library removed as the classes
  are available at runtime.

Added android.test.base to platform libraries so it can be used when
not on the bootclasspath.

Tested both cases by building with or without the build flag, flashing,
setting up, adding an account, adding a trusted place.

Also, tested that all combinations of REMOVE_ATB_FROM_BCP and
REMOVE_OAHL_FROM_BCP work.

adb install -r -g out/target/product/marlin/testcases/FrameworksCoreTests/FrameworksCoreTests.apk
adb shell am instrument -w -e class android.content.pm.PackageBackwardCompatibilityTest,android.content.pm.AndroidTestRunnerSplitUpdaterTest,android.content.pm.OrgApacheHttpLegacyUpdaterTest,android.content.pm.RemoveUnnecessaryOrgApacheHttpLegacyLibraryTest,android.content.pm.RemoveUnnecessaryAndroidTestBaseLibraryTest,android.content.pm.AndroidTestBaseUpdaterTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Bug: 30188076
Test: as above
Change-Id: I4b9d8a5bed6787cd334c2b13a458bbc0efc3f3b6
2018-01-29 11:48:44 +00:00