Commit Graph

4368 Commits

Author SHA1 Message Date
Ahmed ElArabawy
71f7e647ed Merge "Wifi: Fix Wifi Multicast Wakelock Statistics" 2018-08-23 19:58:51 +00:00
arangelov
3830374a9a No disclaimer when switching profile for system SMS and dialer apps (2).
This CL improves on a previous one by preventing the Toast message from
showing when from a browser a user clicks a "tel:", "sms:", "smsto:",
"mms:" or "mmsto:" link. This is done by checking whether the intent
action is ACTION_VIEW and the intent category is CATEGORY_BROWSABLE
with intent data having one of the schemas. Also added
ACTION_CALL_PRIVILEGED and ACTION_CALL_EMERGENCY as they also open
the dialer.

Bug: 111228250
Test: atest FrameworksCoreTests:IntentForwarderActivityTest
Change-Id: I2e0c256aa170c868bf5528a06951cd75783e5d3c
2018-08-23 16:15:34 +00:00
Ahmed ElArabawy
6f1754eafe Wifi: Fix Wifi Multicast Wakelock Statistics
In current implementation, when the same UID holds multiple WiFi
wakelocks, the timer for the lock acquisition in batterystats is started
with the first wakelock acquire and stops with first release.
So the nesting of wakelocks of the same Uid is not correctly accounted for.
(so if Lock#1 acquired at T1, Lock# 2 acquired at T2, Lock#2 released at T3,
lock #1 released at T4 , the timer will only consider the interval T3 - T1 which
is not the correct value).

This commit fixes this issue by starting the timer on the first
acquisition, and stopping it on the last release

Bug: 70691435
Test: Unit Test
Test: $ atest BatteryStatsImplTest

Change-Id: Ie955b6ab0eb1e9837fdda2b8d81835038b8d71da
2018-08-22 08:46:19 -07:00
Adrian Roos
031546664b Merge "Cutout: Add developer setting to mask the display cutout" into pi-dev am: c05c2d1e48
am: 6a403d8d5b

Change-Id: Ifc872c48e4670183f1f0fd3a4162d1eeb6c5c5e4
2018-08-21 13:38:33 -07:00
Adrian Roos
6a403d8d5b Merge "Cutout: Add developer setting to mask the display cutout" into pi-dev
am: c05c2d1e48

Change-Id: I728ce64b53d02f5a75f04071a04f5e6d0f61987c
2018-08-21 13:11:53 -07:00
Adrian Roos
8c28c7c2d9 Cutout: Add developer setting to mask the display cutout
Adds an option to mask the cutout by effectively shrinking the logical display
such that developers can test apps as if the device did not have a notch.

Bug: 112876936
Test: Go to Settings > Developer Options > Simulate display with cutout > "No cutout". Cutout should be hidden. Rotate screen, take screenshots, screenrecord, screen off animation should all work as expected.
Change-Id: I5cdb201734d238bf3785ab55843114e4b5b4ee41
2018-08-21 21:47:51 +02:00
CY Cheng
217e5f01ca resolve merge conflicts of e58c780571 to stage-aosp-master
am: 0f7856add6

Change-Id: I7b763616c1244d3f834e33c3d6e7126c0baa1b59
2018-08-16 16:41:38 -07:00
CY Cheng
0f7856add6 resolve merge conflicts of e58c780571 to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I6d2feec990c23fb3536fc6b3e19c0b2696b81441
Merged-In: I9c920e31433c0ac23165f917d8dd2befaaa4938d
Merged-In: I8e6bb72ce7b8cecdb6bd01150b53f61f1515dbb1
Merged-In: Ic08cabc63daebc4001c8eda751857d11cb0e6352
2018-08-16 10:43:49 +00:00
TreeHugger Robot
0253c3f48a Merge "Protect a11y cache against loops in node hierarchy" 2018-08-15 16:32:20 +00:00
Phil Weaver
f1eb10b3f4 Protect a11y cache against loops in node hierarchy
Plugging a hole where we would recycle a node that is its
own ancestor twice if it was a descendant of the last
child we iterated over.

Bug: 112549653
Test: Adding new test case that reproduced the issue before
and now passes.

Change-Id: I6afc83655d4d7ca1c01f21703c8f9f9ac23e4ac6
2018-08-15 03:13:51 +00:00
Seigo Nonaka
eaa917e694 Rewrite system fallback construction with new FontFamily
Bug: 111133573
Bug: 112196940
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest
    CtsGraphicsTestCases:android.graphics.fonts

Change-Id: I69e21940eaec4427f62abe59ae003b4f60855f22
2018-08-14 11:17:12 -07:00
Wesley.CW Wang
74b9579088 Add emergency dialer option on power menu
Add a button on power menu to launch emergency dialer.
Add FASTER_EMERGENCY_PHONE_CALL_ENABLED to SettingsBackupTest blacklist.

Test: Manually
Bug: 80376488
Change-Id: If359662a4d60dbe0ded89c3afe35db91dca4c445
Merged-In: I9c920e31433c0ac23165f917d8dd2befaaa4938d
2018-08-13 11:58:23 +08:00
Josh Gao
ff39377b5c Merge "MemoryIntArray: track the owned file descriptor in a PFD." am: dccbfca194 am: 873c70a8fd am: 1fb65f1798
am: 461fb59073

Change-Id: Ie5c01958466b3ba1612defd0e0a8b7ec79098d1c
2018-08-10 17:19:22 -07:00
Josh Gao
461fb59073 Merge "MemoryIntArray: track the owned file descriptor in a PFD." am: dccbfca194 am: 873c70a8fd
am: 1fb65f1798

Change-Id: I4c4e372f3122cd41b8b6831abf8e215e972dd893
2018-08-10 16:12:41 -07:00
Josh Gao
1fb65f1798 Merge "MemoryIntArray: track the owned file descriptor in a PFD." am: dccbfca194
am: 873c70a8fd

Change-Id: I2562db3d476face06215e22ecc476c60827ebdd1
2018-08-10 15:46:35 -07:00
Michal Karpinski
6166874b93 Merge "DO NOT MERGE Log various information about non-foreground activity starts" into pi-dev
am: dfba41947b

Change-Id: I18f630182b169c5ef48f8f084884894813c34f0f
2018-08-10 01:51:41 -07:00
Josh Gao
c81f53f7f1 MemoryIntArray: track the owned file descriptor in a PFD.
AUPT is triggering an fdsan diagnostic when creating a temporary
ParcelFileDescriptor to write to a Parcel. This code seems correct at
first glance, so under the assumption that some other code is closing
the file descriptor out from under us, keep our owned file descriptor
around as a ParcelFileDescriptor to catch the perpetrator in the act.

Bug: http://b/112405224
Test: atest MemoryIntArrayTest
      (testAshmemSizeMatchesMemoryIntArraySize failed/crashed before, fails now)
Change-Id: Ie8ff7562c78ecde4cf1757d572ecb733213cc975
2018-08-09 16:32:42 -07:00
Jeff Sharkey
a5d0bf1701 RedactingCursor that redacts specific columns.
For new storage changes in Q, we need to redact the visibility of
the "_data" column on any returned cursors.  We could cook this up
using SQLiteQueryBuilder projection re-mappings, but that's a pretty
involved change due to the number of tables and teasing apart
public-vs-hidden API columns.

Instead, this RedactingCursor class offers to "redact" requested
columns by replacing with specific values, such as "/dev/null".

Test: atest frameworks/base/core/tests/coretests/src/android/database/RedactingCursorTest.java
Bug: 111960973
Change-Id: Iad36986fc0b7a0cae10ff216755e284320991e18
2018-08-09 11:50:24 -06:00
Michal Karpinski
3eab951217 DO NOT MERGE Log various information about non-foreground activity starts
Logging activity starts to TRON, but only if the caller app
doesn't have any foreground activity present.

Example event:
08-03 15:21:30.813  1231  3220 I sysui_multi_action: [757,1513,758,4,805,1533306090812,1514,10147,1515,com.google.android.talk,1516,1018,1517,0,1518,1000,1519,1000,1520,0,1521,10147,1522,com.google.android.talk,1523,1018,1524,0,1525,pendingintent:u0a12:com.google.android.talk/com.google.android.apps.hangouts.phone.ConversationActivity,1526,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1527,1,1528,com.google.android.apps.hangouts.phone.conversationlist,1540,1,1541,com.google.android.apps.hangouts.phone.BabelHomeActivity,1542,3146240,1543,{com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity},1544,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1545,com.google.android.talk,1546,1,1547,0,1551,0,1552,0]

(cherry-picked from 201bc0c14e)

Bug: b/111866309
Context: go/activity-starts-logging-tron
Test: 1) enable logging with: adb shell settings put global activity_starts_logging_enabled 1
      2) open some activities and observe: adb logcat -b events | grep "sysui_multi_action: \[757,1513"
Test: atest FrameworksServicesTests:ActivityStarterTests

Change-Id: Ie7dee51c574e544d12e83d279afda46b336f2013
2018-08-09 15:18:07 +01:00
Michal Karpinski
201bc0c14e Log various information about non-foreground activity starts
Logging activity starts to TRON, but only if the caller app
doesn't have any foreground activity present.

Example event:
08-03 15:21:30.813  1231  3220 I sysui_multi_action: [757,1513,758,4,805,1533306090812,1514,10147,1515,com.google.android.talk,1516,1018,1517,0,1518,1000,1519,1000,1520,0,1521,10147,1522,com.google.android.talk,1523,1018,1524,0,1525,pendingintent:u0a12:com.google.android.talk/com.google.android.apps.hangouts.phone.ConversationActivity,1526,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1527,1,1528,com.google.android.apps.hangouts.phone.conversationlist,1540,1,1541,com.google.android.apps.hangouts.phone.BabelHomeActivity,1542,3146240,1543,{com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity},1544,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1545,com.google.android.talk,1546,1,1547,0,1551,0,1552,0]

Bug: b/111866309
Context: go/activity-starts-logging-tron
Test: 1) enable logging with: adb shell settings put global activity_starts_logging_enabled 1
      2) open some activities and observe: adb logcat -b events | grep "sysui_multi_action: \[757,1513"
Test: atest FrameworksServicesTests:ActivityStarterTests
Change-Id: Id63806a2d08a50f404268194a05c6e94bd7e9724
2018-08-08 14:55:05 +01:00
TreeHugger Robot
17e78cef39 Merge "Improve binder calls stats sampling." 2018-08-06 22:53:16 +00:00
Olivier Gaillard
0d5f50428b Merge "Remove unused imports" 2018-08-06 20:10:48 +00:00
arangelov
8eedb5ad40 Merge "No disclaimer when switching profile for system SMS and dialer apps." into pi-dev am: a7a496f3a1
am: 487ca863a0

Change-Id: I7d5a8a2e2784adc31ae0f366cf81650819228007
2018-08-06 11:00:57 -07:00
arangelov
487ca863a0 Merge "No disclaimer when switching profile for system SMS and dialer apps." into pi-dev
am: a7a496f3a1

Change-Id: I7a14ee395b21c8b6d9c81dc6d13497110bc336b4
2018-08-06 10:44:32 -07:00
Olivier Gaillard
34ad8af018 Improve binder calls stats sampling.
- Decouple detailed tracking and sampling. Detailed tracking now control
which data wwe should track (e.g. exception, max reply size, ...),
sampling controls the % of requests to track
- Do not create a CallStat object just for the sake of tracking the call
count. Most of the keys have a really low call count (60% of keys below
10 call counts, 90% below 100 calls). When data sampling is enabled, we
can save lots of memory.

Test: unit test
Change-Id: If81b38023a76a8b1e07e655f9ecd8a098d401df4
2018-08-06 16:49:26 +01:00
Olivier Gaillard
94e6fe61c7 Remove unused imports
Test: unit test
Change-Id: I01c4d0001fa76cb79f1c40ce40d9a55e3bd5623a
2018-08-06 16:49:25 +01:00
Aurimas Liutikas
3f26befd10 Add a basic ResourcePerfTest.
Moving ResourcesBenchmark.java to the proper android.perftests infrastructure.

Test: ran the benchmark locally.
Change-Id: Ia981274e1e3c167a2a8900498fc40b7a03508a74
2018-08-03 14:37:27 -07:00
arangelov
64439c1e8c No disclaimer when switching profile for system SMS and dialer apps.
This CL prevents the Toast message from showing when the following
conditions are met:
1. App is system app
2. Intent action is either ACTION_DIAL or ACTION_CALL or if it is
ACTION_SENDTO, only skip if data scheme is one of "sms:", "smsto:",
"mms:" or "mmsto:".

Bug: 111228250
Test: atest FrameworksCoreTests:IntentForwarderActivityTest
Change-Id: Idef71ff2928e9e3d72bad4ba8ff17f9306e91d25
2018-08-02 14:52:30 +01:00
Olivier Gaillard
af17609d6e Merge "Add support for battery/screen state changes." 2018-08-02 08:33:17 +00:00
Olivier Gaillard
86714d1347 Add support for battery/screen state changes.
Only collect data when the device is charging to be consistent with what
battery stats is doing.

Add a screen interactive dimension to have more context to analysis the
binder calls data.

Test: unit test
Change-Id: Id31c53ae315d905e5d8e67918f64780f34ff5d72
2018-08-01 21:03:59 +01:00
TreeHugger Robot
38663ab205 Merge "Add 2 Settings.Global keys for Settings ExternalProvider." 2018-08-01 18:12:10 +00:00
TreeHugger Robot
94efa9cb6f Merge "Settings: Add a setting to toggle wifi scan throttling" 2018-08-01 16:42:29 +00:00
Fan Zhang
f5d74c7665 Add 2 Settings.Global keys for Settings ExternalProvider.
Bug: 111941143
Test: rebuild
Change-Id: I8ee5b17601f85fc2ab9f7dea2824800405a188c5
2018-08-01 09:37:32 -07:00
Roshan Pius
adb9394832 Settings: Add a setting to toggle wifi scan throttling
Scan throttling affects apps which are used by testers for survey-like
application. Add a hidden setting which can be toggled via adb commands
to turn off all scan throttling.

Bug: 111763749
Test: Unit tests
Test: `adb shell settings put global wifi_scan_throttle_enabled 0` on
user build.
Change-Id: I6c9a468c573239914b88de0afcdd7e477429cb16
2018-08-01 07:55:46 -07:00
Olivier Gaillard
1c24ace379 Merge "Optimize resolving transaction codes." 2018-08-01 08:09:55 +00:00
Olivier Gaillard
f31dfb94f8 Optimize resolving transaction codes.
Do the heavy work outside of the main lock and only resolve the same
method once.

Test: unit test
Change-Id: I083b3e66d35178311b5ee71443b39efe1112ad55
2018-07-31 22:49:29 +01:00
TreeHugger Robot
57fcafd02b Merge "Move some global settings to secure settings" 2018-07-31 17:13:27 +00:00
Beverly
91d0a63a58 Move some global settings to secure settings
The following Settings are being moved to Settings.Secure
from Settings.Global since they are settings that exist
per user
- CHARGING_SOUNDS_ENABLED
- CHARGING_VIBRATION_ENABLED
- ZEN_DURATION
- SHOW_ZEN_UPGRADE_NOTIFICATION
- SHOW_ZEN_SETTINGS_SUGGESTION
- ZEN_SETTINGS_UPDATE
- ZEN_SETTINGS_SUGGESTION_VIEWED
zen_duration used to be a global setting -> move it to
Settings.Secure since users can set different values

Fixes: 110926544
Test: make RunSettingsLibRoboTests -j40 ROBOTEST_FILTER=ZenDurationDialogTest
Test: manual upgrade
Change-Id: Ifa36affe3e52e67a54698a8cf2c3424343877179
2018-07-31 11:42:05 -04:00
Olivier Gaillard
1f93a77b5c Resolves transaction codes lazily when a dump is requested.
This change allows to save:
- some memory by removing the method name from CallStat and CallSession
- some CPU by not calling binder.resolveCode for every binder call
at the expense of some hackiness (calling getDefaultTransactionCode
using reflection)

BinderCallsStats#getExportedCallsStats is now more costly to call but it
will be invoked only once a day only.

Test: unit test
Change-Id: Id4f933644c6da9d4aa2d0671db4ab80676eac1b0
2018-07-31 15:18:12 +00:00
Rhed Jao
54e83cd025 Merge "Fix duplicate a11y focus node in AccessibilityCache." 2018-07-31 02:03:54 +00:00
Olivier Gaillard
7a2a98bb7f Store the runtime class instead of the class name.
This will be used by a follow up CL to call getTransactionCode lazily
instead of doing it during the binder call.

Test: unit tests
Change-Id: I11a997bb8a6268871daf4145a962886b43195c89
2018-07-30 17:59:30 +00:00
TreeHugger Robot
5d97dd31f0 Merge "Add test for when a WorkSource removes itself." 2018-07-28 00:45:15 +00:00
Phil Weaver
b5df055d34 Merge "Enhance a11y soft keyboard controller" 2018-07-27 23:43:32 +00:00
Jeff Sharkey
3ea5588f7c Merge "Support for appending "standalone" WHERE chunks." 2018-07-27 23:21:53 +00:00
TreeHugger Robot
e477cc4c94 Merge "Extract native methods into isolated classes" 2018-07-27 20:44:34 +00:00
Phil Weaver
03a65b04d8 Enhance a11y soft keyboard controller
Allow a11y services to request that the soft keyboard be
shown even when the hard keyboard is attached.

Defer to users who override this behavior, and put things
back the way they were when a service requesting this
behavior stops.

Bug: 31012180
Test: Adding CTS tests in linked CL, ran a11y unit tests,
modified TestBack to use the new flag and verified behavior
with a hard keyboard and verfied that settings behave as
expected when overriding and rebooting.
Change-Id: I530481e102ac376a4506b662862ee1ee74815b40
2018-07-27 12:58:18 -07:00
Jeff Sharkey
b89df9eac8 Support for appending "standalone" WHERE chunks.
The existing appendWhere() methods aren't very friendly for
developers, since they require manual tracking of state to decide if
subsequent standalone chunks should be prefixed with "AND".

While it's tempting to offer direct argument binding on the builder
class, we can't really deliver on that API in a secure way, so instead
add separate bindSelection() method which explicitly burns arguments
into a standalone selection string, which can then be appended to
the builder.

This was the last piece of new functionality being used by
SQLiteStatementBuilder, so we can delete that class and migrate
users back to SQLiteQueryBuilder.

Bug: 111268862
Test: atest frameworks/base/core/tests/coretests/src/android/database/DatabaseUtilsTest.java
Test: atest frameworks/base/core/tests/utiltests/src/com/android/internal/util/ArrayUtilsTest.java
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Change-Id: I418f24338c90bae8a9dad473fa76329cea00a8c5
2018-07-27 13:45:51 -06:00
Seigo Nonaka
6f11c6e7e2 Extract native methods into isolated classes
StaticLayout/MeasuredParagraph uses native methods which is a pain point
of porting TextView to JetPack.
To make minimize the dependency to the native methods, extract native
methods and put them into a thin wrapper class.

The performance impact is limited:

android.text.StaticLayoutPerfTest:
    PrecomputedText Balanced Hyphenation  :    602 ->    644: ( +42, +7.0%)
    PrecomputedText Balanced NoHyphenation:    457 ->    476: ( +19, +4.2%)
    PrecomputedText Greedy Hyphenation    :    397 ->    412: ( +15, +3.8%)
    PrecomputedText Greedy NoHyphenation  :    397 ->    411: ( +14, +3.5%)
    RandomText Balanced Hyphenation       : 17,594 -> 17,715: (+121, +0.7%)
    RandomText Balanced NoHyphenation     :  7,146 ->  7,236: ( +90, +1.3%)
    RandomText Greedy Hyphenation         :  7,125 ->  7,196: ( +71, +1.0%)
    RandomText Greedy NoHyphenation       :  7,099 ->  7,187: ( +88, +1.2%)
  draw
    PrecomputedText NoStyle               :    614 ->    628: ( +14, +2.3%)
    PrecomputedText Style                 :    778 ->    826: ( +48, +6.2%)
    RandomText NoStyle                    :    537 ->    540: (  +3, +0.6%)
    RandomText Style                      :    786 ->    759: ( -27, -3.4%)

Bug: N/A
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest

Change-Id: I976df4db63be241af395dd30dd94182f76bdae53
2018-07-27 11:08:43 -07:00
Felipe Leme
2dbf5765de Merge "Created new Settings preferences for internal autofill state." 2018-07-27 16:02:34 +00:00
Rhed Jao
ca9b526022 Fix duplicate a11y focus node in AccessibilityCache.
Change-Id: I2755b6f43b01001a5f8e2e7c164b2e9666d95602
Fixes: 77980418
Test: atest AccessibilityCacheTest
2018-07-27 21:28:43 +08:00