Commit Graph

6528 Commits

Author SHA1 Message Date
Michal Karpinski
d766e212c9 Merge "Allow restoring of apps that rotated key" into pi-dev 2018-03-15 10:13:34 +00:00
TreeHugger Robot
75a3173245 Merge "Fix cleartext default for the manifest value" into pi-dev 2018-03-15 02:50:20 +00:00
TreeHugger Robot
265b11ffb2 Merge "Also apply prefix when dumping isAllowedToUseHiddenApi" into pi-dev 2018-03-15 00:37:37 +00:00
Yohei Yukawa
f3ca7a73dc Also apply prefix when dumping isAllowedToUseHiddenApi
This is a follow up CL to a CL [1] that added one more state dump from
ApplicationInfo regarding whether the app is exampted from the API
restriction but forgot to take care of prefix handling.

 [1]: I01e837253d00c6ffa841a9e5c226204a3e11b827
      974290b032

Bug: 64382372
Test: Ran the following command to see "isAllowedToUseHiddenApi"
      is aligned with other outputs from ApplicationInfo.
         adb shell ime list -a
Change-Id: I9c77d9b557245b7f3b51631140bd564feef601ce
2018-03-14 13:43:47 -07:00
Todd Kennedy
662504f941 Enable local search for instant apps
When getting the set of searchable activities, fetch instant
applications. But, this means that the set needs a final
filter to prevent leaking application existence.

Change-Id: I6b9daf031ce54061c4500d9edae1d738848158c4
Fixes: 68211791
Test: atest -it CtsAppSecurityHostTestCases:EphemeralTest#testGetSearchableInfo
(cherry picked from commit 8b9d664cae)
2018-03-14 20:31:11 +00:00
TreeHugger Robot
5741823729 Merge "Removed redundant method ContentResolver.releasePersistableUriPermission()" into pi-dev 2018-03-14 18:42:38 +00:00
Chad Brubaker
0d285d5117 Fix cleartext default for the manifest value
If no network security config is set the default value of
cleartextTrafficPermitted comes from the legacy
android:cleartextTrafficPermitted, default this to false for apps
targeting P to track the network security config behavior as was
intended.

Bug: 74587672
Test: atest CtsNetSecPolicyUsesCleartextTrafficUnspecifiedTestCases
Change-Id: I6367723befa1b947063554c9c061bdfc5be3d116
2018-03-14 09:45:52 -07:00
Michal Karpinski
528c3e572a 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
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest1.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest2.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest3.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest4.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest5.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest6.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest7.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest8.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest9.java
Test: atest frameworks/base/services/tests/servicestests/src/
      com/android/server/pm/ShortcutManagerTest10.java
Test: atest CtsShortcutManagerTestCases
Bug: 64686581
Bug: 34345052
Bug: 74208476
Bug: 74159113

Change-Id: Ica23bbfec89648d9348c65db4597188e8c18e1d8
2018-03-14 16:11:18 +00:00
Fyodor Kupolov
70e7543066 Added ACTION_BATTERY_LEVEL_CHANGED
Sent when the current battery level changes.

It has EXTRA_EVENTS that carries a list of Bundle instances representing
individual battery level changes with associated extras from
ACTION_BATTERY_CHANGED

Each event has EXTRA_EVENT_TIMESTAMP representing time when it occured.

Test: manual
Bug: 74020080
Change-Id: I993005950299c5298c9111ca51cc7717e1f029de
2018-03-08 10:09:01 -08:00
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
Felipe Leme
bb01e5e538 Removed redundant method ContentResolver.releasePersistableUriPermission()
Bug: 72055774

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

Change-Id: Iab6dde04b0dc43f97e1a66f665cf5f6f3e078381
2018-03-05 14:09:46 -08: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