Commit Graph

1059 Commits

Author SHA1 Message Date
Mathew Inwood
4eb56abe8b Add @UnsupportedAppUsage annotations
For packages:
  android.util.proto
  android.util.jar
  android.util.apk
  android.util

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ia0f48c244b0fbe33d40d797702a82303648196ed
2018-08-14 17:24:32 +01:00
TreeHugger Robot
0242372fe5 Merge "Add feature flag for condition manager refactoring" 2018-08-13 20:39:47 +00:00
Fan Zhang
c6834b6e3d Add feature flag for condition manager refactoring
Bug: 112485407
Test: rebuild
Change-Id: I8938166c9af0cdf9e5fcd25589c1787093e6ebd8
2018-08-13 12:12:34 -07: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
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
Mathew Inwood
3bbdabce1f Merge "Code formatting change for upcoming annotations." am: 5d669f79f2 am: 5d44cf6f72 am: 37030d9884
am: 2b55fef6b9

Change-Id: I4110c2cb0273dc3eb617bf10687d4f4781ae98aa
2018-08-01 18:20:55 -07:00
Mathew Inwood
2b55fef6b9 Merge "Code formatting change for upcoming annotations." am: 5d669f79f2 am: 5d44cf6f72
am: 37030d9884

Change-Id: I3526cd00cffc1e4857cfda9bab32b0f1a130d55c
2018-08-01 17:28:24 -07:00
Mathew Inwood
5d44cf6f72 Merge "Code formatting change for upcoming annotations."
am: 5d669f79f2

Change-Id: Iffd38fbc5ee5cd01d5900afbfee331e005b860c6
2018-08-01 16:05:35 -07:00
Laura Davis
c49f34dffc Merge "Docs: fixed typo and made minor edits" into pi-dev am: ae3f656146
am: 30e50fdb5d

Change-Id: I5ec12962b74b998a4a9ced35aa2425e314b8b93e
2018-08-01 11:26:54 -07:00
Laura Davis
30e50fdb5d Merge "Docs: fixed typo and made minor edits" into pi-dev
am: ae3f656146

Change-Id: I730596d6577c8dd50aa00f0f43a236e247dc3953
2018-08-01 11:10:46 -07:00
Mathew Inwood
c092f2317b Code formatting change for upcoming annotations.
Putting /** @hide */ on the same line results in the automated annotation
addition putting the annotation the previous line, which then results in
the @hide javadoc annotation being ignored (since it's now no longer
strictly before the method declaration).

Bug: 110868826
Test: m
Change-Id: I1b5c290a17ead46effd2f2ff3f4b33884efbc116
2018-08-01 13:52:03 +01:00
Laura Davis
e27c3511d8 Docs: fixed typo and made minor edits
Test: make ds-docs

Bug: 111734031
Bug: 111734470
Change-Id: Ic120368fef0c0673ce954cdf0927a4705b3edcd2
2018-07-30 14:56:32 -07:00
Paul Duffin
77ad379195 Merge "Remove dependency on InflaterInputStream.closed field." am: 555fc87b99 am: 6565aae0e9 am: bd1579d975
am: 6526a55fc1

Change-Id: I30de71a4a53f61c20da014b28bef6b088cdee83c
2018-07-24 02:58:05 -07:00
Paul Duffin
6565aae0e9 Merge "Remove dependency on InflaterInputStream.closed field."
am: 555fc87b99

Change-Id: I66687ef9b82fb2071e6fc04726d099bc1b5fab65
2018-07-24 02:27:35 -07:00
Tobias Thierer
97c4d13812 Fix Base64OutputStream swallowing/throwing the wrong exception.
Base64OutputStream.close() first write()s (possibly empty) data
and then close()s the underlying stream. Because of an inverted
condition, exceptions thrown by the underlying stream were handled
incorrectly:

 - if both the underlying write() and close()/flush() throw
   then it would throw the latter exception when it should
   have thrown the former, suppressing the latter.
 - if only the underlying close() throws then that exception
   was swallowed when it should have been closed.

This bug existed ever since this file was first added to
Android in commit 9df2ffd420
in Feb 2010 (before the concept of suppressed exceptions
existed/was supported). The buggy code was proposed in a
review comment on that CL, which was then accepted/integrated
into the CL.

This CL fixes the inverted condition and adds test coverage.
It also adds code to add the suppressed exception (if any).

Bug: 111697617
Test: Confirmed that Base64Test fails (as described above) before
  this CL but passes after this CL, when running these commands:
  make FrameworksCoreTests && \
  adb install -r ${ANDROID_PRODUCT_OUT}/data/app/FrameworksCoreTests/FrameworksCoreTests.apk && \
  adb shell am instrument -w -e class android.util.Base64Test \
    com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

  Specifically, before this CL, the following test failures occur:
  1.) junit.framework.AssertionFailedError
	at junit.framework.Assert.fail(Assert.java:48)
	at junit.framework.Assert.fail(Assert.java:56)
	at android.util.Base64Test.testOutputStream_ioExceptionDuringClose(Base64Test.java:546)
  2.) junit.framework.ComparisonFailure: expected:<[writ]e()> but was:<[clos]e()>
	at junit.framework.Assert.assertEquals(Assert.java:85)
	at junit.framework.Assert.assertEquals(Assert.java:91)
	at android.util.Base64Test.testOutputStream_ioExceptionDuringCloseAndWrite(Base64Test.java:574)

Change-Id: If7fd7c4615ca004638d7c5d8f1869e7eddb16f33
2018-07-23 17:30:59 +01:00
Paul Duffin
96a1368158 Remove dependency on InflaterInputStream.closed field.
In upstream OpenJDK the InflaterInputStream.closed field is private.
During integration of OpenJDK into Android it was changed to be
protected so that it could be used by StrictJarFile, and in the process
was accidentally made part of the public API. This change removes the
StrictJarFile dependency on that field.

Bug: 111061052
Test: checkbuild, flash and run FrameworkCoreTests
Change-Id: I8aee1c444cf27e7078b848c65e0433c831ab06a0
2018-07-23 15:55:33 +01:00
Tobias Thierer
6cbe154c9d Merge "Use StrictJarManifest.ATTRIBUTE_NAME_NAME instead of Attributes.Name.NAME." am: 2dc5a42743 am: 597eb7f87e am: d05cdbcccd
am: c9923e3e91

Change-Id: I249f6ab4b2cc94c9598a71249c1a746060ac283c
2018-07-20 10:44:41 -07:00
Tobias Thierer
597eb7f87e Merge "Use StrictJarManifest.ATTRIBUTE_NAME_NAME instead of Attributes.Name.NAME."
am: 2dc5a42743

Change-Id: I5a61fe6e4b9507a754f8977225bc4dbbee88a4ff
2018-07-20 10:11:27 -07:00
Treehugger Robot
2dc5a42743 Merge "Use StrictJarManifest.ATTRIBUTE_NAME_NAME instead of Attributes.Name.NAME." 2018-07-20 15:50:59 +00:00
Tobias Thierer
8a0845e517 Use StrictJarManifest.ATTRIBUTE_NAME_NAME instead of Attributes.Name.NAME.
Introduce a constant StrictJarManifest.ATTRIBUTE_NAME_NAME so that
callers (StrictJarManifest{,Reader}) don't need to rely on
Attributes.Name.NAME which was added via an Android patch.

Bug: 35910877
Test: Treehugger

Change-Id: I292fbefc6c5561609dcd8281d1e2a931a1ffa5b2
2018-07-13 17:29:35 +01:00
Lucas Dupin
401ea1647a Merge "Dark Notification Shade" 2018-07-13 02:09:31 +00:00
Lucas Dupin
f03e752407 Dark Notification Shade
Test: adb shell service call uimode 4 i32 1 # day
Test: adb shell service call uimode 4 i32 2 # night
Bug: 110758454
Change-Id: Ib6fce91d1aeff7e1fbfe8a7a528095487fbdb3f8
2018-07-12 17:30:34 -07:00
Neil Fuller
7add22db60 Merge "Move XML object factory logic to libcore"
am: 8176fb99e1

Change-Id: Ib0940ecb89eaf11841bbd66cdaf1c5379466496c
2018-07-12 11:26:03 -07:00
TreeHugger Robot
f8585dcb50 Merge "Move XML object factory logic to libcore" 2018-07-12 11:20:37 +00:00
Neil Fuller
f4634736ca Move XML object factory logic to libcore
It makes sense to hide the details of the parser implementation
(and other similar objects) in libcore so it could be changed.

This change removes the "ExpatPerformanceTest" which appears not to have
been maintained and was comparing KxmlParser with itself. It is assumed
that android.util.Xml used to return the expat parser.

Test: build
Bug: 111055375
Merged-In: Ibad247323ba90cd949aecb2bd92f2f73306a4327
Change-Id: Ibad247323ba90cd949aecb2bd92f2f73306a4327
2018-07-11 14:02:00 +01:00
Neil Fuller
2f5a6895c5 Move XML object factory logic to libcore
It makes sense to hide the details of the parser implementation
(and other similar objects) in libcore so it could be changed.

This change removes the "ExpatPerformanceTest" which appears not to have
been maintained and was comparing KxmlParser with itself. It is assumed
that android.util.Xml used to return the expat parser.

Test: build
Bug: 111055375
Change-Id: Ibad247323ba90cd949aecb2bd92f2f73306a4327
2018-07-11 13:50:42 +01:00
Neil Fuller
3147288c3b resolve merge conflicts of 7980b19bc8 to stage-aosp-master
BUG: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ica0d3578c6e3fcd17b350f63b4acd471774ac014
2018-07-06 16:32:44 +01:00
Treehugger Robot
7980b19bc8 Merge "Track changes in libcore to remove a constructor" 2018-07-06 13:58:29 +00:00
Neil Fuller
33e7250f1f Merge "Track changes in libcore to remove a constructor" 2018-07-05 10:27:40 +00:00
Neil Fuller
baae7fa357 Track changes in libcore to remove a constructor
Track changes in libcore to remove a constructor + lint
import order changes. Instead of the constructor a utility
method is introduced.

Test: Build / boot
Bug: 111055375
Merged-In: Id683a9d9d6e27d4c8df623dae189da9e74a6d410
Change-Id: Id683a9d9d6e27d4c8df623dae189da9e74a6d410
2018-07-04 09:11:08 +01:00
Neil Fuller
8a1683f0a2 Track changes in libcore to remove a constructor
Track changes in libcore to remove a constructor + lint
import order changes. Instead of the constructor a utility
method is introduced.

Test: Build / boot
Bug: 111055375
Change-Id: Id683a9d9d6e27d4c8df623dae189da9e74a6d410
2018-07-04 09:10:55 +01: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
04c66489bc Merge "Make Half class use public APIs"
am: 7e957e57b7

Change-Id: I7f41f07ed5d35a0c538c90b49b4500ba9952f74d
2018-07-03 13:08:26 -07: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
Stanley Tng
fe8c8337ed Add Feature Flag for Hearing Aid Profile
Using the Settings App-Developer Options-Feature Flag, allow the user to
enable or disable the Hearing Aid Profile.

Test: Manual testing using Settings App
Change-Id: I58a9d339941e235242c443c85b6f4194b5a296c9
2018-06-28 15:31:50 -07: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
325ecf7df4 Merge "Add more behavior to TimeDetectorService"
am: b1fc5a4c7e

Change-Id: Ibbda2d253bf807cc480a4218aa1d898d6737ec7b
2018-06-26 05:14:31 -07: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
Raff Tsai
c753a9ce77 Add feature flag for dynamic home page development.
Test: rebuild

Change-Id: Ifddd500b008725e01746e3ed82548bd8bc0472e9
2018-06-20 13:48:03 +08:00
Neil Fuller
292b08ff87 Merge "Add TimestampedValue.toString()" am: bfa58946f7 am: 494665870f
am: 252382bede

Change-Id: If79479053e5139da52be2c004203077537613d40
2018-06-14 02:59:40 -07:00
Neil Fuller
494665870f Merge "Add TimestampedValue.toString()"
am: bfa58946f7

Change-Id: I38760ef47ba04f20882a467857e7c57c088d4391
2018-06-14 02:40:17 -07:00
Neil Fuller
ca97b34330 Add TimestampedValue.toString()
To make debug logging useful.

Bug: 78217059
Test: Build
Change-Id: I710b56d189afeb26ac50f55d9286d04219779ee7
2018-06-13 15:29:05 +01: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
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
Fan Zhang
a4b77ef1ee Remove flag for data usage v2.
Change-Id: I83c68eb8b2c44eb5925f31065d4897a9823cedd6
Fixes: 109943959
Test: rebuild
2018-06-11 10:00:43 -07:00
Tor Norbye
b749bdb5ff Add typedef for the Log level
This CL adds an @IntDef specifying the valid constants
that can be supplied as the Log level.

It also removes a documentation reference to a (former?) level
named "SUPPRESS" which doesn't exist.

Test: In lint
Change-Id: I159d687a5c16be76afcd7a3370a5f02025a1aff7
2018-06-05 08:15:40 -07:00
Jake Wharton
d4a238971d Annotate Log reference parameters and return types.
Bug: 78245676
Test: atest LogNullabilityTest
Change-Id: Icbb26d23ed89e1fabd019108d4484902468c165e
2018-06-04 21:33:52 -04:00