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: I29f691a22617b1fc834680ff1cf4ab4244203f06
Search highlight function includes two steps: Scroll list to target position first, then notifyItemChanged to it.
We use a Handler.postDelay to implement this. However, when scheduled runnable starts, the original target position could have changed due to preference list update, calling recyclerview's methods after that will be easy to cause an exception.
This CL ensures highlight position every time before calling recyclerView update, which also contribute to origin fix of RecyclerView IllegalArgumentException to a certain extent.
Test: atest, also test some search results, and see the correct behavior
Fixes: 246411107
Change-Id: Ifa758ce3718b047138079246cdfce99fdf66d5b2
When 2g is disallowed by a device admin the 2g toggle in the preference
screen will implement the following behaviors as a result of being
changed to a RestrictedSwitchPreference:
1. become disabled (greyed out)
2. show a summary message explaining that the preference was disabled by
an admin
3 show a pop up when a user tries to click on the preference informing
them that the setting is unusable because it was disabled by an admin.
Additionally, the toggle will show as unchecked (off) when admins
disable 2g.
When 2g is re-enabled by a device admin, the preference screen will go back
to its previous state.
Test: atest Enable2gPreferenceControllerTest
Bug: b/248250240
Change-Id: I7af901f2d9f62ebfe884e01724d8eff845c2968e
Summary:
When BT ON and enter into NetworkDashboardFragment, and turning BT OFF and exiting the fragment, the `BluetoothAdapter.closeProfileProxy(BluetoothProfile.PAN)` will not be called.
This causes binder leakage on next time the NetworkDashboardFragment is entered, until killing Settings process.
Reproduce Steps:
1. Turn BT ON
2. Open Settings process
3. Enter "Network & internet" (NetworkDashboardFragment)
4. Turn BT OFF
5. Back to previous page (do not kill Settings process)
* Repeat Step 3-5
Solution:
Do not set value of `mBluetoothPan` to null when `onServiceDisconnected` raised, to ensure the binder object (profile proxy) be closed in lifecycle `onDestroy()`.
Bug: 243128377
Test: enter "Network & internet" page, turn off BT and leave the page
Change-Id: Ieca3e5401c23d1b0ffece1bbb0db96988044262d
Within Settings app, long press allows user to copy status/summary part
when it comes to first SIM.
This is a commit to enable the same feature on the second sim.
Test: local
Change-Id: I58d9cf9cbba213196536781d41b9ec81c0142960
Screen timeout summary string can be null if there is no matching candidate, so we need a fallback summary here to avoid showing unexpected summary text.
Bug: 252340891
Test: manual
Change-Id: I939ae97a50063b2ffe84029135c3f340aeedf4c7
In order to reduce the complexity, LE audio offload couldn't be
enabled as a2dp offload disabled. Remove the combination from the
developer option
1. As a2dp offload disabled, LE audio offload couldn't be switched.
2. As the user disable a2dp offload, LE audio offload would be disabled
as well
Bug: 238268927
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothLeAudioHwOffloadPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothA2dpHwOffloadPreferenceControllerTest
Change-Id: I9ebe26c6a8058798ea654523ad1405a8447268b8