Commit Graph

3397 Commits

Author SHA1 Message Date
Aaron Heuckroth
09d6bd8a66 Merge "Move channel logging to dump method and redact name." 2018-07-10 18:05:34 +00:00
Olivier Gaillard
103aae2096 Resolve codes to method names for binder call stats.
Test: unit test

Change-Id: Ie2178e6f9ebb900251d7c9ab20587d3c01acda83
2018-07-10 12:56:08 +01:00
Olivier Gaillard
d2af61a1e8 Merge "Add experiment flag to control binder call stats." 2018-07-09 19:09:47 +00:00
Aaron Heuckroth
51d3288431 Move channel logging to dump method and redact name.
Test: Generate bug report and confirm that NotificationChannel logs contain redacted name strings.
Change-Id: Iebaf7b165de0276e69ead862aa7ec864ef912282
Fixes: 78326066
2018-07-09 13:26:48 -04:00
TreeHugger Robot
460f4c24d1 Merge "Move displayId into InputEvent" 2018-07-05 18:28:56 +00:00
Siarhei Vishniakou
91fa08ff1b Move displayId into InputEvent
Now both KeyEvent and MotionEvent will contain displayId. This will help
with dispatching input events to specific displays. There are use cases
where a particular input device is used for a specific display only, and
it sends key events to the system. This will help with those usages.

Test: atest view.MotionEventTest view.KeyEventTest
Bug: 64258305
Change-Id: I75891037617ed60820d60736216a0d615ab5e3b0
2018-07-05 16:29:51 +01:00
Lucas Dupin
4b4c530ced Revert "Add theme mode design let user can choose theme self"
The CL was intended only for P as a temporary solution.
This reverts commit f0800fa3bd.

Test: switch wallpapers, observe theme
Bug: 110758454
Change-Id: If10e4d87b6ddac10063b2671abd99e0baccdf92e
2018-07-04 11:22:18 -07:00
Olivier Gaillard
1d7f615eec Add experiment flag to control binder call stats.
For instance, to enabled detailed tracking locally.
adb shell settings put global binder_calls_stats detailed_tracking=true

Also adds the ability to turn off data collection completely and
changing the sampling interval. Uploading data through westworld can
re-use the same flag once implemented.

Test: Unit tested

Change-Id: I808c9902b8124ab643d9b197703d537da040ae3e
2018-07-04 13:36:46 +01:00
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
TreeHugger Robot
080faba4f4 Merge "Stop restoring spell checker settings" 2018-07-03 20:34:32 +00:00
TreeHugger Robot
9445ca3ab9 Merge "Bugreport: Fix SystemUI service from being dumped twice 1/2" 2018-07-03 17:42:25 +00:00
TreeHugger Robot
e026b408b5 Merge "Track max CPU and latency of binder calls" 2018-07-03 11:11:27 +00: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
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
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
c39a8ac6e7 Merge "Remove sleep_timeout setting from backup" 2018-06-28 17:34:11 +00:00
Bernardo Rufino
338832fad8 Remove sleep_timeout setting from backup
It is not user-configurable.

Bug: 79779285
Test: atest SettingsBackupTest
Test: # w/ LocalTransport
      adb shell settings put secure sleep_timeout 5000
      adb shell bmgr backupnow com.android.providers.settings
      adb shell settings put secure sleep_timeout 3000
      adb shell bmgr restore 1 com.android.providers.settings
      adb shell settings get secure sleep_timeout => ensure 3000

Change-Id: I68bf2f91cc3d4c00463468a6abaef3b64d5c10b9
2018-06-28 16:32:42 +00:00
Neil Fuller
58969298c1 Merge "Add more behavior to TimeDetectorService" am: b1fc5a4c7e am: 325ecf7df4
am: 55b29baea1

Change-Id: I4fe5fe32ffbd807680d688f4415e5dc9e47069d5
2018-06-26 05:33:35 -07:00
Neil Fuller
55b29baea1 Merge "Add more behavior to TimeDetectorService" am: b1fc5a4c7e
am: 325ecf7df4

Change-Id: I28d5b3dbd666dc9d097f6fb7c15dc5ba8cf931e9
2018-06-26 05:23:26 -07:00
Neil Fuller
325ecf7df4 Merge "Add more behavior to TimeDetectorService"
am: b1fc5a4c7e

Change-Id: Ibbda2d253bf807cc480a4218aa1d898d6737ec7b
2018-06-26 05:14:31 -07:00
TreeHugger Robot
67f17cd690 Merge "Handle tri-state location permission." 2018-06-25 18:41:07 +00:00
Neil Fuller
4980bbcd30 Add more behavior to TimeDetectorService
The client code now "suggests" time updates
to the time detection service. The current implementation
of the time detection service will validate and set the
device system clock as needed. In future it will ignore
these suggestions if better information is available.

Responsibility for sending the
TelephonyIntents.ACTION_NETWORK_SET_TIME intent has
been moved to the time detection service until it can be
removed or replaced.

The telephony code is still responsible for basic rate
limiting but the majority of the decision logic has been
moved to the service.

There is an associated change in telephony code to switch to
using the server.

Bug: 78217059
Test: atest FrameworksServicesTests:com.android.server.timedetector
Test: atest FrameworksCoreTests:android.util.TimestampedValueTest
Change-Id: I4f7a10ac06b2d32da22689e1ddf309e0a2795f30
2018-06-25 19:34:05 +01:00
Wei Wang
dd070f2fd9 Handle tri-state location permission.
Use noteOp instead of checkOp as checkOp doesn't consider
background status.

Watch location permission changes caused by background status.

Restrict age of last location for foreground-only apps.

Bug: 80318398
Test: Manual
Change-Id: I3499d4150478b6f501966953f8e4a08169f3557c
2018-06-22 14:12:20 -07:00
Jeff Sharkey
bb29a80c6b Merge "Introduce RedactingFileDescriptor." 2018-06-21 23:35:59 +00:00
Jeff Sharkey
494500d83a Introduce RedactingFileDescriptor.
Files on disk can sometimes contain content that should be redacted
based on the permissions of the remote caller.  (For example, EXIF
data containing location information shouldn't be visible to apps
that haven't been granted the location permission.)

This class provides an easy way to "redact" ranges within an
underlying file, without the overhead of making a duplicate copy
of the file, or the limitations of returning a non-seekable FD.

Bug: 110228267
Test: atest android.os.RedactingFileDescriptorTest
Change-Id: I0b3b9f642573f6165e152e7568cdaf55f0af7134
2018-06-20 14:17:51 -06:00
TreeHugger Robot
751bd5b621 Merge "Link Speed Metrics Proto" 2018-06-20 19:28:39 +00:00
TreeHugger Robot
664e0d66c7 Merge "Wifi Usability Metrics Proto Update" 2018-06-20 18:03:16 +00:00
Riddle Hsu
95459d3e6e Ensure consistent attach/detach callback on transient view
- Not allow to add as transient view if it still has a parent.
  (The normal usage of addTransientView should be after removeView)
- If a view container is not attached, its transient view should
  not be attached.
- If a transient view is already detached from parent, no need
  to detach again when removing the transient view.

Bug: 109814657
Test: atest FrameworksCoreTests:ViewGroupTransientViewTest
Change-Id: I243cc292e4aaba987d48eeb202559de866a8c208
2018-06-20 05:09:32 +00:00
Jong Wook Kim
e4aa37fe48 Link Speed Metrics Proto
Add a histogram of link speed values with count and rssi values.

Collect this metrics only when enabled in settings. By default, we don't
collect this metrics.

Bug: 78354985
Test: Settings Unittest
Change-Id: I683dfb45a01de5e1243d612a117a5544b0d4dc05
2018-06-18 18:21:45 -07:00
Jong Wook Kim
411cab97c6 Wifi Usability Metrics Proto Update
Generate WifiIsUnusableEvent when there is a data stall or a firmware
alert. In WifiIsUnusableEvent, store metrics related to time, packet
counts, trigger reason, and score.

Also, log ExperimentValues that we plan to change through global
settings varaible.

This logging is enabled by setting WIFI_IS_UNUSABLE_EVENT_METRICS_ENABLED
to 1. By default, this metric is not collected.

Manual Check Process:
- Connect to a network
- adb shell settings put global wifi_is_unusable_event_metrics_enabled 1
- adb shell dumpsys wifi wifiMetricsProto
- Move away from the ap to trigger data stall
- adb shell dumpsys wifi | grep -10 WifiIsUnusableEventList
- Verify that there is a WifiIsUnusableEvent

Bug: 77603216
Test: Unittest (settings core/tests/coretests).
Test: Manual Check.
Change-Id: I2d8425a420f5ba18e3eee0e11b6f35f6239a97b2
2018-06-18 17:32:03 -07:00
Kevin Chyn
b5b29a8c70 Merge "Merge "Don't back up Assist Gesture setup/sensitivity" into pi-dev am: a74fbef8ce" into pi-dev-plus-aosp
am: fe611a5700

Change-Id: I1aba793c0c71573e06d52f14aec823a4f6d3ad93
2018-06-15 23:07:17 -07:00
Kevin Chyn
ecc07726e2 Merge "Don't back up Assist Gesture setup/sensitivity" into pi-dev
am: a74fbef8ce

Change-Id: Ib14cc5a35991dec3623ecf2dfdb72cbbccd7e53e
2018-06-15 22:49:30 -07:00
Bernie Innocenti
e00ce5e9ea Merge "Make dumpHexString() tolerate null arrays." am: a917c1db32 am: 7bb253d078
am: 3e0f3ef8ad

Change-Id: I1fbea877d10b4f270fc1722ec1c14e9bd8f131a3
2018-06-14 22:12:11 -07:00
Bernie Innocenti
7bb253d078 Merge "Make dumpHexString() tolerate null arrays."
am: a917c1db32

Change-Id: Ib0160e232cab0a713853a65eef26f7a02d65c1f1
2018-06-14 21:55:53 -07:00
TreeHugger Robot
070a6a4da3 Merge "Fix DateTimeViewTest illegal access error" 2018-06-14 15:05:34 +00:00
Bernie Innocenti
dee4e0bde4 Make dumpHexString() tolerate null arrays.
Rationale: hexdumps are mainly used when verbose logging is enabled,
which means that callers are rarely exercised (let alone tested).
Crashing on unchecked null pointers doesn't make debugging any easier,
nor production code any more robust.

Moreover, this is the behavior of system.out.println() and other
logging APIs.

Test: runtest -x core/tests/coretests/src/com/android/internal/util/HexDumpTest.java
Bug: 110177912
Change-Id: Idccd81a5654ed0f7fee6b27177941bf8c311973e
2018-06-14 22:59:08 +09:00
TreeHugger Robot
4fa7af169b Merge "Add emergency dialer option on power menu" 2018-06-14 09:52:27 +00:00
Wesley.CW Wang
8d07276f23 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
Change-Id: I9c920e31433c0ac23165f917d8dd2befaaa4938d
Bug: 80376488
2018-06-14 15:06:20 +08:00
Riddle Hsu
92fcacdd85 Fix DateTimeViewTest illegal access error
Even package path is the same, different classpath (bootclass vs test)
will be considered as different package that does not allow package access.
Also correct to verify twice detach.

Bug: 78506836
Test: atest FrameworksCoreTests:DateTimeViewTest
Change-Id: If60fe89049f5e4b8366c6e1e4d4e2d7e38a57b7c
2018-06-14 04:38:49 +00:00
Neil Fuller
415585f2a5 Merge "Simple pass-through TimeDetectorService"
am: cb749e2e50

Change-Id: Ic2e3d3c3f9181ef4054f599baf4ac086ec21d8bd
2018-06-12 11:17:51 -07:00
Neil Fuller
4773b9dadc Simple pass-through TimeDetectorService
This is sufficient to wire up time detection from telephony
to the new service without breaking time detection.

This cherry-pick contains a small change: to use
SystemClock.elapsedRealtime() instead of the newer
SystemClock.elapsedRealtimeClock() with Clock.millis().

Bug: 78217059
Test: atest FrameworksServicesTests:com.android.server.timedetector
Test: atest FrameworksCoreTests:android.util.TimestampedValueTest
Merged-In: Id7175878dc22e5272c31f3e478af4b0e4183b62b
Change-Id: Id7175878dc22e5272c31f3e478af4b0e4183b62b
(cherry picked from commit 24836bfb15)
2018-06-12 15:33:35 +01:00
Neil Fuller
1ed497ce1b Merge "Simple pass-through TimeDetectorService" 2018-06-12 09:49:33 +00:00
Kevin Chyn
6df6b027f0 Don't back up Assist Gesture setup/sensitivity
Fixes: 72715022

Test: With two devices, set up one, back up onto the other.
      SUW for Assist Gesture does not get skipped
Test: atest SettingsBackupTest

Change-Id: Id7348542a618c0366f89c47833af6f66bf52b18f
2018-06-11 16:13:00 -07:00
Neil Fuller
24836bfb15 Simple pass-through TimeDetectorService
This is sufficient to wire up time detection from telephony
to the new service without breaking time detection.

Bug: 78217059
Test: atest FrameworksServicesTests:com.android.server.timedetector
Test: atest FrameworksCoreTests:android.util.TimestampedValueTest
Change-Id: Id7175878dc22e5272c31f3e478af4b0e4183b62b
2018-06-11 21:13:53 +01:00
Makoto Onuki
8a3d990e85 Merge ""am dumpheap" is now synchronous." 2018-06-11 18:09:43 +00:00
Damien Bargiacchi
467fc61aa2 Merge changes from topic "wear_power_service-master"
* changes:
  Start the WearPowerService with the other Wear system services
  Add a setting for the User Absent, Touch Off feature in Wear
2018-06-11 17:49:24 +00:00
Makoto Onuki
2c6657f836 "am dumpheap" is now synchronous.
- Wait until the dump finishes before returning.
- Also now the filename argument is optional, with the default name of:
"/data/local/tmp/heapdump-yyyymmdd-hhmmss.prof"

Test: adb shell am dumpheap system
Test: adb shell am dumpheap system /data/local/tmp/heapdump.prof
Change-Id: I6a4c815015b731a30ffbdda5a32da541c0b790ec
Fixes: 79413767
Fixes: 62189236
2018-06-11 15:48:46 +00:00
Fan Zhang
c69c8b6008 Add a setting to control multi-user feature on/off.
Bug: 72319180
Test: n/a
Change-Id: I0fd00e9c278de8ece530cacd43aaeae854002f14
2018-06-08 14:48:54 -07:00
Wei Sheng Shih
f61f75ecf6 Merge "Fix test case failed at DocumentsProviderTest#testFindDocumentPath_treeUri_throwsOnNonChildDocument." 2018-06-08 09:03:59 +00:00
TreeHugger Robot
7231e7b6ce Merge "More conservative dark text calculation" 2018-06-08 04:33:50 +00:00