Commit Graph

92964 Commits

Author SHA1 Message Date
Olivier Gaillard
f82d2e7369 Tracks exception count by class name.
The goal is to figure out if it would be worth monitoring these
exceptions. If exception types are only caller issues like
SecurityException and IllegalArgumentException, it is probably not worth
it. If we can find NPE or internal exceptions it would be worth
uploading the exceptions through dropbox.

Test: unit test

Change-Id: I779d43a0e6ca1a33535b90809491675420a51726
2018-07-03 22:22:42 +01:00
Wale Ogunwale
20a65c4e7b Merge "Break direct calls to UserController object in AMS from activity classes (12/n)" 2018-07-03 20:50:18 +00:00
TreeHugger Robot
080faba4f4 Merge "Stop restoring spell checker settings" 2018-07-03 20:34:32 +00:00
Neil Fuller
bfef432a69 Merge "Make Half class use public APIs" am: 7e957e57b7 am: 04c66489bc
am: 8b14d33acb

Change-Id: I6eb87843c251f726de2feb6827c54c8f7b75f1fe
2018-07-03 13:27:01 -07:00
Neil Fuller
8b14d33acb Merge "Make Half class use public APIs" am: 7e957e57b7
am: 04c66489bc

Change-Id: I35fa0a22465885a47612601d541afb366b5953ec
2018-07-03 13:17:31 -07:00
Neil Fuller
04c66489bc Merge "Make Half class use public APIs"
am: 7e957e57b7

Change-Id: I7f41f07ed5d35a0c538c90b49b4500ba9952f74d
2018-07-03 13:08:26 -07:00
TreeHugger Robot
9445ca3ab9 Merge "Bugreport: Fix SystemUI service from being dumped twice 1/2" 2018-07-03 17:42:25 +00:00
Wale Ogunwale
86b7446c2b Break direct calls to UserController object in AMS from activity classes (12/n)
Make calls from activity classes go through ActivityManagerInternal
interface to case UserController instead of calling AMS.mUserController
object directly. Note that calls to UserController should not hold the
AMS lock.

Bug: 80414790
Test: Existing tests pass
Change-Id: Ie56f08d10b62d609e9b5e31f45b5f0d6eed3a9d4
2018-07-03 08:22:59 -07:00
TreeHugger Robot
e026b408b5 Merge "Track max CPU and latency of binder calls" 2018-07-03 11:11:27 +00:00
TreeHugger Robot
95e4e67dc6 Merge "Docs: generateKeyPair() can't be called from the main thread." 2018-07-03 08:32:23 +00:00
TreeHugger Robot
9e01f4293c Merge "Add Feature Flag for Hearing Aid Profile" 2018-07-03 01:18:15 +00:00
TreeHugger Robot
b5ec0b8053 Merge "Add SHOW_SOURCE_PUSH_TO_TALK to indicate that the interaction service was invoked by a hardware button." 2018-07-02 23:42:54 +00:00
Jorim Jaggi
1f079b4f97 Merge "Only use simple rects for cutout region" into pi-dev am: 4764921dcc
am: b7dc212a61

Change-Id: I2af32c72ea859ff908fa30b5de1e722a99b28479
2018-07-02 14:58:32 -07:00
Jorim Jaggi
b7dc212a61 Merge "Only use simple rects for cutout region" into pi-dev
am: 4764921dcc

Change-Id: Icfb41008189d5c01f90afd4992428433043b4c4e
2018-07-02 14:47:09 -07:00
Vishnu Nair
c69cd4480e Bugreport: Fix SystemUI service from being dumped twice 1/2
Bug: 110490179
Fix: 110490179

Test: Manual test dumpsys activity
  adb shell dumpsys activity service all-platform-non-critical
  adb shell dumpsys activity service all-platform
  adb shell dumpsys activity service
  Take bugreport and check contents

Test: atest FrameworksCoreTests:DumpUtilsTest

Change-Id: I9173d3fa0cc3aaf42e3ab03e7e2892cf4188b13b
2018-07-02 14:29:31 -07:00
Winson Chung
8f54a7c515 Merge changes Ibae2de51,I1d6718d9
* changes:
  Allow share/edit screenshot actions from lockscreen
  Prevent clobbering of activity options bundle when merging
2018-07-02 21:04:39 +00:00
TreeHugger Robot
ca48d74547 Merge "Make getDimension's Javadoc say it returns px." 2018-07-02 20:29:29 +00:00
TreeHugger Robot
f574d538c1 Merge "Add a package declaration to RulesState" 2018-07-02 19:28:22 +00:00
Yohei Yukawa
1893bd162a Stop restoring spell checker settings
This CL logically reverts the following CL (and some subsequent
changes) to stop restoring spell checker related secure settings.

 * Ib8382f0296f0726b64494d3b1fd8237e13adb540
   06cbaddb87

Reason for revert:
Although we believe it would be great if we can seamlessly migrate to
a new phone with keeping spell checker related settings, there still
remain several tricky scenarios.

 * We are not ready to distinguish whether a certain spell checker
   related setting was explicitly set by the user or programmatically
   set by some components in the previoud device.  This includes the
   case where TextServicesManagerService (TSMS) itself automatically
   updates those settings e.g. by selecting a default spell checker
   service from the pre-installed ones.  We are not sure if trying to
   migrate such an auto-selected setting to a new device actually
   makes sense, especially if it happens without any user
   confirmation.

 * We have a strict rule about what spell checker service can be
   selected automatically, and the rule has been that only
   pre-installed spell checker services can be automatically selected
   by the system, unless some system components that have
   WRITE_SECURE_SETTINGS permission overrides it. Mechanically
   selecting a spell checker service just because it was enabled in
   the previous device may not fit this model well.

 * Unlike IMEs, currently the Android OS allows only one spell checker
   service to be enabled.  This means that if the new device doesn't
   have the corresponding spell checker service, the user will lose
   spell checking functionality even if the device pre-installs
   functional spell checker service.  This problem is hard to notice
   because unlike IMEs spell checker service does not have its own UI.

 * Also unlike IMEs, spell checker related secure settings are still
   hidden and not published as public APIs.  Those settings do not
   have no official compatibility story across devices yet.

 * It is also possible that the default spell checker service in the
   previous device is not published to all the devices thus there is
   no way for the the new device to install it.

This CL therefore excludes spell checker related settings from
backup/restore, as a short-term answer to above scenarios until we
come up with better ideas to deal nicely with them.

Bug: 110367605
Test: atest FrameworksCoreTests:android.provider.SettingsBackupTest
Test: atest FrameworksCoreTests:android.provider.SettingsValidatorsTest
Change-Id: I8e4a0d4b3b758a84d5a075fa52851b1e8dd707eb
2018-07-02 11:31:42 -07:00
TreeHugger Robot
c0b67c9385 Merge "Add more data (fg services, associations) to procstats." 2018-07-02 17:30:22 +00:00
TreeHugger Robot
1a81a7457b Merge "Allow 0sp text size in xml for TextView" 2018-07-02 17:02:20 +00:00
Jorim Jaggi
606405180f Only use simple rects for cutout region
Otherwise there is a big performance hit in all kinds of
situations where we do operations with the region, specifically
when:

- updating input windows
- insetting the cutout during layout
- touch dispatch

Test: DisplayCutoutTest, WmDisplayCutoutTest
Bug: 110464019
Bug: 110452325
Change-Id: I94a25c3794ecd33b8b7204ca308ac91623498f13
2018-07-02 17:58:10 +02:00
Olivier Gaillard
11965ede90 Track max CPU and latency of binder calls
Test: unit tested

Change-Id: I1429e8c34e9cb0572975fda3ec18e85d6caf3cad
2018-07-02 15:50:57 +01:00
TreeHugger Robot
19bbcfff1e Merge "Only play in-call notification if ringer is normal" 2018-07-02 14:31:31 +00:00
Mihai Popa
f03b7543c7 Allow 0sp text size in xml for TextView
Before this CL, when TextView's textSize attribute was set to 0sp in
XML, the text would still be visible on the screen, as the actual
textSize set was non zero. On the other hand, if the text size was set
to 0sp programmatically, the text would not be visible. This was a P
regression, as on O the text would be invisible in both cases.

This CL fixes the attribute reading stage in TextView, allowing the
application of a 0 text size on the view.

Bug: 110251171
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I3798361e182f45a67cd0a69d40e09e559375aa20
2018-07-02 12:58:22 +00:00
Neil Fuller
f9d88dfac1 Make Half class use public APIs
Half has a dependency on an internal sun.misc.FloatingDecimal
that can be replaced by an equivalent call on java.lang.Float
(which calls through to FloatingDecimal).

Any performance hit is worth it for a smaller API surface.

Bug: 111055375
Test: Build
Change-Id: Iecdf3aa9414922a77edbdc439b0c2b88033b3af8
2018-07-02 12:04:39 +01:00
TreeHugger Robot
ce77407144 Merge "StrictMode to catch storage while locked." 2018-06-30 22:04:26 +00:00
Jeff Sharkey
41cebf51c5 Merge "Get android.os tests running against real APIs." 2018-06-30 21:02:54 +00:00
TreeHugger Robot
c984df9763 Merge "Fix a NPE in BatteryStatsImpl" 2018-06-30 01:50:19 +00:00
Kevin Chyn
082c201438 Merge "FaceManager removal callback should propagate remaining" 2018-06-30 00:56:32 +00:00
TreeHugger Robot
716b07cf9b Merge "Fix the memory leak in BatteryStatsImpl.Timebase.mObservers." 2018-06-30 00:54:26 +00:00
Winson Chung
3743d28ec9 Prevent clobbering of activity options bundle when merging
- RemoteViews specify an ActivityOptions when calling startIntentSender()
  (for click handling), but if the PendingIntent being started also has an
  ActivityOptions, the merging of the two options will fail since the
  ActivityOptions properties are always written into the bundle (regardless
  of whether they are actually set).  Instead, only write non-default
  values to the bundle (the defaults will be read out if not set when
  restoring the options from the bundle anyways).

Bug: 72459081
Test: atest FrameworksServicesTests:ActivityOptionsTest

change-id: i1d6718d9db4b3f7056412c5b4c5347a19ffa7c09
2018-06-29 17:36:16 -07:00
TreeHugger Robot
cee49cd54d Merge "Make scroll bars more noticeable on round screens." 2018-06-30 00:26:35 +00:00
TreeHugger Robot
e26fae649b Merge "Moved more stuff from ActivityManagerService to ActivityTaskManagerService (11/n)" 2018-06-30 00:21:40 +00:00
Mike Ma
31cdfb401d Fix a NPE in BatteryStatsImpl
ServiceManager.getService("batteryproperties")) may return null for some
devices right after boot. (We don't know why, need further investigation)
This causes async batterystats update to crash, leaving BatteryStats in a
bad state (OnBattery() == true, but mOnBatteryTimeBase is not running),
which does not accept aggregated stats update anymore.

Bug: 109930230
Test: manual
Change-Id: I0654beff95f0a2b9df2567f1a2efffd3330e58ff
2018-06-29 16:55:17 -07:00
Wale Ogunwale
f673393b93 Moved more stuff from ActivityManagerService to ActivityTaskManagerService (11/n)
Moved more stuff related to activities out of the current service to the new one.

Bug: 80414790
Fixes: 110988007
Test: Existing tests pass.
Change-Id: Iceed1da8a7441a26d11efebc6d9f692fd053bc7f
2018-06-29 23:51:01 +00:00
Danny Epstein
4ffbd471b4 Make getDimension's Javadoc say it returns px.
Bug: 24467193
Test: Only changed Javadoc.
Change-Id: I209d8ddbe025ec2c35668ddaac2bdba79305ec6a
2018-06-29 16:24:29 -07:00
Jeff Sharkey
c609116a1b Get android.os tests running against real APIs.
Combination of moving to existing public API, tagging things as
@TestApi, and bringing utility methods into tests.

Bug: 13282254
Test: atest cts/tests/tests/os/
Change-Id: Ifd24c0d048d200e8595e194890cc1dc53ddc2b3e
2018-06-29 17:15:44 -06:00
Beverly
28c3d164d9 Only play in-call notification if ringer is normal
- Add secure setting to enable/disable in call notifications
- Can toggle system setting using the following adb command:
adb shell settings put secure in_call_notification_enabled [0/1]

Bug: 71586014
Test: manual
Change-Id: I32e1d1d6dcae806e655ae6875a43d07ca83e77f4
2018-06-29 16:52:14 -04:00
Kevin Chyn
7e88d113d6 FaceManager removal callback should propagate remaining
Fixes: 110994796

Test: builds
Change-Id: I9a82a50a8bbd4b0c21a2acef33c9ec3fdff5c7f8
2018-06-29 12:57:01 -07:00
shepshapard
5229200dd3 Fix invisible scroll thumb blocks clicks.
The current issue is that Views that have either the horizontal or
vertical scroll bars enabled will intercept mouse interactions that
entire the region where the scrolling thumb would be even if the View
cannot actually scroll because it's content isn't larger than it.

This is fixed by only intercepting mouse interactions in the scroll
thumb region if there is something to scroll.

Bug: 110375792
Test: None yet

Change-Id: Ib638b4ac88375f55bc80ba2a66d945a16ecd6d22
2018-06-29 10:57:18 -07:00
Jeff Sharkey
dd02e33417 StrictMode to catch storage while locked.
When an app starts becoming Direct Boot aware, it can be difficult
to track down all the places they're reading data from credential
protected storage.

When a user is locked, credential protected storage is unavailable,
and files stored in these locations appear to not exist, which can
result in subtle app bugs if they assume default behaviors or
empty states. Instead, apps should store data needed while a user
is locked under device protected storage areas.

Bug: 110413274
Test: atest cts/tests/tests/os/src/android/os/cts/StrictModeTest.java
Change-Id: Ia390318efa6fefda8f10ac684d0206e67aa1d3dc
2018-06-29 11:41:00 -06:00
Danny Epstein
b8cbf3aa5b Make scroll bars more noticeable on round screens.
Increase alpha from 15 to 30% for the track and use Google Material
Grey 200 for the thumb. Fix the geometry so that the track and thumb
don't extend off the edge of the screen.

Bug: 80258942
Change-Id: I43e603e5fffb8a05f486af35194c801060dd0b51
(cherry picked from commit 97b00cbc039a090659aed75e47a172a70222b02f)
2018-06-29 16:40:08 +00:00
Dianne Hackborn
2aec55a658 Add more data (fg services, associations) to procstats.
- Keep track of foreground services.
- Keep track of associations between processes.

The big part of this is the second, tracking associations.
We have have procstats keeping continual track of associations
between processes, much like the "am track-associations"
command.  Currently the data kept on them is very minimal
(just the count and total duration, not separated by other
states) due to the potential number of them that there can be,
but we can look in to trying to maintain more data going
forward if it is feasible.

The way this is incorporated into the activity manager makes
it a little different than "am track-associations," with
potentially some new interesting data available.  These
associations are tied with the connection objects in the
activity manager, so they only count while the target
process is actually running (so their duration should match
with the lifecycle of the target).  They are tied to the
target package, since that is what we know all of the
information we need for rooting data in procstats (package
name, uid, and version code of that package); only the process
name and uid are available for the source of the association

Since these are tied to the connection components, it is
possible that we could even maintain data on the duration per
proc state that is flowing from that association in to the
target process.  That would be very useful, but would add
a fair amount more overhead in data being tracked.

English output of the new association data looks like:

  * com.android.providers.downloads / u0a17 / v28:
      * Prc android.process.media / u0a17 / v28:
               TOTAL: 0.45%
              Imp Bg: 0.26%
             Service: 0.18%
            Receiver: 0.01%
          (Last Act): 0.78%
            (Cached): 37% (5.2MB-5.8MB-8.2MB/3.9MB-4.4MB-6.0MB/3.9MB-7.0MB-50MB over 18)
      * Svc com.android.providers.downloads.DownloadIdleService:
        Process: android.process.media
            Running count 3 / time 0.01%
            Bound count 3 / time 0.01%
            Executing count 6 / time 0.00%
      * Svc com.android.providers.downloads.DownloadJobService:
        Process: android.process.media
            Running count 6 / time 0.21%
            Bound count 6 / time 0.21%
            Executing count 12 / time 0.00%
      * Asc com.android.providers.downloads.DownloadIdleService:
        Process: android.process.media
          <- system / 1000:
             Count 3 / time 0.01%
      * Asc com.android.providers.downloads.DownloadStorageProvider:
        Process: android.process.media
          <- com.android.documentsui / u0a10:
             Count 1 / time 0.00%
      * Asc com.android.providers.downloads.DownloadProvider:
        Process: android.process.media
          <- com.android.vending / u0a11:
             Count 39 / time 2.6%
          <- system / 1000:
             Count 3 / time 0.00%
          <- com.google.android.gms / u0a36:
             Count 8 / time 0.01%
      * Asc com.android.providers.downloads.DownloadJobService:
        Process: android.process.media
          <- system / 1000:
             Count 6 / time 0.21%

And the corresponding checkin:

pkgproc,com.android.providers.downloads,10017,28,android.process.media,0nf:717,0nb:71332,0ns:48335,0nr:3652,0nl:218034,0ne:10103500,0mf:21,0ms:614,0me:185,1ne:100236
pkgpss,com.android.providers.downloads,10017,28,android.process.media,0ne:18:5310:5950:8434:4036:4522:6140:4036:7127:51056
pkgsvc-run,com.android.providers.downloads,10017,28,.DownloadIdleService,3,0n:1849
pkgsvc-bound,com.android.providers.downloads,10017,28,.DownloadIdleService,3,0n:1794
pkgsvc-exec,com.android.providers.downloads,10017,28,.DownloadIdleService,6,0n:89
pkgsvc-run,com.android.providers.downloads,10017,28,.DownloadJobService,6,0n:58224
pkgsvc-bound,com.android.providers.downloads,10017,28,.DownloadJobService,6,0n:58154
pkgsvc-exec,com.android.providers.downloads,10017,28,.DownloadJobService,12,0n:187
pkgasc,com.android.providers.downloads,10017,28,.DownloadIdleService,system,1000,3,1790
pkgasc,com.android.providers.downloads,10017,28,.DownloadStorageProvider,com.android.documentsui,10010,1,80
pkgasc,com.android.providers.downloads,10017,28,.DownloadProvider,com.android.vending,10011,39,1067022
pkgasc,com.android.providers.downloads,10017,28,.DownloadProvider,system,1000,3,96
pkgasc,com.android.providers.downloads,10017,28,.DownloadProvider,com.google.android.gms,10036,8,1951
pkgasc,com.android.providers.downloads,10017,28,.DownloadJobService,system,1000,6,58149

Bug: 110957691
Test: manual
Change-Id: Id466b085303527e7bf7354f7f33a0fbaa768fb7b
2018-06-29 09:36:19 -07:00
TreeHugger Robot
af57538369 Merge "Clarify WebView's lack of plugin support." 2018-06-29 16:04:31 +00:00
Benjamin Miller
2a8f129c2a Docs: generateKeyPair() can't be called from the main thread.
Bug: 110194933
Test: make ds-docs with visual inspection of generated HTML
Change-Id: I5f7839cbf57d9150ad4c9a9c4ac943064fb1f6c0
2018-06-29 08:07:47 +00:00
Bernardo Rufino
62863825e0 Fix file matching w/ full-backup rules xml
Documentation is pretty vague:
https://developer.android.com/guide/topics/data/autobackup#XMLSyntax.

But there were a couple of issues:
* It was prematurely returning false without consuming the rest of the
  includes (cause of the bug linked).
* It was using string comparison for checking if a file is in a
  directory, which ended up flagging directories such as "a/b" as
  containing files "a/b.txt".

Reviewers,

* Please, pay full attention to test cases.
* Since this is code move + code change, set diff as 2..latest to check
changes to the function.

Bug: 110720194
Test: atest BackupUtilsTest
Test: Backup and restore app w/ multiple directory includes, verify
      everything restored

Change-Id: Ic0fea43156ce8fb641af69ae73679289a20c291c
2018-06-29 07:18:26 +00:00
Riddle Hsu
9a936e9677 Merge "Check for valid surface when starting to drag" 2018-06-29 03:57:40 +00:00
Winson Chung
1241652d8a Merge "Ensure PiP test apis are marked as TestApi" 2018-06-29 03:13:25 +00:00
Torne (Richard Coles)
1676c95ddc Clarify WebView's lack of plugin support.
Update docs to clarify that plugins are in fact not supported from K
onward and that enabling them doesn't do anything.

Test: m offline-sdk-docs
Change-Id: I8678ea716be0adc4cd3a6fae1b4776e312ec29e0
2018-06-28 19:34:17 -04:00