This change add demo for using test mode flag lib in
self-instrumentation tests.
There are two options.
The option 1 is to create two versions, prod and test, of the library
using flags. The prod version library uses prod flag lib, and the test
version library uses test flag lib.
The option 2 is to dynamically link to the flag lib in the library. The
flag lib is used as a stub lib and is just used for building purpose.
The in the finally binary which uses the library, the binary should
statically link to the right version of the flag lib.
Bug: 295561701
Test: atest AconfigDemoUnitTests1 && atest AconfigDemoUnitTests2
Change-Id: Ie571a260d9042933032c702095808dbf59d1697c
Add an internal dir to host an aconfig file that is dedicated to
trunk_stable_workflow testing. We should use this one, instead the one
dedicated to the demo app.
Bug: 294537090
Change-Id: I1a28da8e202f5f454df35f298c8c962d3b9b229b
The testing rule MockFlagsRule is not a "Mock". Rename the class name.
Bug: 280833463
Test: presubmit
Change-Id: I644537163e07dcf55cd69af3690e435251149349
Add usage of test mode of java_aconfig_library.
Add local host unit test of contentlibs
Test: atest ContentLibs_test_host --host
Bug: 287644619
Change-Id: Ib99a3f2b692d3251d445a2e188325ee0b0b6b268
aconfig now requires that each flag is associated with exactly one bug.
Update aconfig_demo_flags.aconfig accordingly.
Also standardize use of whitespace.
Bug: 293156797
Test: presubmit
Change-Id: I3e10f7055ffb2776fbe825f0902b735ca4674b58
The TestDiscoverService app covers the API for service discover. The
TestAdvertiseService app covers the APT for service advertisement.
Test: ./gradlew build
Change-Id: I6a8d94bbe88a9a20b1adcda8e0916898c68e7ea5
... also fixed missing copyright headers in 2 existing test files
... also made the instrumentation against the demo activity for real
Bug: 277819423
Test: atest FlagStateComboTests
adb shell device_config put test \
com.example.android.aconfig.demo.flags.awesome_flag_1 <true|false>
adb shell device_config put test \
com.example.android.aconfig.demo.flags.awesome_flag_2 <true|false>
Change-Id: I6083f11ee743a8b4f0f9bc23ac6945b5d072ab5e
Add the Injection use case of Aconfig flag.
Add corresponding tests.
Test: atest AconfigDemo_ContentLibs_Test
Bug: 287644619
Change-Id: I47cea59764b2956644ad0c159945d3cdb3231c09
Add a simple app uses aconfig.
This app can demonstrate
1. declare aconfig flag
2. build aconfig flag in building system
3. generate aconfig java flag
4. use aconfig java flag in java code
Test: atest AconfigDemo_ContentProvide_Test
Bug: 280833426
Change-Id: Ieacbe4b2368a00872254dab1c87dc66c569fc30a
The Aconfig demo will be used as
1. As an example for aconfig code lab
2. As an example for user to learn Aconfig
Test: N/A
Bug: 287644619
Change-Id: Ida6c922fdd52caaecfadff99809a70fab8442814
For testing and demo purpose, currently support selecting from well
defined list of aspect ratio, include 21:9, 16:9, 1:1, 9:16 and 9:21
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/gqFQI7mpeQ6EZZ5JibsV6R
Bug: 198643358
Test: Change aspect ratio within the app, see video
Change-Id: I0580dc45bf32e795fefd7d80f5183f268f810790
Renderscript is deprecated and scheduled for removal. Let's start by
removing the easiest part to remove.
Test: treehugger
Change-Id: I5f172497756c3931ccfda742e9c08bde56b362c9
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:
BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower
See https://errorprone.info/bugpatterns for more
information on the checks.
Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: Ic7e78cc74523ee09c1b4aa9969756f0cfd609e08
If your app targets Android 12, you must specify the mutability of each PendingIntent
object that your app creates. This additional requirement improves your app's security.
https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability
Android Lint is being updated, and adds an error-level check for this.
Bug: 247885568
Test: Presubmits
Change-Id: I2bb91d98b443af2b5c16944ce197d863dbd33f9a
The ArrayEquals, ArrayHashCode, ArrayToString, and
ArraysAsListPrimitiveArray errorprone findings were
demoted from errors to warnings. Fix existing
occurrences of them so they can be made errors again.
Bug: 242630963
Test: RUN_ERROR_PRONE=true m javac-check
Change-Id: Iaecb05992482dfea041e51e3978d0d51d4ca2ce8
The demo Activity simply finishes itself when it receives the callback
from the close action PendingIntent.
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/fR0hxeorlYrxXyzfZ02btK
Bug: 223896879
Test: see video
Change-Id: I94797b666fbcd630c828463668d9bc4e07274cd8
This CL introduces a sample AccessibilityService that demonstrates how
to use newly added APIs based on IME APIs [1].
[1]: Ia651a811093a939d00c081be1961e24ed3ad0356
fb17e5ae7a9e1a095d114d8dde76f14578b6c233
Fix: 223671031
Test: Manually done as follows.
1. make -j SampleInputMethodAccessibilityService
2. adb install -r $OUT/system/app/SampleInputMethodAccessibilityService/SampleInputMethodAccessibilityService.apk
3. adb shell settings put secure enabled_accessibility_services com.example.android.sampleinputmethodaccessibilityservice/com.example.android.sampleinputmethodaccessibilityservice.SampleInputMethodAccessibilityService
Change-Id: Iea75f4378118fadc142c56aad7667784111033ba
Push specific licenses down the tree toward the leaf directories.
Remove extra Apache 2.0 license texts--just use Android-Apache-2.0
Test: m nothing
Change-Id: Ibee25f75f5933699d6f43acdc192b2ada6823757
With CL[1],[2] to migrate InputMethodService as the subclass of the new
introduced class WindowProviderService in S_V2, IME context resources
can be managed by associating the window container of IME window when
its display/window configuration changed.
So in SoftKeyboard#getDisplayContext, we can get rid of
createDisplayContext logic from S_V2 with gated by SDK version and
refining the method documentation to make it clear.
[1]: Ie565e30ed5dd3f2cfe27355a6dded76dc3adc14b
[2]: I64a1614f32d097785915f6105b1813a929e0fe32
Bug: 213118079
Bug: 133825283
Test: manual with below steps
1) adb install -r EditTextVariations.apk
2) adb install -r SoftKeyboard.apk
3) adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
4) adb shell ime set com.example.android.softkeyboard/.SoftKeyboard5
5) Enable screen auto-rotation
6) Launch EditTextVariations from launcher's shortcut
7) Tap the first EditText field to show IME
8) Rotate the device to the landscape mode
9) Expect the IME should not be shrunk
Change-Id: I9a512a90ca43f07236a041d9e82dbd875206f99e
With this CL, you can let ThemedNavBarKeyboard call
InputMethodService#setBackDisposition(int)
with either the following values
* BACK_DISPOSITION_DEFAULT
* BACK_DISPOSITION_ADJUST_NOTHING
so that you can see how those two flags work.
Bug: 213337792
Test: Manually verified as follows
1. Flash aosp_coral-userdebug into the device
2. make -j ThemedNavBarKeyboard
3. adb install -r $ANDROID_PRODUCT_OUT/system/app/ThemedNavBarKeyboard/ThemedNavBarKeyboard.apk
4. adb shell ime enable com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
5. adb shell ime set com.example.android.themednavbarkeyboard/.ThemedNavBarKeyboard
6. Tap any edit field
7. Make sure that the back button is left-pointing triangle
8. Tap "BACK_DISPOSITION_ADJUST_NOTHING" on the IME
9. Make sure that the back button is down-pointing triangle
Change-Id: I71aa1dd23d72e8891cb3887efe5db1a48b6a017d