Commit Graph

4703 Commits

Author SHA1 Message Date
Igor Viarheichyk
025402c5e9 Simple numbering system selector for LocalePicker.
This change introduces minimal changes needed to support selection
of locales with BCP 47 numbering system specification. Two level
selection (Language/Region) schema remains, locales with numbering
systems appear in the region selection list and are displayed as
"region (numbering system)".

Bug: 18340949
Bug: 63754513
Test: manual, experimental UI for review.

Change-Id: I42691f3714c5e5c51fd8d96c034cc3a9f6be93dc
2017-10-30 14:35:06 -07:00
Yueming Wang
5593322a2e Merge "Add DISALLOW_CONFIG_DATE_TIME user restriction." 2017-10-27 21:15:47 +00:00
Hans Boehm
c9d246f7da Merge "Don't allocate GlobalRefs for BinderProxy" am: 1455a1d0c0 am: b4210d8160
am: 1c12235c08

Change-Id: I5a17d090783a81d65903a20ba7deac3332bd404a
2017-10-27 17:50:25 +00:00
Hans Boehm
1c12235c08 Merge "Don't allocate GlobalRefs for BinderProxy" am: 1455a1d0c0
am: b4210d8160

Change-Id: Ida801a358acab13e8515db98b37165179cf5135a
2017-10-27 17:38:31 +00:00
TreeHugger Robot
bfc6a2bc36 Merge "Notification: Fix PendingIntent whitelisting" 2017-10-27 15:34:49 +00:00
Adrian Roos
fb92184ebc Notification: Fix PendingIntent whitelisting
Fixes several issues with the way PendingIntents are being whitelisted
from background check with Notifications. Most visibly, this causes the
whitelisting not to work on Notifications that use the DecoratedContentViewStyle,
but there are some conditions where the whitelisting breaks for regular
notifications too.

- After a Notification is rebuilt with Notification.Builder, the set
  of PendingIntents in the notification was not rebuilt.
  This broke the whitelisting whenever a PendingIntent is added after
  the Notification was already sent once. Workaround for broken platform
  releases: always use  a fresh Notification object, or clone before
  sending.

- Fixes PendingIntent.writePendingIntentOrNullToParcel to invoke the
  OnMarshalListener.
  This broke whitelisting for any PendingIntents attached to custom
  RemoteViews. Workaround for broken platform releases: Also attach
  the PendingIntent to the Notification's extras.

- Changes RemoteViews to keep the parcel cookies that were present
  during unparceling, such that they can be reapplied when it gets
  cloned.
  This broke whitelisting for any PendingIntents attached to a
  DecoratedContentViewStyle *even if added to extras*. Workaround
  for broken platform releases: none.

- Fixes Notification.whitelistToken mistakenly being static.
  There's an unlikely race condition where the field could be
  overriden with null by an incoming notification right as another
  notification is sent out. Workaround for broken platform releases:
  none.

Test: runtest -x core/tests/coretests/src/android/app/NotificationTest.java && runtest -x core/tests/coretests/src/android/widget/RemoteViewsTest.java
Bug: 68218899
Change-Id: I02e44040604a1d24422340611ae9e0332a611800
2017-10-27 15:46:40 +02:00
yuemingw
a9772f3602 Add DISALLOW_CONFIG_DATE_TIME user restriction.
Test: cts test for bug 67627542 in following cl
Bug: 67497909

Follow design doc: https://docs.google.com/document/d/1NV93mr2CT157S_haru1QbKo9HLeP9iPM9eMiGfVmfCM/edit#
Change-Id: Iee3c2fbf88b4958dde81330c2e4d60dfce09197f
2017-10-27 10:50:49 +01:00
Hans Boehm
1602cb58f3 Merge "Convert Binder & BinderProxy to NativeAllocationRegistry" am: bd6d3c5743 am: a177c5c9d2
am: d4fff83a65

Change-Id: I45c54ae273e33d82cfea107b31c1ca63d23d8f66
2017-10-27 04:18:40 +00:00
Hans Boehm
d4fff83a65 Merge "Convert Binder & BinderProxy to NativeAllocationRegistry" am: bd6d3c5743
am: a177c5c9d2

Change-Id: I087b9b3374fc51fa5ded63fbd999f4398f564628
2017-10-27 03:58:59 +00:00
TreeHugger Robot
4b34000a21 Merge "Add proto dump flag to services (2/2)" 2017-10-26 23:45:46 +00:00
Hans Boehm
29f388fc21 Don't allocate GlobalRefs for BinderProxy
This removes all GlobalRef allocation as part of building BinderProxys.
Previously these were used to map IBinders to the corresponding
Java object, so the Java objects could be reused. We now keep
that mapping at the Java level.

This means we often need to call into Java to look up or allocate
a BinderProxy. But this replaces a prior call to Java to dereference
a WeakReference. The Java custom Java map-to-WeakReference data
structure is probably not terribly efficient, but the original
attachement mechanism did not seem to be either. And this
avoids potentially even more catastrophic issues when the number
of GlobalRefs approaches its limit.

We decrease GC triggering frequency from 200 to 1000 allocated
references. This now only applies to other kinds of JNI References
allocated by Binder.

I saw a maximum bucket size of 16 for the ProxyMap data structure
while briefly exercising a freshly booted device. That occurred
in system_server.

Bug: 65760710

Test: Built and booted master with some debugging output. Looks sane.
Change-Id: I322c4d8e9c8e198586d591580c2cdbb094906677
2017-10-26 13:34:19 -07:00
Vishnu Nair
e78b01ad2d Add proto dump flag to services (2/2)
Adds new PROTO flag which requests services to dump sections in proto format. Modifies PriorityDumper helper class to parse proto arguments and set asProto flags. Registers WM and AM with proto dump supprt.

Bug: 67716082

Test: frameworks/base/services/tests/runtests.py -e class "com.android.server.utils.PriorityDumpTest"
Test: adb bugreport ~/tmp/bug.zip
Test: adb shell dumpsys window --proto
Test: adb shell dumpsys activity --proto

Change-Id: Icfc6857c8a9340110a43343734a27e48d0b5a229
2017-10-26 10:11:54 -07:00
Hans Boehm
5e5b13f27e Convert Binder & BinderProxy to NativeAllocationRegistry
Change the Java BinderProxy to only contain a single native pointer,
so that we can get by with a single NativeAllocationRegistry
registration. This adds some indirections and a new allocation. But it
marginally reduces the number of (expensive) JNI field lookups from
native code, and the extra allocation involves significantly less
overhead than registering each object twice. This also cleans up the
code a little by avoiding some explicit reference count adjustments.

Change BinderProxy Binder to use NativeAllocationRegistry instead of
finalize().

Change the mObject field in Binder to hold a non-reference-counted
but owning pointer to JavaBBinderHolder. Have JavaBBinderHolder no
longer inherit from RefBase.

Make it clear that neither Binder.mObject, not BinderProxy.mNativeData
can be null. Remove null checks.

Avoid checking for null returns from C++ new. It would throw
anyway, which would cause the process to abort.

Test: Booted master.

Bug: 65760710

Change-Id: I323d4bdc7e25f8c27b847b6fe2c073eac3f2efe5
2017-10-25 17:17:24 -07:00
Kurt Nelson
9bcd7e9c5d Move violation extra messages into throwable
Some violations have a separate string from the throwable. Prepending
the string to the throwable's message or using it as the message sets us
up for all violations to extend Throwable.

Bug: 62458734
Test: cts-tradefed run cts-dev --module CtsOsTestCases --test
android.os.cts.StrictModeTest
Change-Id: I6a97ee69a90fb975dc453ca37fe53ea78ebfe974
2017-10-25 17:14:38 -07:00
Kurt Nelson
826d12cf92 Merge "Use annotation instead of comment" 2017-10-26 00:09:12 +00:00
Dianne Hackborn
8de9566375 Fix issue #64224738: Document return value of IBinder.transact()
Also add appropriate @NonNull and @Nullable annotations.

Test: built

Change-Id: I22de48105ef685baf594cfc004dd3e27e2ba09e9
Merged-In: I22de48105ef685baf594cfc004dd3e27e2ba09e9
(cherry picked from commit 4cd650c008)
2017-10-25 14:21:32 -07:00
Kurt Nelson
1981f4292d Use annotation instead of comment
Test: none
Bug: none
Change-Id: I723fba865116a203147dd5f2a6343b2cb29c65a2
2017-10-25 13:53:29 -07:00
Dianne Hackborn
c81983a0c3 Start removing remaining pm code to package manager
Everything is now moved out of the pm command except for
the various install commands.  I am going to hold of on
those since they require doing some resolution with the
current implementations in the package manager to make
sure they match and behave identically to the implementations
currently in the pm command.  But other than that, everything
in pm is now just redirecting over to "cmd package".

Also fix up some of the dumpsys output of a few other sevices
when asking to print the data for a particular package, so
the "pm dump" command gives a little more sane result.

Test: manual

Change-Id: I139e06e560203b72243d7eea9543c2240db0f8f8
2017-10-25 12:19:26 -07:00
TreeHugger Robot
17e5e2e573 Merge "Add some atoms to statsd" 2017-10-25 17:04:54 +00:00
Steven Moreland
90694f7037 Merge "Revert "HIDL Java getService now the same as C++."" am: 65d1e549b6 am: 4868f5311e
am: b29739e1c9

Change-Id: I0a11131c6736f03b15e967990edbbbd47b6537ed
2017-10-25 06:19:38 +00:00
Steven Moreland
b29739e1c9 Merge "Revert "HIDL Java getService now the same as C++."" am: 65d1e549b6
am: 4868f5311e

Change-Id: I80789cb8e1cf0d49e3f85fffe29a12eb74b7726e
2017-10-25 05:56:47 +00:00
Steven Moreland
65d1e549b6 Merge "Revert "HIDL Java getService now the same as C++."" 2017-10-25 04:50:08 +00:00
Steven Moreland
cc9e67c019 Revert "HIDL Java getService now the same as C++."
Appears to be causing problems on 2017 devices.

This reverts commit c1f00f8cd8.

Change-Id: I6c1717a612bfa3fe63f08160a1db652c284f6ba4
2017-10-25 04:46:26 +00:00
Steven Moreland
8c69e67acd Merge "HIDL Java getService now the same as C++." am: 0c41ad872f am: 34b5b69de9
am: fd05e9a075

Change-Id: I6e55ca21bf55f3fe581eaceabc371dc0b85260ad
2017-10-25 02:24:45 +00:00
Steven Moreland
fd05e9a075 Merge "HIDL Java getService now the same as C++." am: 0c41ad872f
am: 34b5b69de9

Change-Id: I3d7bd6b7b352093306da5d250b518ca9b7dc0f6b
2017-10-25 02:13:39 +00:00
Treehugger Robot
0c41ad872f Merge "HIDL Java getService now the same as C++." 2017-10-25 01:53:16 +00:00
Bookatz
8c6571bde8 Add some atoms to statsd
The following atoms (events) are added:
BatteryLevelChanged
ChargingStateChanged
PluggedStateChanged
DeviceTemperatureReported
DeviceOnStatusChanged
WakeupAlarmOccurred
KernelWakeupReported

Test: manual
Change-Id: I1e7d8a842ee67b5da30f20c9e6976c5bc4e0a0ef
2017-10-24 18:18:19 -07:00
TreeHugger Robot
c3787a8a83 Merge "Adds aidl definitions and their implementations for binder transfer of statsd entries to clients. This change only includes changes on statds side and does not include java library for clients to import. Java library will be a separate change as it requires system api review." 2017-10-25 00:18:53 +00:00
yro
31eb67b349 Adds aidl definitions and their implementations for binder transfer of
statsd entries to clients. This change only includes changes on statds
side and does not include java library for clients to import. Java
library will be a separate change as it requires system api review.

Test: statsd, statsd_test
Change-Id: I306c6e9687801668cc0145b12d38406bfe634775
2017-10-24 15:25:27 -07:00
Kurt Nelson
1efd46211f Merge "Plumb real stack traces through StrictMode" 2017-10-24 22:19:44 +00:00
Kurt Nelson
0918c93a3f Plumb real stack traces through StrictMode
Currently StrictMode uses a string representation of the entire stack
trace throughout. Switching to passing Throwables will allow callback
consumers to traverse an array.

It does not regress the performance test added in ag/3083879.

Test: adb shell am instrument -w -e class android.os.StrictModeTest \
    com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

timeThreadViolation_mean=332071
timeThreadViolation_median=328184
timeThreadViolation_min=311253
timeThreadViolation_standardDeviation=16106

timeCrossBinderThreadViolationNoStrictMode_mean=1843599
timeCrossBinderThreadViolationNoStrictMode_median=1824457
timeCrossBinderThreadViolationNoStrictMode_min=1810186
timeCrossBinderThreadViolationNoStrictMode_standardDeviation=43539

timeCrossBinderThreadViolation_mean=2300256
timeCrossBinderThreadViolation_median=2148796
timeCrossBinderThreadViolation_min=1792660
timeCrossBinderThreadViolation_standardDeviation=472271

timeVmViolationNoStrictMode_mean=27794864
timeVmViolationNoStrictMode_median=26617027
timeVmViolationNoStrictMode_min=23994153
timeVmViolationNoStrictMode_standardDeviation=3384362

timeVmViolation_mean=32878535
timeVmViolation_median=34775241
timeVmViolation_min=28373537
timeVmViolation_standardDeviation=3462046

timeThreadViolationNoStrictMode_mean=373863
timeThreadViolationNoStrictMode_median=388998
timeThreadViolationNoStrictMode_min=333664
timeThreadViolationNoStrictMode_standardDeviation=33219

Bug: 62458734
Change-Id: I6b3924be91f19654c502e0ec2f44cc07d6e86e3f
Test: cts-tradefed run cts-dev --module CtsOsTestCases --test
android.os.cts.StrictModeTest
2017-10-23 10:04:19 -07:00
Steven Moreland
c1f00f8cd8 HIDL Java getService now the same as C++.
getService: wait for service if it is declared in the manifest
tryGetService: only return if the service is immediately available

Bug: 67981006
Test: hidl_test_java
Change-Id: I4485b84f0fde98851cf5f64d198a8c5410795c8c
2017-10-23 01:23:45 -07:00
TreeHugger Robot
b3d66a3ccd Merge "Changes pulled data to use Parcel objects." 2017-10-21 01:21:39 +00:00
David Chen
1481fe142d Changes pulled data to use Parcel objects.
Previously, pulled data was returned as a string. We instead
return the data as an array of StatsLogEventWrapper, which encodes
using the binary-encoded format liblog uses. StatsD uses the same
parsing as for pushed events to convert these. This CL also fixes
the parsing of log_msg since the strings were previously emptied
before we had a chance to read the values.

Note that the cpp-aidl can't support List of Parcelable, so we
have to return the results as an array.

Test: Manual using the new command in StatsService to print results.
Also created a new unit-test by creating a dummy pull code of -1,
but this test is deleted since it required creating a fake output in
StatsCompanionService.

Change-Id: I1cfb9ea081a59292a60e934e8527adc40982ed80
2017-10-20 16:29:59 -07:00
TreeHugger Robot
0d769d80a9 Merge "incidentd: dumping batterystats app data to proto" 2017-10-20 23:22:48 +00:00
TreeHugger Robot
fc5d6617c3 Merge changes from topic "health2_healthd_hwbinder"
* changes:
  BatteryService serves IBatteryPropertiesRegistrar.
  BatteryService: Use android.hardware.health@2.0.
2017-10-20 00:10:04 +00:00
Tom Cherry
d097e2aaf2 Merge "Allow ro. properties to have arbitrary lengths" am: 3851f132d1 am: 9fba6c2fe1 am: 918a29c88d
am: 3fb7276115

Change-Id: I7bc3e26d70267add40bfc2fb09b69b475e4daec6
2017-10-18 19:55:19 +00:00
Tom Cherry
3fb7276115 Merge "Allow ro. properties to have arbitrary lengths" am: 3851f132d1 am: 9fba6c2fe1
am: 918a29c88d

Change-Id: I29e0ca8d91d29431b498788b548fd48e85d6669b
2017-10-18 19:44:54 +00:00
Yifan Hong
1fd86f4c05 BatteryService serves IBatteryPropertiesRegistrar.
This binder service is originally served by healthd.
To allow BatteryManager to continue to work, BatteryService
implements this binder service.

Test: BatteryManagerTest
Bug: 62229583

Change-Id: I9c97b3936546740c6d63060899fe50c5c4c957bd
2017-10-18 12:35:10 -07:00
Kweku Adams
103351f9c2 incidentd: dumping batterystats app data to proto
Bug: 65750808
Test: flash device and checkout proto output against csv output
Change-Id: I2dad948d4b43dc904f01dcaef137a3ff947062c6
2017-10-18 12:32:38 -07:00
Tom Cherry
918a29c88d Merge "Allow ro. properties to have arbitrary lengths" am: 3851f132d1
am: 9fba6c2fe1

Change-Id: I17743afca87569e5ef6e17572aec0e8e8e535847
2017-10-18 18:48:55 +00:00
Tom Cherry
9fba6c2fe1 Merge "Allow ro. properties to have arbitrary lengths"
am: 3851f132d1

Change-Id: Ie9c340401786d97e469e283418cffef6fbbbb186
2017-10-18 18:39:42 +00:00
Tom Cherry
38a77c4048 Allow ro. properties to have arbitrary lengths
Bug: 23102347
Bug: 34954705
Test: build
Change-Id: I99b074633c60e95cdd2284bf8a708b9187c1e310
2017-10-18 09:25:17 -07:00
Tom Cherry
9a78e64d8f Merge "Frameworks: Remove warning for SystemProperties.get" am: c589496ce9 am: b72c0626f5 am: 16e676be4b
am: 3b01d0a09a

Change-Id: Icdc349598538e7cb2740e0829e797ec02ff0209a
2017-10-17 20:30:18 +00:00
Tom Cherry
3b01d0a09a Merge "Frameworks: Remove warning for SystemProperties.get" am: c589496ce9 am: b72c0626f5
am: 16e676be4b

Change-Id: Ie43c9ec866feba876016c8ceb4c1e5d6222f0a18
2017-10-17 20:04:51 +00:00
Tom Cherry
16e676be4b Merge "Frameworks: Remove warning for SystemProperties.get" am: c589496ce9
am: b72c0626f5

Change-Id: Ib0561d4ce3e027b2021bc6105f0be03ba6fffa99
2017-10-17 19:47:57 +00:00
Tom Cherry
b72c0626f5 Merge "Frameworks: Remove warning for SystemProperties.get"
am: c589496ce9

Change-Id: Ibef1415adec0dac324b0531b7038640c3584fdf1
2017-10-17 19:37:45 +00:00
Tom Cherry
95dd3cef21 Frameworks: Remove warning for SystemProperties.get
We now disallow non-UTF8 property values directly in property_service,
so there is no need for this warning.

This partially reverts 33aea8d40e.

Bug: 63177684
Test: make
Change-Id: I61f49f635c6095013f55b906e00925a8cbd1ea8c
2017-10-17 09:27:23 -07:00
Patrik Torstensson
23a3f240c0 Merge "Incorporate slab reclaimable into meminfo" into oc-mr1-dev am: 20fb01eb23
am: 7528452f57

Change-Id: I46c0b4b07044578fe300aaf587973a650628388b
2017-10-15 02:09:14 +00:00
Pankaj Kanwar
0e0a22e169 Merge "Merge "Cleanup of Cellular/Wifi aggregate statistics" into oc-mr1-dev am: eb98edfb83" into oc-mr1-dev-plus-aosp
am: c623db3d98

Change-Id: I5512c904eb29e2819358299df36f7a1c2c261992
2017-10-15 02:02:47 +00:00