Commit Graph

7982 Commits

Author SHA1 Message Date
wangmingming1
4a4ceeeb79 notify netd about uid internet permission changes when package replaced
1. If a previous version of an app doesn't declare internet permission;
2. The User upgraded it to a new version and the new one does declare the
internet permission;
3. The new app are not allowed to access the internet until next boot

Bug: 137864893
Test: Manual, just make sure the onPackageChanged would be executed on package changes
Change-Id: I69cdbb16a027a9c4e974b32371b1f64a23a51a23
Signed-off-by: wangmingming1 <wangmingming1@xiaomi.com>
2019-09-20 03:23:23 +00:00
Kevin Hufnagle
c67e4da871 Merge "docs: Add condition for hiding synth. activities" into qt-dev am: 00537efd07
am: 12298403b0

Change-Id: I7a71cdb8fd5ecfd008d0e8257185cdd8c5366ce0
2019-09-18 17:39:27 -07:00
Kevin Hufnagle
00537efd07 Merge "docs: Add condition for hiding synth. activities" into qt-dev 2019-09-19 00:20:47 +00:00
Kevin Hufnagle
85bd2c62cb Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev am: 1fe99017eb
am: 1e8492c744

Change-Id: Idbc73307a0c3f4a937a2a964667f01b28aa274ce
2019-09-17 12:32:20 -07:00
Kevin Hufnagle
1fe99017eb Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev 2019-09-17 18:54:20 +00:00
Kevin Hufnagle
b8779b82bb docs: Add condition for hiding synth. activities
If an app doesn't have a launcher activity enabled by default, a
synthesized activity isn't created for that app.

Test: make ds-docs -j32

Bug: 140968734
Change-Id: I2fe8666ee8cde479f404e43c622f03891d96c38f
2019-09-17 18:48:39 +00:00
Varun Shah
667db1bea5 Merge "Use language tags to store Configuration's locale list." into qt-dev am: 6dfa267f91
am: 6947f255e4

Change-Id: Ic1954896252b758e8360c7fdf7cdeddb184bab03
2019-09-10 23:36:07 -07:00
Varun Shah
5e67462971 Use language tags to store Configuration's locale list.
Instead of storing each Locale within a Configuration object's locale
list by its language, country, variant, and script to proto, store the
entire locale list by its language tags representation which accurately
describes each locale.

Bug: 140197723
Test: atest ConfigurationTest
Test: atest UsageStatsDatabaseTest
Test: manually with bad data
Merged-In: I53946ed4e31de0ffe9c84875c391a7dec6f5375a
Change-Id: Idaae690f79a5c680ad0059a52be62160d9dfb5e7
2019-09-10 19:53:57 +00:00
Colin Cross
c09f17d559 Merge "Revert "Use language tags to store Configuration's locale list."" into qt-dev am: dd67a548b2
am: 18bf694f3c

Change-Id: I9481fb2063b8a38a86dd52867c4c9ad52e9b8c7a
2019-09-10 12:36:03 -07:00
Colin Cross
dd67a548b2 Merge "Revert "Use language tags to store Configuration's locale list."" into qt-dev 2019-09-10 19:18:48 +00:00
Varun Shah
68cdb74d91 Revert "Use language tags to store Configuration's locale list."
This reverts commit ff43f4e6a6.

Reason for revert: b/140813780

Change-Id: Id5988b9ec959ca9b294f6bd5caa30c8156238d0a
2019-09-10 18:30:47 +00:00
Varun Shah
6540f10816 Merge "Use language tags to store Configuration's locale list." into qt-dev am: bdfd7d6adb
am: ec466c0a8e

Change-Id: If5fbf5869ebed425d2df0d5472d7bbe859fb6505
2019-09-10 10:17:23 -07:00
Varun Shah
bdfd7d6adb Merge "Use language tags to store Configuration's locale list." into qt-dev 2019-09-10 16:51:37 +00:00
Anthony Hugh
6f5eadc0d3 Refactor PermissionManager.SPLIT_PERMISSIONS
Creating a SystemConfig from a non-system process is taking 500+ ms.
This CL instead exposes the needed split permissions from system_server
to optimize performance.

Tested locally and creating PermissionManager / retrieving SystemConfig
is now less than 1 ms.

Bug: 139828734
Bug: 139485700
Fixes: 139828734
Test: Added systrace / logs to PermissionController app and traced
runtime of onGrantDefaultRoles().

Merged-In: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
Change-Id: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
(cherry picked from commit f69c71e25889d8a9d66da05ee0f386d7fb626c6c)
2019-09-09 15:49:04 -07:00
Varun Shah
ff43f4e6a6 Use language tags to store Configuration's locale list.
Instead of storing each Locale within a Configuration object's locale
list by its language, country, variant, and script to proto, store the
entire locale list by its language tags representation which accurately
describes each locale.

Bug: 140197723
Test: atest ConfigurationTest
Test: atest UsageStatsDatabaseTest
Test: manually with bad data
Change-Id: Id0e63ae4a7be578d1e93838b371320f86a787e0e
2019-09-09 22:41:54 +00:00
Varun Shah
669d886cdc Fix bootloop issue with UsageStatsService.
When the configurations are being read from the proto file, if a
duplicate locale is found in the list, an exception is thrown from
LocaleList which causes the UsageStatsService to crash. Instead, we'll
now log a WTF if duplicate locales are found when parsing the
configuration proto and not add the duplicate locale to the list.

Bug: 140197723
Test: atest UsageStatsDatabaseTest
Change-Id: Ie178b3cfdd45e6771a7c0e4bb42e47f79b5c30cc
(cherry picked from commit 5d9031dbee)
2019-09-09 22:41:22 +00:00
Varun Shah
5d9031dbee Fix bootloop issue with UsageStatsService.
When the configurations are being read from the proto file, if a
duplicate locale is found in the list, an exception is thrown from
LocaleList which causes the UsageStatsService to crash. Instead, we'll
now log a WTF if duplicate locales are found when parsing the
configuration proto and not add the duplicate locale to the list.

Bug: 140197723
Test: atest UsageStatsDatabaseTest
Change-Id: Ie178b3cfdd45e6771a7c0e4bb42e47f79b5c30cc
2019-09-04 19:12:08 +00:00
Kevin Hufnagle
fbfe223a44 docs: Fixed contradictory info in IntentFilter
The docs now (correctly) state that, if an intent filter specifies no
actions, then it only matches intents that don't specify/contain an
action.

Test: make ds-docs -j32

Bug: 140435265
Change-Id: I8931c6540cb22edd15e8caa1be984ca70efcdc96
2019-09-03 21:54:31 +00:00
Kevin Hufnagle
5e1a48a660 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev am: b14d2dede2
am: 13e2b970ec

Change-Id: I393ec53ecf097e5ebe4ce2878e149fbf653df622
2019-08-28 17:39:34 -07:00
Kevin Hufnagle
b14d2dede2 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev 2019-08-28 22:08:47 +00:00
Andrew Solovay
676ef1a61c Merge "Docs: clarify getSharedPreferences behavior" into qt-dev am: 3791f9b071
am: 73a66dc100

Change-Id: Ie94b91be0696090bc1bcce4a787873886a268396
2019-08-28 13:45:51 -07:00
Kevin Hufnagle
25266af6f3 docs: Added desc. of launcher app criteria in Q
As of Android Q, an app is included in the return value of
LauncherApps#getActivityList() unless it fulfills specific criteria.
This CL describes the conditions necessary for an app's activities
to *not* appear in the list.

Test: make ds-docs -j32

Bug: 130352392
Change-Id: I6a6e17351a6c1234229d1d7eb8147ee2c24ee2c9
2019-08-28 17:55:59 +00:00
Nate Fischer
5272c3776d Docs: clarify getSharedPreferences behavior
No change to logic, only documentation.

This updates Context#getSharedPreferences docs:

 * Fix a typo ("thead" -> "thread")
 * Formatting: use <p> when appropriate, {@link} to other APIs, limit
   the @param to only a single sentence
 * Mention getSharedPreferences() may actually perform disk IO (this was
   undocumented)
 * Mention Editor#apply() as well as #commit()

Fixes: 140137651
Test: make docs
Change-Id: I245371d13d4f317c6c522debcdf7938ab783f897
2019-08-28 00:45:08 +00:00
Felipe Leme
87c5855e17 Fixed SystemServiceRegistry to return a null AppPredictionManager when the service is not defined.
Test: manual verification
Test: atest CtsAssistTestCases

Fixes: 139416391

Change-Id: Ieb2ae3f39bd42dc077ed3db1c6acdf429a39d519
2019-08-15 06:03:24 +00:00
Kevin Hufnagle
7ae4cbeeda Revert "docs: Added desc. of launcher app criteria in Q"
This reverts commit 786f22e416.

Reason for revert: Need further feedback from SMEs

Bug: 130352392

Change-Id: I51b3bd19e27d28fe3aea300893da50bbf889ec73
2019-08-14 19:35:23 +00:00
Kevin Hufnagle
786f22e416 docs: Added desc. of launcher app criteria in Q
As of Android Q, an app is included in the return value of
LauncherApps#getActivityList() unless it fulfills specific criteria.
This CL describes the conditions necessary for an app's activities
to *not* appear in the list.

Test: make ds-docs -j32

Bug: 130352392
Change-Id: Iad888a7a7f47d090da1b143ac152705577144d20
2019-08-12 16:52:41 -07:00
Dmitry Dementyev
40431ae1bc Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"
This reverts commit 8094880025.

Reason for revert: changed services order
Test: manual
Bug: 136261465

Change-Id: I2f78f0dbbace212309b87f779efad020cf255196
2019-07-02 03:59:17 +00:00
Andrew Sapperstein
9dd0c5628b Merge "Allow granting URI permissions to com.android.settings.module_licenses." into qt-dev 2019-06-28 16:56:04 +00:00
Mathew Inwood
3a75f264a8 Restore some greylist entries.
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
  information added

So they are being moved back to the greylist for Q.

Test: Treehugger
Bug: 136102585
Change-Id: I5ac8b8b9b23c3789d80239cf456072cc7dfa1203
2019-06-28 10:15:37 +01:00
Andrew Sapperstein
93f5ed6c18 Allow granting URI permissions to com.android.settings.module_licenses.
Exempts this new ContentProvider for providing mainline module licenses.

Also sets ApplicationInfo.publicSourceDir for APEXes.

Bug: 135183006
Test: open module licenses, click app, verify file opens
Change-Id: Iec4f1de198525f7cd176a52d8448a2c71b6aabc0
2019-06-24 18:24:52 -07:00
Amith Yamasani
5016a7891a Expose BIND_NOT_PERCEPTIBLE service flag
Using this flag when binding to a service will
allow the bound process to be held at a low
oom_adj of 250, so that it can be expunged to
reclaim memory if a more user-visible app needs
it.

Use for bindings such as job services and other
connections that the caller can easily recover
from and restart if necessary.

Adjust the lmk thresholds to use this oom_adj
as one of the levels, so they're killed before
perceptible apps (such as foreground services).

Bug: 135219821
Test: CtsAppTestCases
      Manually check notification listener oom_adj
      and dumpsys activity services output

Change-Id: I9f6d0891d842e4d12f7995b9b1a8f57b0903a16d
2019-06-19 14:40:57 -07:00
Narayan Kamath
157dd1dc40 Move legacy obb data migration to a handler thread.
The operation can potentially take a long time to complete
depending on the volume of data to be copied, so move it off
the ActivityManager handler thread that needs to be available
for other operations.

Bug: 134570017
Test: manual; set a 1 minute sleep in migrate_legacy_obb_data.sh

Change-Id: I3d2c52e8b012ed71c53810e6919d11be9a97cc6c
2019-06-12 13:40:15 +01:00
TreeHugger Robot
d703395fcb Merge "Expose PermissionManager as TestApi and fix SplitPermissionInfo equality" into qt-dev 2019-06-10 20:12:57 +00:00
Winson
f27394ee70 Expose PermissionManager as TestApi and fix SplitPermissionInfo equality
Bug: 129200416
Bug: 129200610

Test: atest SplitPermissionsTest

Change-Id: I98795944e6440e5b7ebba134bd7735a6f78ebc4f
2019-06-07 15:09:06 -07:00
TreeHugger Robot
f49c18e1a9 Merge "OMS: add TEST_MAPPING" into qt-dev 2019-06-06 20:44:49 +00:00
Bookatz
9313af68c2 loadUnbadgedItemIcon doesn't crash from getUserIcon
AppicationPackageManager.loadUnbadgedItemIcon would call
UserManager.getUserIcon if the icon was supposed to represent
switching to another the parent user (from a work profile).
However, that call requires extra permissions which may not be
available, which would cause a crash. The work profile doesn't
generally have permission to see the parent's icon, so rather
than showing the actual icon, a generic user icon is shown instead.

Bug: 134177607
Test: Manual confirmation: create a work profile and try to share a
picture (from Photos) to the personal profile.

Change-Id: Id79ca50b8e0a26593addbacf1a0ea709a2bc4da2
2019-06-05 03:03:24 +00:00
TreeHugger Robot
e5e876265c Merge "Verify staged APKs pre-reboot." into qt-dev 2019-06-01 00:25:51 +00:00
Gavin Corkery
5b9e00273b Merge "Perform user data back up in post install stage" into qt-dev 2019-05-31 16:10:13 +00:00
Dario Freni
f141aab4ed Verify staged APKs pre-reboot.
Test: adb install --staged file.apk on taimen-eng target; adb
install-multi-package file1.apex file2.apex file3.apk file4.apk
Test: atest StagedRollbackTest
Bug: 123753157
Change-Id: I41121b73c0db8ca55bafd2f57cba73bb3b940149
2019-05-31 14:55:08 +01:00
Gavin Corkery
ab5ee411e5 Perform user data back up in post install stage
Currently the backup of user data is done in the enable rollback stage,
during which there is no guarantee that the package being backed up is
not currently running. Moving the backup to the post install stage will
guarantee that the package is not running.

Test: atest RollbackTest
Test: atest StagedRollbackTest
Bug: 124032231
Change-Id: I4b42a0c5ade1645585d1d6f698637df950d05c72
2019-05-31 10:26:56 +01:00
TreeHugger Robot
8b486b7870 Merge "Fix install flag overlap" into qt-dev 2019-05-29 00:45:21 +00:00
Mehdi Alizadeh
f1affe0d17 Merge "Clone Persons field in ShortcutInfo only for app prediction" into qt-dev 2019-05-28 22:42:19 +00:00
Patrick Baumann
72a50878fe Fix install flag overlap
When INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS was added, its value
conflicted with iINSTALL_FORCE_VOLUME_UUID. A subsequent change added
INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS to all adb install
requests, resulting in all adb installs being force UUID installs and
thus breaking adoptable storage CTS. This change fixes that overlap.

Fixes: 133215060
Test: atest android.appsecurity.cts.AdoptableHostTest#testPackageInstaller
Change-Id: I8fbfcc0eea4f4447e4a446fe188b6edfc9cec0f6
2019-05-28 15:20:15 -07:00
TreeHugger Robot
05ec93ebc9 Merge "Made Context.CONTENT_CAPTURE_MANAGER_SERVICE visible for tests." into qt-dev 2019-05-28 16:17:27 +00:00
Mehdi Alizadeh
c60960278d Clone Persons field in ShortcutInfo only for app prediction
Persons field in ShortcutInfo should only be accessible when caller
has the MANAGE_APP_PREDICTIONS permission.

Bug: 123959894
Test: atest com.android.server.pm.ShortcutManagerTest1 \
  com.android.server.pm.ShortcutManagerTest2 \
  com.android.server.pm.ShortcutManagerTest3 \
  com.android.server.pm.ShortcutManagerTest4 \
  com.android.server.pm.ShortcutManagerTest5 \
  com.android.server.pm.ShortcutManagerTest6 \
  com.android.server.pm.ShortcutManagerTest7 \
  com.android.server.pm.ShortcutManagerTest8 \
  com.android.server.pm.ShortcutManagerTest9 \
  com.android.server.pm.ShortcutManagerTest10

Change-Id: I1908496dfbf9b11624b0746154bb5ea6f2d30c38
2019-05-27 13:36:42 -07:00
Gavin Corkery
ef441722c8 Allow PackageManager to retrieve inactive/factory APEXs.
Add functionality to ApexManager to filter the list of all APEX
packages in order to obtain lists of inactive or factory APEXs.
Expose this information to dumpsys.

Test: adb shell dumpsys package
Test: adb shell pm list packages -a --apex-only
Test: atest PackageParserTest
Bug: 123680735
Bug: 119767311
Change-Id: Id8ffe6320b55f647cdf550abfd6703cd868565ff
2019-05-25 19:03:51 +01:00
Brad Ebinger
a105253ea8 Merge "Add CAPABILITY_EMERGENCY_PREFERRED in PhoneAccount" into qt-dev 2019-05-24 17:45:47 +00:00
Philip P. Moltmann
3fb12ba490 Merge "Make sure to always upgrade runtime permissions" into qt-dev 2019-05-23 23:10:49 +00:00
Hai Zhang
c3c75a49ea Merge "Exclude packages that's not installed from the hash for role." into qt-dev 2019-05-23 20:38:36 +00:00
Felipe Leme
a7e4ca6a42 Made Context.CONTENT_CAPTURE_MANAGER_SERVICE visible for tests.
Test: m update-api
Fixes: 133438104

Change-Id: I5d10acdd79d1460736eaface8f6fc5b5014a1560
2019-05-23 13:36:26 -07:00