Commit Graph

14410 Commits

Author SHA1 Message Date
TreeHugger Robot
76dd19544a Merge "Add ProcessMemoryHighWaterMark atom" 2018-11-19 19:04:38 +00:00
David Brazdil
984d991e3b Merge "Create AppComponentFactory.instantiateClassLoader API" 2018-11-19 17:35:26 +00: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
TreeHugger Robot
e2dc21e1a3 Merge "Exposing canSuspendPackage as SystemApi" 2018-11-16 21:05:46 +00:00
David Brazdil
fd6dcc21d9 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
Change-Id: Id21d9afaf00b9cb64a107bc9893b952407cff0b5
2018-11-16 11:45:47 +00:00
Gustav Sennton
413ce3b609 Merge "Add a Notifications API for contextual (smart) actions." 2018-11-16 10:22:39 +00:00
Beverly Tai
d930e7f49b Merge "Update channelBypassingDnd on user unlock + switch" 2018-11-15 18:06:07 +00:00
Suprabh Shukla
1f1de70fad Exposing canSuspendPackage as SystemApi
Exposing canSuspendPackage so apps with SUSPEND_APPS can query whether a
package is considered too critical to suspend by the system.

Test: atest GtsSuspendAppsTestCases

Fixes: 117968270
Change-Id: I9c316dae7e7a7259d28e271c3901465244d6c93d
2018-11-14 17:15:39 -08:00
Todd Kennedy
4466f7169f Merge "setup content observer statically" 2018-11-14 22:54:33 +00:00
Beverly
0479cde2b7 Update channelBypassingDnd on user unlock + switch
Also add method that returns the number of apps
that are bypassing dnd

Test: atest PreferencesHelperTest
Fixes: 115972200
Bug: 111475013
Change-Id: Id75093f9f42d00d05cca7700f64493d702c6a518
2018-11-14 16:10:43 -05:00
Gustav Sennton
1463d83d4e Add a Notifications API for contextual (smart) actions.
With this CL we add a new semantic action to Notification.Action to
represent contextual actions - i.e. actions specific to the current
notification. Contextual actions will be displayed differnently to
regular actions.

If the app itself does not provide smart replies or smart actions the
framework will generate smart replies and actions and put those in the
notification.

The UI for smart actions will be added in a separate CL.

With this CL we also remove a couple of unnecessary fields, namely:
NotificationInflater.mSmartActions
NotificationInflater.AsyncInflationTask.mSmartActions
the actions stored in these fields are stored in
NotificationData.Entry anyway.

Bug: 119010281
Test: write an app adding an Action with the new semantic type and
ensure that (contextual) action doesn't show up with the other actions.
Test: atest SystemUITests

Change-Id: Icd192fe2273b0474729dd4e413e0a6c2d75ff0fa
2018-11-14 20:52:01 +00:00
Todd Kennedy
e4a8dbd80b setup content observer statically
Instead of waiting for the first time we get the app op default mode,
just register the content observer for the sms & call log restriction.
This is temporary code anyway and will be removed according to a
STOPSHIP comment. So, the minor hit taken during system start is okay
for now.

Test: Device boots.
Change-Id: I55cc57ddfe80acf304b5126db16f5813a97c7042
Fixes: 119080532
2018-11-14 09:22:05 -08:00
Dianne Hackborn
27b4d94a07 Implement naming of isolated service bindings.
This allows clients to run multiple instances of the same
manifest service declaration.  It only works for isolated
services, to avoid too much abuse temptation.  This is part
of the "Chrome site isolation" work, to allow chrome to have
many more render processes running and help it manage them.

Bug: 111434506
Test: atest CtsAppTestCases:ServiceTest
Change-Id: I22e65758678a07075ed32ed6463082ddf846d3a4
2018-11-13 16:03:02 -08:00
Hui Yu
81f977753a Merge "Add UsageStats events for foreground service start/stop." 2018-11-13 18:16:19 +00:00
Sahin Caliskan
4c070fa443 Merge "Fix RcsManager and add empty RcsThread class" 2018-11-13 16:17:06 +00:00
Wale Ogunwale
99b5308dca Merge "Expose display ID related APIs for use by CTS" 2018-11-13 15:04:59 +00:00
TreeHugger Robot
504fdabba9 Merge "Move native process memory state pulling code" 2018-11-13 12:12:44 +00:00
Tiger Huang
fc2184596e Expose display ID related APIs for use by CTS
For CtsWindowManagerDeviceTestCases:WindowFocusTests

Bug: 111361570
Test: atest WindowFocusTests android.view.cts.KeyEventTest
Change-Id: I273120f71f42d2eaa52786b4a350f3c099d11989
2018-11-13 13:38:23 +08:00
Hui Yu
e361a23bba Add UsageStats events for foreground service start/stop.
1. Send FOREGROUND_SERVICE_START event when foreground service starts.
Send FOREGROUND_SERVICE_STOP event when foreground service stops.
2. One app can multiple foreground services and multiple services can be
started. Because this, in UsageStats, change mLastForegroundEvent to
className to event map, do this for both activity and foreground
service. Change UsageStatsProto and UsageStatsXmlV1 to support this
change.
3. Add more test cases in UsageStatsTest.java.

Test: start music player which is foreground service, observce these
two events when start play and pause play.

Change-Id: I3dc14f5b73cc114a53b8c51f90d3011d9ace35ac
Bug: 112002260
Test: atest UsageStatsTest#testForegroundService
atest frameworks/base/services/tests/servicestests/src/com/android/server/usage/UsageStatsDatabaseTest.java
atest frameworks/base/core/tests/coretests/src/android/app/usage/UsageStatsTest.java
2018-11-12 17:41:03 -08:00
Sahin Caliskan
9458ebccfc Fix RcsManager and add empty RcsThread class
This change fixes the RcsManager setup and adds an empty RcsThread class. Please see go/rcs-in-telephony-doc for details.

Test: Builds fine
Bug: 109759350
Change-Id: Ie3fe476ab11d515ffab6dcc6ccf5ec801a4c9057
2018-11-12 15:52:54 -08:00
Sudheer Shanka
87915d66c3 Update storage sandbox path translation methods.
Update these methods to consider if the app is sandboxed or not.
Earlier, only apps with WRITE_MEDIA_STORAGE have access to full
external storage. So, clients had to check this before calling
these translate methods. Now, apps under instrumention might also
have full storage access and DownloadProvider will also start
using these translate methods. So, instead of having the clients
deal with it, move the logic of checking if an app is sandboxed or
not into these translate methods.

Bug: 117229024
Bug: 119265456
Test: atest MediaProviderTests
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Test: atest services/tests/servicestests/src/com/android/server/StorageManagerServiceTest.java

Change-Id: If679e71a906bb2106752721409b4410557fb3e28
2018-11-12 14:56:58 -08:00
TreeHugger Robot
f5525d4529 Merge "Includes foreground services in top notification section." 2018-11-12 21:42:27 +00:00
TreeHugger Robot
79dc57f06c Merge "Fix off-by-one error in historical app ops." 2018-11-12 21:40:18 +00:00
Joel Galenson
d829b16b0b Fix off-by-one error in historical app ops.
Both the comment and the usage suggest that this index should be
exclusive, not inclusive.

Bug: 111061782
Test: Call getBackgroundAccessCount without crashing
Change-Id: Ie4eb5a59874afd27bed0706cd177757155351b49
2018-11-12 10:43:55 -08:00
Winson Chung
d27f6b3fc6 Merge "Expose task id and activity component in task snapshot and assist structure" 2018-11-12 17:56:22 +00:00
Gus Prevas
b0c1a4622c Includes foreground services in top notification section.
This change modifies the various components which treat high-priority
notifications differently, including the status bar, the lockscreen, and
the notification layout algorithm, such that foreground service
notifications are always included among the high-priority notifications.
This logic is now centralized in NotificationData.

Bug: 116622974
Bug: 118805186
Test: manually
Change-Id: Ia13c1aac0cf91c400594df96ce267e768133f8d1
2018-11-12 10:55:53 -05:00
Alison Cichowlas
69f39989c2 Merge changes from topic "sharesheet-refactor"
* changes:
  Add URI shared by screenshot into extras.
  Re-patching in Sharesheet security model changes.
2018-11-12 15:19:11 +00:00
Rafal Slawik
c37626215b Move native process memory state pulling code
Refactor the pulling code to avoid going to AcitivityManagerService.
Instead call MemoryStatUtil that reads procfs directly from
StatsCompanionService.

Bug: 118736433
Test: atest UidAtomTest
Change-Id: Idf57e3cd33058651f363c89828f71d19f25e6450
2018-11-12 09:59:35 +00:00
TreeHugger Robot
929cd0837a Merge "Add RoleManager into SystemServiceRegistry." 2018-11-10 17:07:26 +00:00
Svetoslav Ganov
d641d64ab4 Merge "Allow adopting a subset of shell permissions" 2018-11-10 01:10:31 +00:00
TreeHugger Robot
1045456b95 Merge "AM: Fix deadlock when calling AMS from ATMS/WM" 2018-11-10 01:09:26 +00:00
Hai Zhang
4ef21d0308 Add RoleManager into SystemServiceRegistry.
This change adds RoleManager into SystemServiceRegistry so that
Context.getSystemService() can work properly for RoleManager.

Bug: 110557011
Test: build
Change-Id: I81b7ed87e71f0deee090252f5bedf42eb79806aa
2018-11-09 14:43:51 -08:00
Alan Stokes
07317d001c Merge "DexLoadReporter needs to handle arbitrary class loaders." am: f2d5ace011 am: 1e29264790
am: 0a0559c0ce

Change-Id: I3a89a9da435cf557fd296066df7b9c5b316e87c2
2018-11-09 14:23:00 -08:00
Svet Ganov
5e86959d04 Allow adopting a subset of shell permissions
Add an API to allow adopting a subset of shell UID permissions.

Test: added - android.app.uiautomation.cts.UiAutomationTest#testAdoptSomeShellPermissions
      passed - atest atest android.app.uiautomation.cts.UiAutomationTest

bug:80415658

Change-Id: I5cd8beeed7e586b2ac4e0cb16686cef738641e23
2018-11-09 11:51:26 -08:00
John Reck
6ae76d0d8a Merge "Refactors and a potential public API for rendering" 2018-11-09 19:16:27 +00:00
Eugene Susla
72e8228fb8 Merge "Adjust default app op behavior based on feature state" 2018-11-09 17:44:46 +00:00
Winson Chung
48b25653f4 Expose task id and activity component in task snapshot and assist structure
- This would allow the AiAi service to cross-reference assist data with
  streaming text data and snapshots
- Pre-fill the task id/activity when receiving the assist data from the
  activity and remove unnecessary autofill santization down the line

Bug: 117268952
Test: adb shell dumpsys window all
Test: atest CtsAutoFillServiceTestCases
Test: atest CtsAssistTestCases

Change-Id: I0d0d2c85426777cc77397716db34b520593db100
2018-11-09 09:08:11 -08:00
Vishnu Nair
006ee3fef6 AM: Fix deadlock when calling AMS from ATMS/WM
Instead of calling AMS synchronously, release the wm lock and pass it to AMS. Wait for AMS to
notify us when its done.

Fixes: 119265867, 119275681
Test: adb shell am start-activity -S -W com.google.android.apps.maps/com.google.android.maps.MapsActivity
Test: atest CtsSampleHostTestCases
Change-Id: Idc2895c14ccd92524e88ce3dda24b3d0e8dce2c1
2018-11-09 16:56:17 +00:00
Alison Cichowlas
3e34050a42 Re-patching in Sharesheet security model changes.
Previously reverted due to b/72554856, fix for that in topic.

Original commit message:

Security model for moving sharesheet to systemui

ResolverActivity (still in frameworks) now requests a "permission token"
that it hands to a stubbed system ui activity ChooserActivity.

This permission token allows an app (SysUI) with the signed permission
"START_ACTIVITY_AS_CALLER" to call
ActivityManagerService#startActivityAsCaller. Permission tokens are a
one-time use, limited-time offer.

Test: runtest systemui && manual testing
Bug: 69850752
Change-Id: Ia50e21e2f8c6b6d0ed7207625e3b5aef214396bb
2018-11-09 11:01:54 -05:00
Gus Prevas
a32264906d Adds an icon to noisy notifications.
Test: manually
Bug: 116622974
Change-Id: I657e81eed9c650f1613caffaea96e6445c2105ef
2018-11-09 10:35:27 -05:00
Alan Stokes
0a0559c0ce Merge "DexLoadReporter needs to handle arbitrary class loaders." am: f2d5ace011
am: 1e29264790

Change-Id: I41caab25c48d496722ac4d044908dd781df1705d
2018-11-09 03:20:40 -08:00
Kevin Chyn
a85b4a2d29 Merge "Return correct error when HW there is no biometric hardware" 2018-11-09 04:42:35 +00:00
Svet Ganov
5520368070 Adjust default app op behavior based on feature state
If the CallLog/SMS permission restriction is not enabled we keep
the old default app op state for the relevant ops and if the
feature is enabled we switch to the new default value.

Test: Manual

Change-Id: I93c0e059741f475ebdffce682e1d0d9149b41159
2018-11-08 18:04:49 -08:00
John Reck
8785ceb3b9 Refactors and a potential public API for rendering
Split out the View/ViewRootImpl bits from the
hardware rendering bits.

Create a potential public API surface for
hardware rendering

Bug: 112709971
Test: builds & boots

Change-Id: I9e6f44b07a170574a905f42338282c4bb7e95f56
2018-11-08 15:32:35 -08:00
Philip P. Moltmann
17f65afe3b Split permissions inherit state from their parents
The old hack to grant permissions on upgrade was removed. The new code
applies to
- platfrom upgrade
- initial package installation
- package update

Inheriting the grant state is the default behavior for split permissions.
Special cases will be added later.

Also make sure to revoke the permission once the app declares that it is
aware of the permission.

Test: atest CtsPermissionTestCases:SplitPermissionTest
Change-Id: Ie51971530607f0b585cf7a3e11b01b11a28e1de9
2018-11-08 09:32:01 -08:00
Evan Rosky
38e1cb73f5 Merge changes from topic "wm_move_disp_to_hier_2"
* changes:
  Move some display logic into hierarchy [2/2]
  Move some display logic into hierarchy [1/2]
2018-11-08 01:15:27 +00:00
Alan Stokes
b6c3a604b0 DexLoadReporter needs to handle arbitrary class loaders.
Also made sure we can handle null classpaths.

Test: atest -p services/core/java/com/android/server/pm/dex
Bug: 111336847
Change-Id: Idabf3fb9a09a0764e805679ac29cd8455e8dc267
2018-11-07 12:00:42 +00:00
TreeHugger Robot
661d7b8dba Merge "Support show KeyguardPresentation on all public displays." 2018-11-07 06:26:51 +00:00
Kevin Chyn
e739daf2e8 Return correct error when HW there is no biometric hardware
Devices that have no biometric hardware should still get the
BIOMETRIC_ERROR_HW_NOT_PRESENT error. Currently they get the
BIOMETRIC_ERROR_HW_UNAVAILABLE error which is slightly wrong.

Fixes: 119109074

Test: Builds
Change-Id: I32134a35fd2844bc6a4a64ded9695ae596496ef2
2018-11-06 20:08:42 -08:00
TreeHugger Robot
ea87b1fa7c Merge "Add AppOpsManager.opToDefaultMode() as system API." 2018-11-07 02:43:27 +00:00