Commit Graph

14464 Commits

Author SHA1 Message Date
TreeHugger Robot
99e225d425 Merge "Fixed a racecondition when creating notification headers" 2018-11-29 03:00:40 +00:00
Michal Karpinski
958462ffe5 Merge "Add a setting for background activity starts enabled state and basic rules for enforcement" 2018-11-29 01:56:07 +00:00
yuemingw
4bcea96bde Add APIs for cross profile calendar whitelist in DPM.
Bug: 118444029
Test: atest DevicePolicyManagerTest#testCrossProfileCalendar_failIfNotProfileOwner
atest ManagedProfileTest#testCrossProfileCalendarPackage

Change-Id: Id7e6a2fc32ec8bcf770700df1596378c858168c2
2018-11-28 23:46:41 +00:00
Selim Cinek
10bbc0ea78 Fixed a racecondition when creating notification headers
Previously we were modifying the extras of a shared notification
during the notification creation, which breaks if multiple builders
are accessing the same notification. We're now passing these options
as parameters into the various functions.

Test: create low priority group / notification / observe normal behavior
Change-Id: I2aaa5632cff55a87937a2bb3f947f15555d2e897
Fixes: 117150727
2018-11-28 13:27:03 -08:00
Neil Fuller
f148c8d7d4 Merge "Track move of timezone classes to libcore.timezone" am: d48dbc9a34 am: f79ecf7c82
am: 402dc485d0

Change-Id: If9c8cfdce9bd0b3bcd460216edca369fd75abdde
2018-11-28 08:24:57 -08:00
Neil Fuller
402dc485d0 Merge "Track move of timezone classes to libcore.timezone" am: d48dbc9a34
am: f79ecf7c82

Change-Id: I1551e5d4330ea290ba3e3054349f79ee28f919c6
2018-11-28 08:10:04 -08:00
Michal Karpinski
8596dedf18 Add a setting for background activity starts enabled state
and basic rules for enforcement

The setting is on by default. It can be switched off with
a developer option (see accompanying commit) or
"adb shell settings put global background_activity_starts_enabled 0".

The setting is wired into ActivityStarter. When it's switched
off, all unsupported background activity starts are aborted and
it's currently manifested with a toast for quick feedback.

Only basic policy rules are added for now:
0) is it one of the most important UIDs?
1) does the calling app have any foreground activity?
2) is the calling process important enough to always be able
   to start an activity?
3) does the calling uid have any visible window?

The policy rules will be extended to allow for more use cases
in forthcoming CLs.

Most notable use cases not currently covered:
1) Notifications
2) Widgets
3) Shortcuts
4) Some of the most important system apps (e.g. com.android.vending)
5) Accessibility services and similar (IMEs covered thanks to
   visible window exemption)
6) Recents button double tap to open the previous app
See bluedoc for some more.

Bug: 110956953
Test: atest WmTests:ActivityStarterTests
Manual test:
  (on)  observe all activities are started as they used to be
  (off) starts not satisfying one of the above rules are aborted,
        a toast specifying callingPackage is shown instead
Change-Id:  I1a3e14828c96f005d975ef6998f3bda678ccab29
2018-11-28 15:08:28 +00:00
Patrick Baumann
fc2851e4d5 Removes ASEC-related logic from the framework
This change removes remaining ASEC-related logic from the framework in
preparation for install refactoring.

Bug: 109941548
Test: install still works
Change-Id: Ic7322038e45c026bcc59800a5a9fafdbb461021f
2018-11-27 12:56:14 -08:00
Jeff Sharkey
a789183401 Merge "Iterate on storage permissions model." 2018-11-27 15:51:14 +00:00
Neil Fuller
b8383a10b9 Track move of timezone classes to libcore.timezone
Some time zone related libcore classes are moving from
libcore.util to libcore.timezone.

Bug: 119026403
Test: build only
Change-Id: Ic807977a85276b888362295d1d305effe33076fc
2018-11-27 14:44:59 +00:00
TreeHugger Robot
18ff896138 Merge "Introduce Message.USER_LOCAL and added logic to map person to user id" 2018-11-27 13:44:39 +00:00
wilsonshih
968b30ee74 Support wallpaper on secondary displays.(4/N)
Provides a flag to let the system server and wallpaper picker know
if this wallpaper service supports multiple displays.

Bug: 115486823
Test: Manually test with modified wallpaper sample app.
Change-Id: I0c8b2c5d00bfd97d069511dda9965c557b5733c6
2018-11-27 04:47:46 +00:00
Wei Sheng Shih
da77cc6ea3 Merge "Support wallpaper on secondary displays.(3/N)" 2018-11-27 04:47:08 +00:00
TreeHugger Robot
dca59bf420 Merge "Do not update AppStandbyController on foreground service events" 2018-11-27 00:45:35 +00:00
TreeHugger Robot
b0851aef24 Merge "Add Notification.Builder.setAllowSystemGeneratedContextualActions()." 2018-11-26 21:59:33 +00:00
Hui Yu
7e5bf5c54f Do not update AppStandbyController on foreground service events
Change-Id: I3ce067c9e7aae50aaf9784f1a63618c6cbaea2cc
Fix: 119781710
Test: atest HostsideRestrictBackgroundNetworkTests#testAppIdleMetered_enabled
2018-11-26 11:14:40 -08:00
Jeff Sharkey
9787a9459d Iterate on storage permissions model.
This change updates the permissions design to use app-ops for
controlling write access, which is only extended to the default app
for a particular collection type.

Bug: 119713234
Test: atest android.appsecurity.cts.PermissionsHostTest
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I40811ff175b3b8410b58ed901948a23a56f8a8c2
2018-11-26 12:00:35 -07:00
Tony Mak
f99ee17fc0 Introduce Message.USER_LOCAL and added logic to map person to user id
1. Introduce Message.USER_LOCAL to allow caller to specify which
   message is from the local user.

2. TextClassifierImpl will now encode the Person object to a user
   id.

3. Fixed a bug in Person.equals check

BUG: 111437455
BUG: 111406942

Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java

Change-Id: I6629f42244a402fa210f87afa88a629c2ca4a510
2018-11-26 18:33:16 +00:00
TreeHugger Robot
50f27c4a60 Merge changes from topic "revert-to-single-threaded-oms-init"
* changes:
  Decouple the display manager from the overlay manager
  Revert: "Init of OverlayManagerService on a parallel thread"
2018-11-26 16:30:24 +00:00
Neda Topoljanac
19f291660d Managed System Updates API
Adding API to install a system update from a file on the device.

Test: manual in TestDPC, CTS tests for negative cases: atest com.android.cts.devicepolicy.DeviceOwnerTest#testInstallUpdate

Fixes: 116511569

Change-Id: I34b5c6344301a9d2d64c98dedc4ed5e4a75c57d1
2018-11-23 16:28:07 +00:00
wilsonshih
81e10a7068 Support wallpaper on secondary displays.(3/N)
The launchers which running on secondary displays can set the desired
wallpaper dimensions and paddings on correct display.
Preset reasonable wallpaper size for newly added displays.
Add some error handling between the binder calls.

Note: We still only save/load wallpaper info for default display, as most of
time secondary displays are not fixed.

Bug: 115486823
Test: atest WallpaperManagerTest
Test: atest WmTests
Test: atest ActivityManagerMultiDisplayTests

Change-Id: Ifd1a96fa185f2d75825c6fe8d3db69466b31c5c8
2018-11-23 17:12:24 +08:00
David Brazdil
7149b1e88c Merge "Create AppComponentFactory.instantiateClassLoader API" am: 67c6ab38ba
am: 060ec73ff2

Change-Id: I7c9f5fa3a9b1992b79cb26f77d03fddbf1ec6ff2
2018-11-22 03:50:07 -08:00
Gustav Sennton
761884ce27 Add Notification.Builder.setAllowSystemGeneratedContextualActions().
If an app doesn't add any smart replies or smart (contextual) actions to
their (message) notifications the Android platform fills in smart
replies and actions for the app.
With this CL we add a way to opt out of system generated contextual
actions.

Bug: 119765729
Test: atest NotificationContentViewTest
Change-Id: I6190fd197f74b8353f7113f2d8ba86068c2b78ab
2018-11-22 10:27:27 +00:00
Nicolas Geoffray
850f109ec8 Merge "Start using shared libraries class loader." 2018-11-22 10:24:38 +00:00
Nicolas Geoffray
8d144eb8bd Start using shared libraries class loader.
Change 1/2. Change 2/2 will setup the class loader namespace for
shared libraries.

This change sets up shared libraries class loaders for applications
and for dexopt.

bug: 111174995
Test: DexoptUtilsTest, device boots

Change-Id: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d
2018-11-22 10:06:41 +00:00
Gustav Sennton
fa830752aa Merge "Add smart actions to message notifications." 2018-11-22 00:58:46 +00:00
TreeHugger Robot
14c651bb7b Merge "Notify AutofillManager in onResume() IFF activity was not recreated." 2018-11-21 23:57:15 +00:00
Dianne Hackborn
07d5fc8691 Merge "Add new API to performing grouping and ordering of bindings." 2018-11-21 19:16:53 +00:00
Beverly Tai
8db41f6bef Merge "Override equals in Person object" 2018-11-21 18:24:52 +00:00
Dianne Hackborn
a631d56cf3 Add new API to performing grouping and ordering of bindings.
This will allow apps to better manage many isolated processes,
telling the system how they are grouped together (so should be
managed as one related entity within the LRU cache) and fine-tune
the ordering within that group.

The API is not yet tested...  though in theory it is implemented.
But the implementation done for that also fixes a *lot* of problems
with activity LRU management that, even without groups, should
make the ordering of processes in the LRU list much more consistently
match how recently the user has interacted with it.

Also clean up some of the new dumpsys output in the activity manager:
move the new sections to before the process output (so it is still
easy to see the process state at the end of the output), and add and
document the command line options for controlling them.  And add a
new "lru" section that gives a clear view of what is going on with
the raw LRU list.

An upcoming change will add tests for the new grouping functionality,
and probably some fixes resulting from that.

Test: atest CtsAppTestCases:ServiceTest
Bug: 111434506
Change-Id: I1f6b6b9de66ccde1573e1a0e9615e8c5f8e6c0d7
2018-11-21 09:13:21 -08:00
Gustav Sennton
eab5368d4f Add smart actions to message notifications.
Smart Action look similar to Smart Replies with an icon next to the
button text.
Smart Actions can be added either by an app, or by the framework itself
(through NotificationAssistantService).
The idea is that Smart Actions are really actions relating to the
content in the notification message.

The priority order of smart replies vs. actions will be dealt with in a
follow-up CL (i.e. whether we should prioritize showing smart actions
over smart replies).

Example notifications:
System generated:
https://screenshot.googleplex.com/f6p8uOMygeT.png
App generated:
https://screenshot.googleplex.com/VR6On1eh4CW.png
2 app generated actions:
https://screenshot.googleplex.com/QuM5e792xhb.png

Bug: 111406942
Test: manual tests = add custom actions directly in sys ui and ensure
they're shown in message notifications.
Test: atest SystemUITests

Change-Id: I0ce959b74e89bcabc69b76c50c1877e70d6f06df
2018-11-21 15:35:43 +00:00
Eran Messeri
fdf99084ed Merge "Grant Device IDs access to Profile Owner" 2018-11-21 07:26:40 +00:00
Jeff Sharkey
b071c47451 Merge "Define roles for Gallery and Music apps." 2018-11-21 05:05:13 +00:00
Hai Zhang
8e60a8fd1b Add role initialization to RoleControllerService.
This change adds RoleManager.setRoleNamesFromController() to allow
RoleControllerService to initialize the roles for a user. This change
also fixes the persistence of roles by calling writeAsyncLocked().

Bug: 110557011
Test: build
Change-Id: I921b6aa691478ca4c0dd1a75fc929a96ce1e7df5
2018-11-20 15:14:58 -08:00
TreeHugger Robot
d0f47278c4 Merge "Fix role granting flow." 2018-11-20 17:52:54 +00:00
Jeff Sharkey
ce80ed4490 Merge "Define app-ops for new storage permissions in Q." 2018-11-20 17:34:21 +00:00
Beverly
e98937afe3 Override equals in Person object
Test: atest NotificationDataTest
Change-Id: I8423a40c6f0ccf6d9cd0c3141487b84679d966ff
Fixes: 119029933
2018-11-20 11:01:00 -05:00
Zimuzo Ezeozue
621a683ea7 Merge "Add privileged API to control keyguard secure notifications" 2018-11-20 04:50:52 +00:00
Hai Zhang
b295ac4793 Fix role granting flow.
This change fixes various issues realted to the role granting
flow, including allowing permission controller to be granted
SET_PREFERRED_APPLICATIONS for roles, granting
MANAGE_ROLE_HOLDERS permission to shell, and improving
RoleUserState XML parsing.

Bug: 110557011
Test: build
Change-Id: Ia095580ad497af9cf7b29e6bedab70046b09d542
2018-11-20 01:09:33 +00:00
Jeff Sharkey
d2a1f0d693 Define app-ops for new storage permissions in Q.
Mostly mirrored off existing READ/WRITE_EXTERNAL_STORAGE app-ops,
but with new Aural/Visual runtime permission groups called out.

Bug: 117777783
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ibeb93428b6a20b33879117e455e9ef63af58f79e
2018-11-19 18:07:35 -07:00
Eugene Susla
973334dae7 Merge "Flip appops corresponding to default-granted permissions" 2018-11-19 23:17:03 +00:00
Hongming Jin
c796e17aa8 Merge "Add AppOps entries for read sms operation for financial apps." 2018-11-19 21:47:12 +00:00
TreeHugger Robot
76dd19544a Merge "Add ProcessMemoryHighWaterMark atom" 2018-11-19 19:04:38 +00:00
David Brazdil
b319ccfdcc Create AppComponentFactory.instantiateClassLoader API
Adds a hook to AppComponentFactory to allow control over the
instantiation of the main app class loader. LoadedApk creates
the default class loader and uses it to load the base APK. If
AppComponentFactory is declared in the manifest, its new method
instantiateClassLoader is called and its result becomes the
class loader used by LoadedApk to instantiate other classes
declared in the manifest. By default this is simply the class
loader created by LoadedApk.

Second method provides AppComponentFactory with a copy of
ApplicationInfo. The factory otherwise cannot locate any of the
app's resources, including its APK or the data folder.

Bug: 111342996
Test: atest CtsClassLoaderFactoryPathClassLoaderTestCases
Test: atest CtsClassLoaderFactoryInMemoryDexClassLoaderTestCases
Merged-In: Id21d9afaf00b9cb64a107bc9893b952407cff0b5
Change-Id: Id21d9afaf00b9cb64a107bc9893b952407cff0b5
(cherry picked from commit fd6dcc21d9)
2018-11-19 17:47:13 +00:00
David Brazdil
984d991e3b Merge "Create AppComponentFactory.instantiateClassLoader API" 2018-11-19 17:35:26 +00:00
Jeff Sharkey
8233860046 Define roles for Gallery and Music apps.
The new storage work in Q will extend capabilities to the default
Gallery and default Music apps, and we'll be implementing the
management of those default apps using the new roles feature.

This change starts by defining these roles using a relaxed definition
that only uses the existing CATEGORY_APP_* intent filters.

Bug: 119713234
Test: manual
Change-Id: I9bd32b57313cf712ce7441bcadef702dac866a3f
2018-11-19 09:05:03 -07:00
Rafal Slawik
3bea895a62 Add ProcessMemoryHighWaterMark atom
Collection of the RSS high-water mark is moved to a separate atom to
improve performance, increase flexibility and overcome security
constrainsts.
Performance: avoid reading /proc/pid/status in ProcessMemoryState;
flexibility: allow pulling RSS high-water mark on a different schedule;
security: add single point where we can trigger the high-water mark
reset.
The RSS high-water mark will be removed from ProcessMemoryState and
NativeProcessMemoryState atoms in a followup-up CL to ensure that the
collected data is continuous.

Bug: 119598534
Test: atest UidAtomTests#testProcessMemoryHighWaterMark
Change-Id: I52da7b5e695f771f1551e1f6a6a773bded4504d1
2018-11-19 15:44:06 +00:00
Zimuzo
b3b9c26543 Add privileged API to control keyguard secure notifications
I688e87cf09ad206f4f517a7be960c2aa01af8fc4, restricted privileged apps from silently becoming Device Admins.

Ia4e1ce9b81756e7f84ed0aa22d97e0b968cd8d89 added privileged APIs for locking the device and resetting the password.
We continue that work by providing an alternative for DevicePolicyManager#setKeyguardDisabledFeatures guarded by android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS

Bug: 111153365
Bug: 112601004
Test: Secure notifications can be redacted on keyguard
Change-Id: If81cecf6e74f7abcff581a122c4b68cc04ff57c6
2018-11-16 22:00:43 +00:00
TreeHugger Robot
e2dc21e1a3 Merge "Exposing canSuspendPackage as SystemApi" 2018-11-16 21:05:46 +00:00
Sahin Caliskan
661f548304 Merge "Fix RcsManager and add empty RcsThread class" am: 170c382729
am: 28534639bc

Change-Id: Iac6549fc8216edd7b6f6469f3bf4bc1a06432cd2
2018-11-16 09:59:24 -08:00