Commit Graph

6518 Commits

Author SHA1 Message Date
Jeff Vander Stoep
cab3639dcb Revert "Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion""
Commit 042f4bb6 'pm: Modify getPackage() to only return non-null
packages' prevents the NullPointerException. b/
This reverts commit 00b4fa8b13.

Bug: 74214574
Bug: 72290969
Test: Same tests run on original commit.
Test: successfully flash and boot from bild 4504078 to ToT master.
Change-Id: Ia1e900ebe0eb8f9d10fd0eddbf658f52e1ea79b4
(cherry picked from commit 32ef1c2eb0)
2018-03-07 18:49:12 +00:00
Jeffrey Vander Stoep
85d1b5c414 Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion"
This reverts commit 8196fd9380.

Reason for revert: b/74214574

Bug: 74214574
Change-Id: I9602872238ccc8a49d8b200e5389995d597f1c3a
(cherry picked from commit 00b4fa8b13)
2018-03-06 15:12:15 +00:00
TreeHugger Robot
3fbc54e609 Merge "Don't whitelist all system image apps." into pi-dev 2018-03-06 11:50:23 +00:00
Mathew Inwood
6827f4a2c8 Don't whitelist all system image apps.
Also include in system dump which packages are exempt from the api
restrictions.

This is a cherry-pick of 974290b032
from master.

Test: Verified that the device boots.
Bug: 64382372
Change-Id: Iaeca91478f53c8b4e9608246aab42bdb90f899bb
2018-03-06 09:54:55 +00:00
Amith Yamasani
14c716c911 Revert "Allow restoring of apps that rotated key"
This reverts commit 313d225cd1.

Reason for revert: b/74159113

Change-Id: I483ecdd80d26fca8451cd270b4fcbe34379839cb
2018-03-05 20:40:23 +00:00
Adam Lesinski
40a32d9ff0 Merge "Refactor AssetManager" 2018-03-02 22:05:45 +00:00
TreeHugger Robot
15881d7c0c Merge "pm: SharedUserId: Assign seinfo using actual targetSdkVersion" 2018-03-02 21:56:30 +00:00
TreeHugger Robot
fddc22678c Merge "Copy PermissionChecker from support lib and use in RcognitionService" 2018-03-02 20:01:33 +00:00
TreeHugger Robot
6f5ed04ab7 Merge "Addresses API feedback for Intent Discovery change" 2018-03-02 15:52:32 +00:00
Jeff Sharkey
341c2366cc Merge "Force loading of safe labels in system_server." 2018-03-01 18:04:16 +00:00
Patrick Baumann
3abf547d1f Addresses API feedback for Intent Discovery change
* Clarifies purpose and effects of resolver methods
* Adds javadocs to non-obvious constructors and constants

Test: none - no functional changes
Bug: 73950163
Change-Id: Id668b890a8c97da74502698f71b16cc213eda6c6
2018-03-01 10:03:05 -08:00
TreeHugger Robot
15c3e602e9 Merge "Removed AMS.updatePersistableUriPermission()" 2018-03-01 17:30:33 +00:00
Adam Lesinski
bebfcc46a2 Refactor AssetManager
Bug: 64071469
Test: atest CtsContentTestCases
Change-Id: Ia6856157e8813856268fba003e1e591d690cb26e
2018-02-28 19:06:48 -08:00
TreeHugger Robot
50db5a45ac Merge "Make activity-alias inherit "enableVrMode" attribute from target activity." 2018-03-01 02:59:49 +00:00
Jeff Vander Stoep
8196fd9380 pm: SharedUserId: Assign seinfo using actual targetSdkVersion
Assign the targetSdkVersion component of SeInfo using the lowest
targetSdkVersion of all apps within a SharedUserId.

Bug: 72290969
Test: cts-tradefed run cts -m CtsAppSecurityHostTestCases
Test: cts-tradefed run cts -m CtsSelinuxTargetSdk{current,25,27}TestCases
Test: install sharedUserId app with targetSdkVersion=28, then install
    app with targetSdkVersion=26. Verify that they share the same domain
    and data is correctly labeled.
Change-Id: I9476d10bf3c6a769d63a45a4314aaa91203880b8
2018-02-28 16:59:34 -08:00
Joe Maples
6997ad6926 Merge "pm: Fix typo in error" am: a12e18bcd1 am: a79fef132b
am: 1ec4c3b3b1

Change-Id: I9d1b48c0852bc75108ab72cd4c58c08a43b62a8b
2018-03-01 00:09:25 +00:00
Joe Maples
1ec4c3b3b1 Merge "pm: Fix typo in error" am: a12e18bcd1
am: a79fef132b

Change-Id: I45fa701a8f9e727e1a072f4f6dd773bba0de01aa
2018-03-01 00:00:13 +00:00
TreeHugger Robot
19130fea91 Merge "More work on issue #73301635: Ability to extract device configuration" 2018-02-28 23:19:13 +00:00
Felipe Leme
988234a343 Removed AMS.updatePersistableUriPermission()
Bug: 72055774

Test: manual verification
Test: atest CtsAppSecurityHostTestCases:ScopedDirectoryAccessTest#testResetDoNotAskAgain,testResetGranted
Test: atest CtsAppSecurityHostTestCases:ScopedDirectoryAccessTest

Change-Id: I90cd9a79a1caa19989e00dbc1a656469bc3221f9
2018-02-28 15:15:37 -08:00
Jeff Sharkey
b0613dceb0 Force loading of safe labels in system_server.
It's too easy for code to accidentally use loadLabel() when building
strings for security sensitive contexts, so add ability for a process
to always force loading of safe strings.

Test: builds, boots
Bug: 73657770
Change-Id: I1c7645bd7bebed0cfb6bc3e5bfd36c8cb11d4838
2018-02-28 23:06:04 +00:00
TreeHugger Robot
501427818a Merge "Add component ordering" 2018-02-28 21:54:03 +00:00
Dianne Hackborn
337e01ac10 More work on issue #73301635: Ability to extract device configuration
Now include Gl extensions (thanks to whoever wrote the code
I copied!).

Tweak the protos a bit to include missing info and correct
some things.

Add some new test APIs that are needed for CTS.

Bug: 73301635
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerGetConfigTests
Change-Id: Ie3f8173d217468246e8b6c7f45b7cbfcb352d60f
2018-02-28 11:29:20 -08:00
Joe Maples
39bb9e8905 pm: Fix typo in error
instnat -> instant

Change-Id: Ie2f06840575fc266e3510252635ad17be65945b8
Signed-off-by: Joe Maples <joe@frap129.org>
2018-02-28 18:42:08 +00:00
Todd Kennedy
6d418b6293 Add component ordering
When multiple activities match the same Intent, allow app developers
to reorder matched results within their own application. This is not
a replacement for priority which reorders matched results between
applications.

Change-Id: I12ee987622e12e40d6b5b48f616cc362d01381de
Fixes: 64582537
Test: atest -it CtsAppSecurityHostTestCases:PackageResolutionHostTest
2018-02-28 09:16:07 -08:00
Michal Karpinski
961f409d37 Merge "Allow restoring of apps that rotated key" 2018-02-28 10:08:14 +00:00
Winson Chung
a29de13cee Merge "1/ Fixing docked task animation when entering split screen from home" 2018-02-28 03:30:31 +00:00
Winson Chung
c1674270b5 1/ Fixing docked task animation when entering split screen from home
- Update the minimized state when docking an app from home to ensure that
  the animation of the docked task goes to the right bounds
- Temporarily block the invocation of the old recents activity when showing
  recents as a part of setting the windowing mode of another task (this is
  fine right now because quickstep only allows docking via the UI and not
  from the nav bar while another task is open).
- Add proto field so we can determine whether to check the recents activity
  from the split screen CTS tests
- Also fix issue with invisible docked task due to wrong bounds calculated
  due to launcher not notifying the divider of the first docked frame

Bug: 73118672
Test: go/wm-smoke
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerSplitScreenTests
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerTransitionSelectionTests

Change-Id: Ib1208501c311de009a9e706103134865c521cb63
2018-02-27 16:49:30 -08:00
Jeff Sharkey
15739d3099 Merge "Add explicit method to clear clipboard." 2018-02-27 23:10:44 +00:00
Siyamed Sinir
27ddd8a9a4 Use LocaleList.read/writeParcel in Configuration
Instead of parcel and unparceling locales in LocaleList in
Configuration use LocaleList.read/writeParcel.

Bug: 73891437

Test: atest android.content.res.cts.ConfigurationTest
Test: atest android.content.res.ConfigurationTest
Change-Id: Id65a7e36487375f0e3a2c2da44ad8d7c5ea49734
2018-02-27 13:10:54 -08:00
Jeff Sharkey
d60e07f04f Add explicit method to clear clipboard.
Fix several bugs along the way:

-- Clipboard permissions weren't being revoked for related users
when a new primary clip was set.
-- checkGrantUriPermissionLocked() wasn't checking to see if an
otherwise-open provider requires permissions on specific paths.
-- When granting Uri permissions for clipboard data, we need to
include the real source UID for the grant; we no longer allow the
system UID to source grants, to avoid confused deputy problems.
-- Use the Handler passed into ClipboardManager constructor so
it lives on the right thread.

Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.cts.ClipboardManagerTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests
Bug: 71711122, 73797203
Change-Id: I99315035efc0c6a90471c279311294dc86766c8d
2018-02-26 14:43:11 -07:00
rongliu
c12ede432c Make activity-alias inherit "enableVrMode" attribute from target activity.
Bug: 65271215
Test: Manual test. Start vr activity-alias when vr mode is on,
it doesn't quit vr mode in the middle.

Change-Id: Ifcac2a07765fcac848f42553be46209dc67361fd
2018-02-26 10:23:09 -08:00
Michal Karpinski
313d225cd1 Allow restoring of apps that rotated key
Restoring of apps that rotated key wouldn't be possible due to
explicit signature matching.
Amend signature matching strategies to take into account
apps that have rotated key.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/backup/utils/AppBackupUtilsTest.java
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/pm/backup/BackupUtilsTest.java
Test: m -j RunFrameworksServicesRoboTests
Test: runtest -p com.android.server.backup frameworks-services
Bug: 64686581
Bug: 34345052
Change-Id: I91b5ae0afb6f2714ceae02b4d4dc202d6cd4fe4e
2018-02-26 11:05:40 +00:00
TreeHugger Robot
4e056c8bfa Merge "Explicitly do not support SEARCH_SERVICE on UI_MODE_TYPE_WATCH" 2018-02-24 02:13:27 +00:00
TreeHugger Robot
8ae9a37bbc Merge "Implement issue #73301635: Ability to extract device configuration" 2018-02-24 01:21:34 +00:00
Erik Wolsheimer
ac5cecd85d Explicitly do not support SEARCH_SERVICE on UI_MODE_TYPE_WATCH
Bug: 69950606
Change-Id: Ia195e88d8652cd7875d0ce03875034698367001c
(cherry picked from commit 980ba14b921932e85cdc0447af0398778a1c0d64)
2018-02-23 23:45:18 +00:00
Dianne Hackborn
bf5ba6bbcc Implement issue #73301635: Ability to extract device configuration
am get-config can now return its information as a protobuf,
so that we have a nice machine readable representation of the
configuration available.  This is available through the new
"--proto" option.

Also add a new "--device" option which will include additional
device configuration information in the output.

Defined the protos to contain all of this information.  Updated
Configuration to generate everything it should in the proto.

The output has been changed so that configuration history
will not be returned unless you specify the --days option.

Bug: 73301635
Test: Booted, ran, output

Change-Id: I074b92b45d6b1da1c1a499080db9e006d12b9fea
2018-02-23 15:30:04 -08:00
Eugene Susla
726b51a26e Copy PermissionChecker from support lib and use in RcognitionService
Fixes: 73511076, 73311729
Test: presubmit
Change-Id: Ie98f67ffee4744050ac85d8b229370a16a76a194
2018-02-23 12:53:55 -08:00
Calin Juravle
759fbda51b Revert "Revert "Log the apk optimization state in the MetricsLogger""
This reverts commit 203a9ab766.

Reason for revert: Fix the original issue. There was a race with the
cleanup method which was resetting the app record to null.

Test: manual, adb logcat -b events | grep sysui_multi_action
      repeat steps from bugreport reporting the crash
Bug: 73102540

Change-Id: I6d9c6110a9d5dadeb9d4361592711d63563c958a
2018-02-22 16:53:48 -08:00
Mathew Inwood
60b6925bdb Merge "Package whitelist for hiddenapi checks." am: 9a50d75795
am: 3d2a3e25d3

Change-Id: I8e0120c77965a3d5784e61c7eabe5a8c4f88b1ea
2018-02-22 14:29:23 +00:00
TreeHugger Robot
3382443927 Merge "Update javadoc of PackageInstaller to mention the enterprise bit" 2018-02-22 12:02:38 +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
TreeHugger Robot
cc59285997 Merge "Package whitelist for hiddenapi checks." 2018-02-21 19:55:23 +00:00
TreeHugger Robot
00bbbd8a52 Merge "ApplicationInfo: Copy compileSdkVersion* fields" 2018-02-21 18:05:38 +00:00
Makoto Onuki
2ebb021231 Merge "Shortcut permissions for default text classifier" 2018-02-21 17:22:28 +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
Adam Lesinski
d3ea009911 ApplicationInfo: Copy compileSdkVersion* fields
Bug: 69798373
Test: atest CtsActivityManagerDeviceTestCases:PrereleaseSdkTest
Change-Id: I4208da1fc52f5567f23eceb87a2787fef60adc5f
2018-02-20 16:51:41 -08:00
Makoto Onuki
700feef8a6 Shortcut permissions for default text classifier
- Add two shortcut related permissions as SystemAPI for the default
text classifier.

- The default text classifier package name still comes from the
system resource.

Bug: 73083596
Bug: 71555985
Test: atest CtsPermission2TestCases
Test: Manual test with a test package, with the following in config.xml
<string name="config_defaultTextClassifierPackage" translatable="false">com.example.android.pm.shortcutlauncherdemo</string>

Change-Id: I19081d9d6ba0b33eb25d19aa55b4fe2f26a75897
2018-02-20 12:14:18 -08:00
Narayan Kamath
28ff9ceeeb Merge "Revert "Log the apk optimization state in the MetricsLogger"" 2018-02-20 18:17:34 +00:00
Narayan Kamath
203a9ab766 Revert "Log the apk optimization state in the MetricsLogger"
This reverts commit 0a8bea818c.


E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: ActivityManager
E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.android.server.am.ProcessRecord.requiredAbi' on a null object reference
E AndroidRuntime:        at com.android.server.am.ActivityMetricsLogger.logAppTransition(ActivityMetricsLogger.java:504)
E AndroidRuntime:        at com.android.server.am.ActivityMetricsLogger.access$100(ActivityMetricsLogger.java:62)

Bug: 73626352
Change-Id: Idd50e0d2cf34e5393b4ae76ef8bc48b0067532eb
2018-02-20 17:06:21 +00:00
Tony Mak
366ee6269d Update javadoc of PackageInstaller to mention the enterprise bit
FIX: 70377922

Change-Id: I87fb995ff476448511076077ba99b1fe3d79b819
2018-02-20 15:07:01 +00:00