Commit Graph

14349 Commits

Author SHA1 Message Date
Beverly Tai
fe0efe6bd2 Merge "Only update zen rule name on locale change" 2018-11-05 18:58:39 +00:00
Lifu Tang
05dfae98d6 Adds wrapper method to convert string ops to ints
Bug: 117677214
Test: compile and flash
Change-Id: I7de3d3829aa99473b415b40bbfe4078d5b5ed3b7
2018-11-03 00:32:38 -07:00
TreeHugger Robot
548107d94f Merge "Add reminder comment for updating CTS test" 2018-11-03 05:03:22 +00:00
Svetoslav Ganov
c7d89b4bc2 Merge "Revert "Adjust default app op behavior based on feature state"" 2018-11-03 05:01:47 +00:00
Svetoslav Ganov
0b9af26dba Revert "Adjust default app op behavior based on feature state"
This reverts commit 7d6dbb2b0b.

This change causes a subtle deadlock. Will upload a correct patch in a bit.

Change-Id: I8cb14000943338fb8c2c9049c2d85a4ce8cf6fcd
2018-11-03 04:50:48 +00:00
Svetoslav Ganov
79eba743ca Merge "Historical app op APIs - initial check in." 2018-11-03 04:49:45 +00:00
Kevin Chyn
a60c07ac58 Add reminder comment for updating CTS test
Bug: 117346645

Test: Builds
Change-Id: I0193e11e57039b1a3e80c99acc491ea19c4ffeed
2018-11-02 19:58:01 -07:00
Beverly
49ba9a6019 Only update zen rule name on locale change
Test: atest ZenModeHelperTest
Change-Id: I9154c812f9955d145fe461b9e17faf9fe9ccf1c9
Fixes: 118789422
2018-11-02 16:53:29 -04:00
Svet Ganov
ad0a49bc42 Historical app op APIs - initial check in.
This change adds new APIs for querying historical app ops
for a time period in the past. Since app ops are performed
quite often in some cases keeping track of every app op is
prohibitively inefficient. Therefore, we are exposing
aggregated counts for past ops.

Test: atest android.permission.cts.AppOpsTest

bug:111061782

Change-Id: I59bbf906d62cd6dcd751f2e8089242dcecd55a6c
2018-11-02 13:00:07 -07:00
David Brazdil
d68ee776be Merge "Remove non-SDK API toast" am: 13c2382d4f am: 6a35521032
am: c62139b488

Change-Id: Ie2a51568cf0630e0634548121b713f1778f1ff84
2018-11-02 06:30:04 -07:00
Beverly Tai
b9bfae6401 Merge "Use consolidated zen policy for dnd" 2018-11-02 13:21:06 +00:00
David Brazdil
c62139b488 Merge "Remove non-SDK API toast" am: 13c2382d4f
am: 6a35521032

Change-Id: Idd0496cf57b2b58a95a0377d969f7a0589f904a7
2018-11-02 06:17:10 -07:00
Kenny Root
8b0a22dbad Merge changes from topic "usb-adb-separation"
* changes:
  Update USB tests for ADB split
  Move AdbDebuggingManager to AdbService
  AdbService: move source of truth for enabled
  Add empty AdbHandler
  Add systemReady call for AdbService
  Add function to query ADB state
  Register USB as an ADB transport type
  Add ADB transport skeleton
  Add empty AdbManagerInternal for system server
  Add empty AdbService to SystemServer
  Move ADB debugging manager to core
  Rename to AdbDebuggingManager
  Move UsbDebuggingManager to new package
2018-11-02 00:43:05 +00:00
Eugene Susla
8394092808 Merge "Revert sms appops to their original defaults" 2018-11-01 22:32:55 +00:00
TreeHugger Robot
eb651edabf Merge "Add controller APIs for RoleManager." 2018-11-01 22:22:45 +00:00
Chris Craik
ce58754645 Merge "Add 'profileable' application manifest tag" 2018-11-01 21:28:58 +00:00
David Brazdil
c2a8de549b Remove non-SDK API toast
It served its purpose but it's time to remove it.

Test: m
Change-Id: Idc36cacae89e74f5ce01bcf51dce24cdedfda40f
2018-11-01 10:05:28 +00:00
Eugene Susla
aaff007b17 Revert sms appops to their original defaults
The appop defaults change is now handled in a better way with ag/5372491

This also reverts the special treatment of MODE_IGNORED in SmsAmmplication
to be compatible with the default value of OP_WRITE_SMS being reverted to

Fixes: 118452447
Test: atest android.telephony.cts.SmsManagerTest
Change-Id: I88b01136aaaf8a243d3a14a873e8a15c02a57673
2018-10-31 19:53:28 +00:00
Kenny Root
f74bfdee01 Add empty AdbService to SystemServer
Create skeleton service to migrate functions from UsbService in later
change.

Bug: 63820489
Test: make
Change-Id: I07672fe87cfae188fe77c173fc49119e182c6b05
2018-10-31 16:11:01 +09:00
Michael Wachenschwanz
6b5d06fe4d Merge changes from topic "UsageSessionTimers"
* changes:
  Add SystemApi for registering Usage Session Observers in UsageStats
  Refactor AppTimeLimitController for Session Observers
2018-10-31 00:35:39 +00:00
Hai Zhang
87ed09ae42 Add controller APIs for RoleManager.
This change adds addRoleHolderFromController() and
removeRoleHolderFromController() to RoleManager. These APIs are
guarded by permission and intended to be called only by the controller
service, which will only modify records inside RoleManager and won't
affect the holder packages.

Bug: 110557011
Test: build
Change-Id: I15c6cde0b8c1c8c519ea521bc7bb6f97c7144ec4
2018-10-30 17:12:09 -07:00
Eugene Susla
f4bebfea9f Merge "Adjust default app op behavior based on feature state" 2018-10-30 22:11:24 +00:00
Chris Craik
ce0302890a Add 'profileable' application manifest tag
Bug: 117841084
Test: atest CtsAtraceHostTestCases:AtraceHostTest

Allow apps to opt-in to important profiling features (systrace, binder
tracing), without requiring debuggable=true. Debuggable has
significant performance overhead, and is undesirable for profiling.

Profileable is set to true when debuggable is true.

Change-Id: I16aaa7bc60dee4b1b262e169ac285759d57d8198
2018-10-30 10:24:31 -07:00
Jon Boekenoogen
adb49c0031 Merge "Fix ClassCastException in 2nd phase resolution." 2018-10-30 17:08:42 +00:00
TreeHugger Robot
64f878e0a9 Merge "Add RoleManager into the system." 2018-10-30 10:03:39 +00:00
Michael Wachenschwanz
641e338f8d Add SystemApi for registering Usage Session Observers in UsageStats
Test: atest cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java#testAppUsageObserver
Test: atest android.app.usage.cts.UsageStatsTest#testObserveUsagePermission
Bug: 111465038
Change-Id: I70a7a5729117f8e9651a2e4ea732156537d2f3c1
2018-10-29 16:21:35 -07:00
Michael Wachenschwanz
0f47284af3 Refactor AppTimeLimitController for Session Observers
Introducing the concept of Usage Session Observers to UsageStats. A
session observer monitors usage within individual "continuous" sessions
(brief gaps of non usage may be allowed in a session and still be
considered continuous)

The new session observer in AppTimeLimitController are both similar and
different enough from the current app usage observer to warrant
refactoring TimeLimitGroup into an OOP friendly abstract base class.

Added some Observer App handling to avoid clash between registered
observers from multiple apps.

Reworded packages to observed and usage entities to accomodate future
changes, where usage may come from more than just app usage.

Reworded moveToForeground/Background to generic usage and allow multiple
usage entities to be active at the same time to accomodate future
changes, where more than just the foreground app can be considered used.

Test: atest FrameworksServicesTests:AppTimeLimitControllerTests
Bug: 111465038
Change-Id: I63aebf8b0aa5516111bd6d5e142525d0bee6ef58
2018-10-29 16:21:24 -07:00
Jon Boekenoogen
2cd92e9768 Fix ClassCastException in 2nd phase resolution.
This has been broken since the original Oreo implementation was added
https://android.googlesource.com/platform/frameworks/base/+/android-8.0.0_r1/core/java/android/app/InstantAppResolverService.java#118

Bug: 118635643
Test: Manual build and run locally.
Change-Id: Ie3f2ca2d0baf4ebcedbf75753cc2cdbcfa4b3e1b
2018-10-29 15:21:31 -07:00
Beverly
ff2df9b81b Use consolidated zen policy for dnd
Instead of using the default notification policy,
use the consolidated zen policy when do not disturb
is in priority only dnd mode

Bug: 111474881
Test: atest ZenModeHelperTest ZenPolicyTest ZenModeFilteringTest AudioManagerTest
Test: atest SystemUITests ZenModeExtractorTest
Change-Id: I88934103a56f06d4a4f620a8f557347331a79627
2018-10-29 13:11:22 -04:00
Rafal Slawik
bf67d07be2 Record process start time for native processes
Process start time is recorded to detect whether two memory samples
come from the same process and how long the process was alive.

Bug: 118249210
Test: atest MemoryStatUtilTest and manually verified that data is in
statsd report

Change-Id: I7f49cd8bfc81c5e7e70e4f8b49729632eeec5798
2018-10-29 14:36:37 +00:00
Svet Ganov
7d6dbb2b0b 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: Ic5f5b95f4152047455ecac06a596eee0f3bdc4ba
2018-10-27 13:56:38 -07:00
Hai Zhang
b777668584 Add RoleManager into the system.
A role is a unique name within the system associated with certain
privileges. There can be multiple applications qualifying for a role,
but only a subset of them can become role holders. To qualify for a
role, an application must meet certain requirements, including
defining certain components in its manifest. Then the application will
need user consent to become the role holder.

Upon becoming a role holder, the application may be granted certain
privileges that are role specific. When an application loses its role,
these privileges will also be revoked.

Bug: 110557011
Test: build
Change-Id: Icd453a3b032857a8fd157048de8b9609f04e28b8
2018-10-27 11:14:32 -07:00
TreeHugger Robot
18b779de66 Merge "Revert "Temporary fix for sms cts regression"" 2018-10-27 03:12:35 +00:00
Wale Ogunwale
24e289ab3a Merge changes I84d43fdb,I726037d5
* changes:
  Removed references to ATMS.getLockTaskController() from AMS (34/n)
  Removed references to ATMS.mHomeProcess and mPreviousProcess from AMS (33/n)
2018-10-26 23:38:49 +00:00
Julia Reynolds
26f79f9c4f Merge "Add APIs for notification app overlays" 2018-10-26 22:51:54 +00:00
Tim Murray
52d86a52d4 ActivityThread: purge jemalloc at appropriate times am: 59f3dc1995
am: 160356568d

Change-Id: Ib7c2216f66d0ddca2303b80ee2eb1245e8d9826b
2018-10-26 15:07:52 -07:00
Tim Murray
160356568d ActivityThread: purge jemalloc at appropriate times
am: 59f3dc1995

Change-Id: Id2cbabd4369a2769d44ac36a13aca0af819ffd98
2018-10-26 14:52:08 -07:00
Tim Murray
59f3dc1995 ActivityThread: purge jemalloc at appropriate times
Don't let jemalloc sit around with unused pages.

Test: boots, works
bug 117795621

Change-Id: I1fc3fcf5aa2798c67ea8cada6eeec852b2bebee7
2018-10-26 21:37:50 +00:00
Wale Ogunwale
27c48ae4d8 Removed references to ATMS.getLockTaskController() from AMS (34/n)
Should only be access from ATMS side.

Bug: 80414790
Test: Existing tests pass
Change-Id: I84d43fdb8654c7f19d39ec660d64b2dabef43b83
2018-10-26 13:13:52 -07:00
Eugene Susla
9a67c29026 Revert "Temporary fix for sms cts regression"
This reverts commit eded0cc3a9.

Reason for revert: b/118412497 

Change-Id: I6bdafb6283a39be3bf678312fc909fba042301fe
2018-10-26 17:33:59 +00:00
Jeff Sharkey
bc2ae00878 Magic to keep "_data" paths working.
As part of the storage changes in Q, we're removing the ability for
apps to directly access storage devices like /sdcard/.  (Instead,
they'll need to go through ContentResolver.openFileDescriptor() to
gain access.)  However, in several places we're returning raw
filesystem paths in the "_data" column.  An initial attempt to simply
redact these with "/dev/null" shows that many popular apps are
depending on these paths, and become non-functional.

So we need to somehow return "_data" paths that apps can manually
open.  We explored tricks like /proc/self/fd/ and FUSE, but neither
of those are feasible.  Instead, we've created a cursor that returns
paths of this form:

/mnt/content/media/audio/12

And we then hook Libcore.os to intercept open() syscalls made by
Java code and redirect these to CR.openFileDescriptor() with Uris
like this:

content://media/audio/12

This appears to be enough to keep most popular apps working!  Note
that it doesn't support apps that try opening the returned paths
from native code, which we'll hopefully be solving via direct
developer outreach.

Since this feature is a bit risky, it's guarded with a feature flag
that's disabled by default; a future CL will actually enable it,
offering a simple CL to revert in the case of trouble.

Bug: 111268862, 111960973
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ied15e62b46852aef73725f63d7648da390c4e03e
2018-10-26 09:32:29 -06:00
Julia Reynolds
b6bd93d960 Add APIs for notification app overlays
- Can be enabled/disabled at channel and channel group levels
- An activity to launch can be added to notification

Test: atest, cts
Bug: 111236845
Change-Id: I9a4832211676cca4649d1f28e6e3e3157954d268
2018-10-25 14:17:02 -04:00
Makoto Onuki
25c782f9f2 Merge "DB Wipe detection" 2018-10-25 17:40:43 +00:00
Nathan Harold
41e2d7494f Merge "Move some members to the "Q blacklist"." am: f5cf9f24ed
am: 13c9e7e2f3

Change-Id: Ia2419cce28d26d9464da2a5172cb332b629e943e
2018-10-24 16:14:06 -07:00
Eugene Susla
c63d1cc434 Merge "Temporary fix for sms cts regression" 2018-10-24 17:06:29 +00:00
Makoto Onuki
ee93ad28ff DB Wipe detection
- Create a check file for each database in order to detect
1) an unexpected DB file removal
2) DB wipe caused by a DB corruption.

- Either case, do a WTF to collect information on APR.

- Also print file timestamps in "dumpsys dbinfo". Example:

=====================
Database files in /data/system:
  locksettings.db                            20480b ctime=2018-10-23T22:48:35Z mtime=2018-10-23T22:48:35Z atime=2018-10-23T18:54:12Z
  locksettings.db-wipecheck                      0b ctime=2018-10-23T18:54:12Z mtime=2018-10-23T18:54:12Z atime=2018-10-23T18:54:12Z
  notification_log.db                        45056b ctime=2018-10-23T22:48:08Z mtime=2018-10-23T22:48:08Z atime=2018-10-23T18:54:13Z
    :
=====================

Change-Id: I77fbeb0bb635c787aba797412f116475fecbe41c
Fixes: 117886381
Test: manual test

Test 1: corruption
1. Stop CP2 process (adb shell killall android.process.acore)
2. shell 'echo abc > /data/user/0/com.android.providers.contacts/databases/contacts2.db'
3. Launch the contacts app.

Test 2: Unexpected file removal
1. Stop CP2 process (adb shell killall android.process.acore)
2. shell 'rm -f /data/user/0/com.android.providers.contacts/databases/contacts2.db'
3. Launch the contacts app.

In both cases, logcat shows a client side stacktrace and also a WTF. (am_wtf)
2018-10-24 08:34:04 -07:00
Nathan Harold
f5cf9f24ed Merge "Move some members to the "Q blacklist"." 2018-10-23 21:53:51 +00:00
Weien Wang
0b8b0ef691 Merge "Add new WallpaperInfo attr settingsSliceUri." 2018-10-23 03:02:21 +00:00
Eugene Susla
eded0cc3a9 Temporary fix for sms cts regression
This partially reverts the change that is suspected to be the cause of
b/117885969

This is to be reverted once the real cause is established.
Posting a temporary fix to unbreak the CTS test while figuring it out.

Fixes: 117885969
Test: atest CtsProviderTestCases:android.provider.cts.SmsBackupRestoreTest#testSmsBackupRestore
Change-Id: I7fd0b954d334501b050e9930643de4f6e41e229e
2018-10-22 18:48:46 -07:00
Mathew Inwood
45d2c252b1 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 8c854f86a4)
2018-10-22 17:28:24 -07:00