166 Commits

Author SHA1 Message Date
Nathan Harold
493223bdf1 Remove getNeighboringCell API
Remove the obsolete getNeighboringCell API for callers
targeting Q or higher SDK. This API was fully
superceded by getAllCellInfo in KitKat, and
maintaining it results in battery drain because calls
to this API resulted in unrestricted modem calls.

For legacy support, this API now routes to the newer
CellInfo mechanism, which stems the battery drain but
further emphasizes the redundancy. Thus, removing this
is the best possible outcome for maintainers, users and
OEMs.

Bug: 62490173
Test: compilation; atest CtsPermissionTestCasesSdk28
Change-Id: I8aa806bfcad2ceefc9dfbff58c0ce48d5a3cab5b
2018-09-20 10:11:11 -07:00
Lorenzo Colitti
19c0ccaa8c Actually @hide unwanted capability methods.
Bug: 77601789
Test: builds, boots
Test: make doc-comment-check-docs
Change-Id: I7a913b83ab5110047d187564b3a1b0bbe1631942
2018-04-24 13:12:56 +09:00
Jeff Sharkey
3990ee1c9f Clean up APIs before declaring API 28.
As part of finalizing an SDK, we need to ensure that no new APIs are
marked @Deprecated, since they're typically cleanup that someone
forgot to finish.

Someone forgot to replace Slice.getTimestamp() with Slice.getLong().

Bug: 77588754
Test: builds, boots
Exempt-From-Owner-Approval: SDK finalization
Change-Id: Ic0ec91a43d161a69c1e840c42046ad500b7aeca0
2018-04-11 13:49:21 -06:00
Lorenzo Colitti
4c6f4a65b6 Remove unwanted capability code per API council feedback.
The addition of hasUnwantedCapability was late in the release
cycle and does not simplify the API enough to be worth it. The
recommendation is, in a future release, to do something more
complete: not just add something like addUnwantedCapability, but
also deprecate all the NET_CAPABILITY_NOT_xxx constants and add
opposite NET_CAPABILITY_xxx constants for use with it.

Fix: 77601789
Test: builds, boots
Test: atest android.net.cts.NetworkRequestTest
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: Ib98fb01da4a4a0bae464787b589ad88f45002eb8
2018-04-06 23:02:51 +09:00
TreeHugger Robot
d2c218f78a Merge "Rename set/get-ConserveMemory" into pi-dev 2018-04-05 20:44:58 +00:00
Leon Scroggins III
ac959199e5 Rename set/get-ConserveMemory
Bug: 76448408
Test: Ie83dbdeab5cc3dcd6bd56dd874412ed67eb52c02
Change-Id: I714b159bb70a48e5644801cc7fef8e32ee93896a
2018-04-04 19:58:30 -04:00
Derek Sollenberger
2d4f01ba7f Restore saveLayer APIs back into the public API.
The saveLayer APIs are restored from @removed but will treat input
as ALL_SAVE_FLAGS and generate exceptions on newer API levels.

We internally used these calls in one situation that now use a
different @hide API to support the previous behavior until we
refactor that code.

Partial revert of "Remove deprecated android.graphics.Canvas APIs"
This reverts commit 7b837616ae88cbdaf12600cee23b5188e5531937.

Bug: 77276963
Bug: 73777445
Test: CtsGraphicsTestCases
Change-Id: I7acd4ffd5ac41a58d2be8b48cf50119c2b896708
2018-03-30 14:40:04 -04:00
Leon Scroggins III
d62f27250a Rename getters and setters on ImageDecoder
Bug: 76448408
Test: Ib8782ff10072c81a5ed2a1031a70475fffee7ccf

- Use "is" prefix for booleans instead of "get"
- Reverse "require" and "unpremultiplied" for a more natural sound
- Add "Required" to "Mutable" methods
- Add "Enabled" to "DecodeAsAlphaMask" methods

Change-Id: I644ddccd37898d89609e4534ece4ea70f74587c4
2018-03-29 15:35:30 -04:00
Leon Scroggins III
64481195e1 Rename ImageDecoder.setResize
Bug: 76448408
Bug: 73537624
Test: Ib40d65c68a6c709b6456f2145ad8a5557a941494

setResize is two verbs, and "resize" implies we're changing the size of
an existing object. In truth, the method specifies the desired size. So
rename setResize(int, int) to setTargetSize, which clearly specifies the
behavior.

Rename setResize(int sampleSize) to setSampleSize.

Hide getSampledSize, which looks too similar to the newly named
setSampleSize. In addition, b/76448408 suggests hiding it. It isn't
really necessary anyway, since a client can just call setSampleSize - no
need to query and call setTargetSize manually.

Since there is no way for a client to know that a RAW image couldn't be
decoded to the desired size (could previously be done with
getSampledSize), make setSampleSize do the extra scaling. This is a
better API anyway.

Change-Id: I84c29fdc6bdfb999a7f712fdc069304ae9676ba6
2018-03-28 11:24:12 -04:00
TreeHugger Robot
812e87ecba Merge "Remove deprecated android.graphics.Canvas APIs" into pi-dev 2018-03-27 18:00:29 +00:00
TreeHugger Robot
a9975804a2 Merge "API council requested tweaks to JobInfo." into pi-dev 2018-03-27 16:25:23 +00:00
Jeff Sharkey
8474ca0246 API council requested tweaks to JobInfo.
Split network estimates into separate download/upload values, and
add missing accessor methods.

Test: none
Bug: 74945408, 74032541, 74032817
Change-Id: I4c92b8a867690dc4f048701f13142655c3370958
2018-03-27 08:41:42 -06:00
Derek Sollenberger
7b837616ae Remove deprecated android.graphics.Canvas APIs
Bug: 73777445
Test: compile
Change-Id: Ie68f2fbe3c3be82f3c20529d535875d4cc204b7c
2018-03-27 14:36:50 +00:00
Jeff Sharkey
121d565b65 API council requested tweaks to TrafficStats.
Test: atest android.appsecurity.cts.AppSecurityTests#testAppFailAccessPrivateData
Bug: 71584606
Change-Id: I4be8a47d54a04f17cbaac735d543ff7d6370376d
2018-03-26 13:12:39 -06:00
Leon Scroggins III
cf7294fda6 Rename ImageDecoder.ERRORs
Bug: 73788969
Test: I501e8b76aacd785cb994165ab01dc1b39fea3a1c

Move them into ImageDecoder.DecodeException, which is where they are
actually used. This also provides some more context, so that the prefix
"ERROR_" is no longer necessary, fixing the redundancy/awkwardness in
ERROR_SOURCE_ERROR. Further rename that to SOURCE_MALFORMED_DATA, which
is more descriptive, and does not imply a Java Error.

Change-Id: Ied17ad343650f9c33d9a35b0f9d00ccc22264bd6
2018-03-22 13:09:02 -04:00
Leon Scroggins III
1d2bf2b846 Re-write onPartialImage API
Bug: 73788969
Test: If9e27a6ce2604128a619bc4843d62711f94b4d87

Add a new Exception subclass that contains information about the type of
error, and the original Exception, if any. Remove the old
IncompleteException class. If the decode creates a partial image, pass
the information up to Java, where we create the new Exception and pass
it to the callback and/or throw it. Rewrite nDecodeBitmap to always take
the ImageDecoder as a parameter for this callback, and simply use a
boolean to determine whether to call onPostProcess

Check for exceptions in some overlooked cases in native code, and
route to the new type.

Remove FIXME to avoid parsing the whole image. In my limited testing,
it didn't seem to speed anything up, and this should be called in a
background thread anyway. Parsing now also ensures that we've read the
stream when we can have a chance to handle the exception from the right
place.

Remove fixme for b/70626068, which has been marked as WontFix.

Add a TestApi for testing an Exception thrown by an InputStream.

Remove onPartialImage from hiddenapi-light-greylist.txt to fix the build
error this change introduces. onPartialImage was erroneously added to
the list.

Change-Id: I12f69857328e63c993bd669412b06addeb6a74f1
2018-03-21 12:55:46 -04:00
Leon Scroggins III
746a9fee93 ImageDecoder: Add getters. Rename setAsAlphaMask
Bug: 73788928
Test: I1606cbb4e71579160ffaef12c1ed738fad882cd1

This will allow Kotlin developers to treat the setters as properties.

Part of the motivation for the rename is that "getAsAlphaMask" sounds
like it returns an alpha mask itself. Rename both to
_etDecodeAsAlphaMask.

Change-Id: I8f9b04f8381840490b662c3bcd37a95442af8110
2018-03-08 14:22:56 -05:00
Leon Scroggins III
6de55b88f7 AID: Change loop to repeat and set from xml
Bug: 73529437
Test: I60fbee6d3610070413e8c46f363ec3c19c2e7c52

Allow setting AnimatedImageDrawable's loop count in xml. Use
"repeatCount" to match the existing attr used by other objects, and
change the Java api from "loop" to "repeat".

Cache the repeat count in the State object for the situation where we
inflate but are waiting on a theme, so that when we get a src we can
apply the existing repeat count.

Change-Id: Ie723fe9a40c64dd0e1e8fd7b5d5cf81e5c5ccd0d
2018-03-02 16:11:37 -05:00
Kurt Nelson
72534b7e22 Flip order of arguments
Callbacks as the second parameter is more Kotlin friendly.

Bug: 73751206
Test: cts-tradefed run commandAndExit cts-dev --module CtsOsTestCases --test android.os.cts.StrictModeTest
Change-Id: Ib9c9469be1b81dc65e74c9e303f474c54a43b18b
2018-02-23 15:12:59 -08:00
Jeff Sharkey
9911a28adb Better handling of NTP-based clocks.
Now that we have a nice Clock abstraction, we can use it to represent
a clock backed by an NTP fix.  (This makes testing logic much easier
to write.)

We now rely completely on NetworkTimeUpdateService to keep our NTP
fix up to date, instead of trying to refresh in the middle of
critical paths which could trigger random ANRs.

Add internal FallbackClock to make it easier to handle missing NTP
fixes.  Add internal SimpleClock to let implementers focus on single
millis() method.

Test: bit FrameworksNetTests:com.android.server.net.NetworkStatsServiceTest
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 69714690, 72320957
Change-Id: Ic32cdcbe093d08b73b0e4b23d6910b23ea8e1968
Exempt-From-Owner-Approval: approved in previous PS
2018-02-16 22:11:35 +00:00
Tony Mak
7699a19d2b Remove @removed trySetQuietModeEnabled
Context:
Updated the API according to API council feedback. Marked it as
@Removed and keep it for a while for Launcher. But now Launcher
prebuilt is updated, we are safe to remove it.

Test: Build

BUG: 71818127

Change-Id: I33fec12addf7031bfbcd86bce9e636c31d0ea4d3
2018-01-26 16:13:44 +00:00
Tony Mak
bece85dd0e Rename trySetQuietModeEnabled to requestQuietModeEnabled as per ...
the feedback from API council

trySetQuietModeEnabled will be kept for a while until next
Launcher prebuilt is dropped.

FIXES: 71818127

Test: Build

Change-Id: I3d4fd64862c7d924b8da630522a30a3899676b4b
2018-01-12 22:25:32 +00:00
Paul Duffin
9f6282d0ab Remove android.test.mock classes from android.jar
This removes all android.test.mock from the main android.jar.

This change is being done now rather than wait until they can all be
removed together because the code base is a moving target. Doing this
change minimizes the window during which other developers could either
revert the previous changes that make this possible or add new code that
relies on the android.test.mock classes being in android.jar and so
would require yet more changes.

Bug: 30188076
Test: make checkbuild
Change-Id: I3d31e4528c99e2e297aaec9c4b657bdd305bd464
2017-12-21 10:58:35 +00:00
Phil Weaver
75dce7c374 Make accessibility anchor id a long
The anchors are, in practice, always Views, but they may end up
being virtual views in the future, so we should have this done
right.

Also cleaning up picture in picture mode. I don't know why I made
it a separate boolean when I already had the boolean properties.

Bug: 70730136
Test: A11y unit tests and CTS
Change-Id: I916ec066dff12fab8b586371452b728af6be1271
2017-12-15 17:48:33 -08:00
Jeff Sharkey
c204c223a7 Deeper sanity checking of emitted types.
When emitting a method or field, verify that we're able to reference
all mentioned types.  This ensures that we don't accidentally
reference undefined classes/interfaces.

Test: manual inspection of API files
Bug: 69791141
Change-Id: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
2017-11-27 17:07:40 -07:00
Jeff Sharkey
b8b579e1b8 Emit all APIs using Predicates.
Generate APIs using updated doclava.

Test: manual inspection of API text files
Bug: 69505783
Change-Id: I2efd22998a64ebb57588b073c4a591242f4aef91
2017-11-22 12:34:08 -07:00
Alex Klyubin
fff7295026 Delete android.net.PskKeyManager
android.net.PskKeyManager was @remove'd in Android O (API Level 26)
which means it may still be available on Android O platform, but is
not part of its public API. This commit deletes this class from
future platform versions.

The reasoning for the removal of this class is that:
1. it is incompatible with TLS 1.3, and
2. TLS-PSK cannot be exposed as a standalone primitive in a safe by
   default way. There is no way for such primitive to ensure that
   it is used with a shared secret which is not hard-coded into the
   app or is otherwise publicly known.

Test: make
Test: Run a test app which uses PskKeyManager -- the app crashes
      because the class is not found
Bug: 34722996
Change-Id: I5f9a1a1784004b1387ef756eadf8fa06796c96bc
2017-08-18 14:58:06 -07:00
Jeff Sharkey
f52db085e2 Fix handling of @removed APIs.
The @removed docs tag means that a particular API should be considered
as removed from the API surface area that it otherwise would have been
exposed through.

This set of CLs is fixing a bug where we @removed had been treated as
always removing from the public API.

Bug: 62341924
Test: make -j32 update-api
Change-Id: I336b2df4804e947a0b93a12269d6e7c5594eef7e
2017-08-09 09:18:20 -06:00
Rebecca Silberstein
e6edaa9ea1 WifiManager: deprecate and remove setWifiApEnabled
Officially deprecate and remove the setWifiApEnabled call.

Bug: 38436773
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh
Test: cts-tradefed run cts-dev --mo CtsNetTestCases -t android.net.wifi.cts.WifiManagerTest
Change-Id: Ifefe0b186d074b49ab1cc94e1c166117f3d7bdf7
2017-07-17 18:46:27 +00:00
Jeff Sharkey
4233f032fd Test if allocation supported; @removed clean up.
SM.allocateBytes() doesn't offer a clear way to detect if a failed
request could ever succeed.  (For example, we can never work with
pipes, or files on an unsupported storage device.)  So give
developers a first-class API to test if allocation is supported.

If the underlying filesystem doesn't support fallocate(), fall back
to ftruncate() instead of failing completely.

Clean up @removed APIs that were refactoring during API 26 review
process.

Remove support for storing downloads on the /cache partition, which
doesn't exist on many devices.

Bug: 63057877
Test: bit DownloadProviderTests:*
Test: bit DocumentsUITests:com.android.documentsui.services.CopyJobTest
Test: bit DocumentsUITests:com.android.documentsui.services.MoveJobTest
Change-Id: I85d42a1a7240034b4f2a6f359011ac182bdce36e
2017-07-15 21:08:56 -06:00
Julia Reynolds
7ca33079fd Hide some systemapi methods
Test: make
Change-Id: I0234ca06f68f0a25e1923e171cb6ef19d848aecd
Fixes: 62342239
Fixes: 62264035
2017-07-05 09:17:49 -04:00
Tony Mak
8c6969b69b Remove the old version of setAffiliationIds
Test: Can build

Build: 37622682

Change-Id: I07e630e96f5aed5d450652c465e00ffed13a2a2c
2017-05-17 15:20:04 +00:00
TreeHugger Robot
b2bd32929b Merge "Remove deprecated recommendation request code." into oc-dev 2017-05-16 18:44:28 +00:00
Jeremy Joslin
9407a9490b Remove deprecated recommendation request code.
Removed all deprecated code related to network recommendation
requests.

Test: adb shell am instrument -e class android.net.NetworkRecommendationProviderTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t com.google.android.gts.netrec.NetRecHostTest
Bug: 37357264
Change-Id: I81bb6ff6236b249b8e14058c1bfdb938451a75b0
2017-05-11 15:43:57 +00:00
Kenny Guy
653c32432d Cleanup API that is already @removed
EVICT_CE_KEY was @removed before API freeze
now removing it entirely.

Bug: 37663081
Test: compiles
Change-Id: I9ab318196cfe2da601be65b26a3b579f2f4bad82
2017-05-11 12:44:23 +01:00
Winson Chung
ca754789c1 Restoring old methods for compatibility.
Bug: 37637423
Test: Build and test PIP apps
Change-Id: I9ccb49a3e42de55a249ab54bde2f3c5a1c179c1c
2017-05-02 15:18:23 -07:00
Jeff Sharkey
0a5b14309a Merge "Video badging levels: @Deprecate and @remove" into oc-dev 2017-05-02 00:44:51 +00:00
TreeHugger Robot
0d6c3a691e Merge "Rename to follow API council guidance." into oc-dev 2017-05-01 23:15:59 +00:00
Joe LaPenna
2c60ef0fae Video badging levels: @Deprecate and @remove
Video based badging is not going out in O. Hide video-terminology
constants.

Bug: 37687077
Test: make update-api;
Change-Id: Ibd3a732be11bcd0f6b1077943a34b77f7c971ee3
2017-05-01 15:38:17 -07:00
TreeHugger Robot
9be76f0129 Merge "Marking deprecated recommendation request code as @removed." into oc-dev 2017-05-01 22:05:29 +00:00
Jeff Sharkey
f29d19610d Rename to follow API council guidance.
Test: builds, boots
Bug: 37422404
Change-Id: Idcec897e775f2613805a86209615e389b63bd78d
2017-05-01 15:09:46 -06:00
Jeremy Joslin
2caddc5ef4 Marking deprecated recommendation request code as @removed.
Test: adb shell am instrument -e class android.net.NetworkRecommendationProviderTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: Built & ran
Bug: 37357264
Change-Id: I6d55fbad87b11c99e7ddac07cfaa82efeee33187
2017-05-01 10:42:32 -07:00
Jeff Sharkey
000ce80505 Updates based on API council guidance.
Test: builds, boots
Change-Id: I223faf55c1e1b4d81d11b4c8b2d93ccd131c969b
Fixes: 37775662
Fixes: 37748635
Fixes: 37673408
Fixes: 37672564
Fixes: 37672218
Fixes: 37638323
Fixes: 37637423
2017-04-29 13:14:17 -06:00
TreeHugger Robot
060f0f0341 Merge "A11y changes for API council" into oc-dev 2017-04-29 15:54:27 +00:00
Phil Weaver
be2922ff34 A11y changes for API council
Bug: 37749679
Bug: 37747749
Bug: 37737948
Bug: 37718183
Bug: 37720667
Bug: 37724600
Bug: 37708057

Test: Updating unit and cts tests, which still pass.
Change-Id: If28bdf985c4314e8e84dcd6510f406dd4e80dd38
2017-04-28 14:58:35 -07:00
Jeff Sharkey
5b26dac2c3 Merge "Change ClipData.addItem signature" into oc-dev 2017-04-28 17:53:14 +00:00
Andrew Scull
2c20a0f885 Merge "Expand abbreviation in constant identifier." into oc-dev 2017-04-28 17:42:00 +00:00
TreeHugger Robot
77cc43e0d2 Merge "Respond to API council feedback." into oc-dev 2017-04-28 17:10:16 +00:00
Andrew Scull
17e1b5da53 Expand abbreviation in constant identifier.
The abbreviation is not in common use. Also remove FBE from
documentation as it also isn't used elsewhere.

Test: Build success
Bug: 37621349
Change-Id: Icf19be5e96e71dcd45aa7cac8f58b05b6d77d02b
2017-04-28 11:49:50 +01:00
Vladislav Kaznacheev
c35c02f1ea Change ClipData.addItem signature
Make ContentResolver the first parameter.

Bug: 37419379
Test: android.content.cts.ClipboardManagerTest
Change-Id: I3f7772e8ddc93eec0e930b62c722a145f9e6f0fa
2017-04-27 15:29:11 -07:00