Commit Graph

34 Commits

Author SHA1 Message Date
Jeff Sharkey
30e06bb668 Even more auto-doc work.
Update docs based on what new lint detector found.  Add new @IntDef
to parameters or methods returning constants or flags, and add
@RequiresPermission to methods mentioning permissions.

Test: make -j32 offline-sdk-docs
Bug: 37526420
Change-Id: I7f640f7883fcb66b911a52ae93b83f77306571ec
2017-04-24 13:20:46 -06:00
Jeff Sharkey
910e081216 More auto-doc work.
Add support for AnyThread, CallSuper, and UiThread.

Another related CL started documenting @RequiresPermission, so remove
duplicated information in existing APIs.

Suppress auto-doc on a handful of classes that are already
well-documented.

Test: make -j32 offline-sdk-docs
Bug: 37526420
Change-Id: I791437dccec0f11d5349a23b982ba098cb551af8
2017-04-21 16:35:08 -06:00
Jeff Sharkey
6503bd8e33 Auto-generate docs based on annotations.
We have a handful of annotations that we've been sprinkling across
the platform APIs, such as @Nullable, @NonNull, @IntDef, etc.  It
would be really helpful to surface these contracts to developers
through the SDK docs.

This change allows annotations like those mentioned above to declare
the following new javadoc fields:

@memberDoc: docs to append to a field or method definition.
@paramDoc: docs to append to a @param definition.
@returnDoc: docs to append to a @return definition.

This change also builds a docstring to describe the list of all
constants listed in an @IntDef annotation.  Sadly AnnotationDesc
only passes along raw constant values, so we need the help of the
new "prefix" annotation argument to help find the field names.

Test: builds
Bug: 37526420
Change-Id: I4cfc00dd904e5dfa945b406d546e36846b7c0c28
2017-04-20 17:21:41 -06:00
Jeff Sharkey
32ee8eefd7 Create new BroadcastBehavior annotation.
This will be used to help document the expected behavior of various
broadcast actions defined by the OS.

Also add logic to PackageParser that will then yell at developers
whose manifests are making bad assumptions about which broadcasts
they'll receive.

Test: builds, boots
Bug: 35925551
Change-Id: I059c2bf8aa3ce53d9ff18dcc263db7620cd14bd6
2017-03-08 20:19:31 -07:00
Romain Guy
95b52fd187 Make Half look like and behave like a boxed instance
Bug: 35765416
Test: HalfTest
Change-Id: I7ef52428f8b4e2c05b91d7eb37cc4cb5ecc5c6b9
2017-02-26 09:37:52 -08:00
Clara Bayarri
ed00bfdfae Implement .xml font resource support
This change implements the loading and parsing
of xml type font resources, and makes sure it is
used properly by TextView styles.

Test: run cts -m CtsContentTestCases -t android.content.res.cts.ResourcesTest
run cts -m CtsWidgetTestCases -t android.widget.cts.TextViewTest#testFontResources*

Change-Id: I5a2930b3ba7dad67d9607e9036a5dde6bab0c5a4
2017-01-27 20:16:48 +00:00
Romain Guy
68bd5fdd1a Introduce android.graphics.ColorSpace
This class can be used to define color spaces. A color space has a color model
and a profile connection space (CIE XYZ D50). This implementation can be used
to query various properties of RGB color spaces or perform conversions between
various color spaces (RGB, XYZ and Lab).

Refer to the documentation for more details.

Test: cts-tradefed run singleCommand cts-dev --module CtsGraphicsTestCases --test android.graphics.cts.ColorSpaceTest
Bug: 32984164
Change-Id: Ie2117c1212c1375a7d403d3c1afaf73d7c2e0b47
2016-11-23 18:10:04 -08:00
Romain Guy
5d7e2352e7 Add @HalfFloat annotation for fp16 data types stored in shorts
This CL has a companion CL to add the @HalfFloat annotation to the
support library.

Test: cts-tradefed run singleCommand cts-dev --module CtsUtilTestCases --test android.util.cts.HalfTest
Bug: 29940137
Change-Id: I4e1dc456687c1c026437150e9cc94a54f3264d4e
2016-11-14 09:27:26 -08:00
Tor Norbye
17dd669fc3 Add @AnyThread, @Dimension and @Px
These are already present in the support library.

Change-Id: I1d049370266685ea993fb53108fd7aea96ea71d0
2016-06-28 12:42:37 -07:00
Tor Norbye
a05b650098 Fix @IntDef annotation javadoc
Change-Id: I1a4fc4a1a731fc8732279950dcd8416ab125aed3
2016-01-12 21:33:58 -08:00
Jeff Sharkey
8588bc1ef1 Add flags to requests for package UID/GIDs.
This gives callers the ability to request details for missing
packages.  Also add annotations for userId and appId variables and
start tagging their usage.

Change-Id: I63d5d7f870ac4b7ebae501e0ba4f40e08b14f3f6
2016-01-07 10:33:26 -07:00
Neil Fuller
71fbb81b14 Fix @code escapes
The body of {@code} must not be HTML escaped. This is one of
several changes that fix the source in conjunction with a
doclava fix.

Bug: 25757239
Change-Id: Ib38a0fa2dd2a3d68e467f78a812071e763d7e881
2015-12-02 14:24:11 +00:00
Michael Wright
b2b2c0e7d0 Add new TestApi annotation.
This allows us to build a special jar with methods exposed strictly
for CTS. An @TestApi should not be a public API or a system
API.

Bug: 25608286

Change-Id: Ifbc64bb6958d2deec5b9cf0b944acfd068f0f051
2015-11-25 13:01:03 +00:00
Tor Norbye
dce982733e Merge "b/22228577: Improve @IntDef annotation to handle special values and ranges" 2015-08-03 13:46:06 +00:00
Tor Norbye
8cf2c902c5 b/22228577: Improve @IntDef annotation to handle special values and ranges
(Will be used to for example solve
181789: Incorrect/inconsistent lint + documentation for Snackbar
)

Change-Id: I843a9286b6af6e14640391e6f0261c398d6963fa
2015-07-31 16:42:41 -07:00
Tor Norbye
5fffc1688b Allow @RequiresPermission to be specified on parameters
This allows you to express that the permission requirement
on a method depends on a given parameter; static analysis
tools should then trace the supplied value backwards to
see whether it points to a constant which in turn has been
annotated with @RequiresPermission.

Change-Id: Ifaf3c2517a2c416b00409d646d6ec881c6b7af18
2015-07-05 15:48:27 -07:00
Tor Norbye
63fc151475 Merge "Add @RequiresPermission" 2015-04-23 18:36:33 +00:00
Tor Norbye
f8b833605e Add threading annotations
These describe threading requirements for a given method,
or threading promises made to a callback.

Change-Id: If496067b12df3a0adedc32e4b4005cd1c2d400f3
2015-04-20 15:59:17 -07:00
Tor Norbye
8f506ed28c Add @RequiresPermission
Change-Id: I70f3ce003154069654df10080edea2b85ffaab6b
2015-04-20 15:45:00 -07:00
Tor Norbye
bc2dd79af9 Add @TransitionRes for transition resource integers
Change-Id: I37f523282156c2f87c4d961167d6a980d5f6e34c
2015-03-13 11:19:21 -07:00
Tor Norbye
5b00941a6f Fix @ColorInt javadoc
Change-Id: Icea3a3b4013b4a6b5f9809eec082ea93bc26b079
2015-03-10 19:14:03 -07:00
Tor Norbye
80756e3888 Annotate ARGB integer parameters with @ColorInt
Change-Id: I307f72a382272cf18ddb6b07d9fcb81228568d9a
2015-03-05 16:34:12 -08:00
Tor Norbye
cb59f2afb7 Additional annotations: @CallSuper, @Keep, etc.
These mirror the new support library annotations, but
with source retention.

Change-Id: Ib85ceeb37d596aae8cf12d4f8fede3982552d033
2015-03-05 16:34:11 -08:00
Jeff Brown
d5a5b5a547 Rename PrivateApi annotation to SystemApi.
Change-Id: I97b473884f81ad375d0733e4766afe091dfdd854
2014-06-06 15:16:27 -07:00
Tor Norbye
9940de968e Add resource reference annotations
These annotations allow you to annotate an int parameter or return
value to indicate that the int should correspond to a resource
constant (such a R.string.app_name).

Change-Id: I3a0b2ef0b943bdf9d5a2e1f978ccf3445eed829a
2014-03-27 13:07:00 -07:00
Gabriel Peal
f1e1e77143 resolved conflicts for merge of 74fb97de to master
Change-Id: If28dc21a2ea7e634da130f3c59c17cd63dd5336a
2014-03-25 11:08:19 -07:00
Tor Norbye
bbc75f34e6 Hide NonNull and Nullable.
These should not be used in app code; instead, we will add
class-file retention versions of these to the support
library.

Change-Id: I13275bd28529f5da04d923688655be35c77dbb1c
2013-12-17 08:44:38 -08:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Tor Norbye
831c5df603 Add @NotNull, @Nullable, and @IntDef/@StringDef annotations
This changeset adds some annotations for recording whether a
method return value or method parameter can be null (@Nullable),
can never be null (@NotNull), or must be an integer enum or flag
using one of the given constants.

Change-Id: Ic932592ea3bac781c1df364447c57042461333c5
2013-08-15 13:19:25 -07:00
Xavier Ducrohet
d2726ba47e Add tools specific annotations to the API.
Those annotations are not runtime retention and have zero impact
on the device builds.

Change-Id: I18d905fccfe18eb621e1411d7ae7ba97910cc727
2012-01-31 15:56:40 -08:00
Xavier Ducrohet
3274b9b7da Add Annotation for optional features.
This is used by the SDK to display available features in the
editors.

Change-Id: I10073d503d1b3dcb92a5dc526cd054285b85fa3a
2009-12-14 17:52:20 -08:00
The Android Open Source Project
9066cfe988 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d83a98f4ce auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
54b6cfa9a9 Initial Contribution 2008-10-21 07:00:00 -07:00