Commit Graph

104018 Commits

Author SHA1 Message Date
Bonian Chen
3be07f0e15 [Settings] configuration for hidding SIM settings UI
Hide SIM settings UI based on configuraion.

Bug: 240515161
Test: test cases and local testing
Merged-In: If1df99a79e51125d03f534cdfc9408b01c61024f
Change-Id: I3d6ecec1465189429f2a3ea026d15e23357d0832
2022-11-14 10:24:43 +00:00
Treehugger Robot
ccfa7fa918 Merge "Fix potential crash in AppAllServicesPreferenceController" 2022-11-11 11:10:12 +00:00
Shen Lin
e8a0ba688b Fix potential crash in AppAllServicesPreferenceController
This CL contains two fixes:

- Fix potentialcrash when calling getAvailabilityStatus, we should use
  the latest packageName to decide.

- Add test class

Bug: 258270151
Test: atest
Change-Id: I3e6aa7e0773a73d2e3dfa996e42087f3ec80627b
2022-11-10 10:18:14 +08:00
Treehugger Robot
48c386e54c Merge "Align main thread checking by calling ThreadUtils" 2022-11-09 05:13:53 +00:00
Shen Lin
ce0e8b9a4b Align main thread checking by calling ThreadUtils
Since ThreadUtils encapsules method to ensure main thread, it is
suggested to call this method rather than maintaining our copy.

Bug: 258270052
Test: atest and manual.
Change-Id: I4c5fcdd6e5bcc7d1d08f526eedb3aa123926d8a1
2022-11-09 11:43:03 +08:00
Gil Cukierman
08d03390ae Merge "Honor DISALLOW_CELLULAR_2G User Restriction in Enable2gPreferenceController" 2022-11-01 13:51:58 +00:00
Treehugger Robot
5744d7c560 Merge "Fix errorprone warnings that should be errors" 2022-10-31 22:21:12 +00:00
Treehugger Robot
f7200dd58a Merge "Support AIDL IDumpstateDevice service in verbose vendor logging" 2022-10-27 05:31:45 +00:00
Rambo Wang
306a366d12 Support AIDL IDumpstateDevice service in verbose vendor logging
IDumpstateDevice HAL switched to AIDL service in P22 devices.
This change will firstly apply to AIDL service if available and
fall back to HIDL service if not, making the feature work for
both HIDL an AIDL based devices.

Bug: 242634531
Test: make && make RunSettingsRoboTests
Change-Id: I4a2ec44092804574a60113e5be3df19b586bfa64
Merged-In: I4a2ec44092804574a60113e5be3df19b586bfa64
(cherry picked from commit 17a9fb6bec)
2022-10-26 10:23:25 -05:00
Treehugger Robot
fcd941b4eb Merge "Ensure search highlight position when scheduled runnable starts" 2022-10-25 07:35:26 +00:00
Treehugger Robot
8959f0698a Merge "Fix typo in WifiCallingSettingsForSub" 2022-10-25 06:30:47 +00:00
Shen Lin
f20f8bc71a Fix typo in WifiCallingSettingsForSub
test: compile pass
Change-Id: I719a9a634a3b321533462f8e9fef9c183c042335
2022-10-25 11:37:04 +08:00
Cole Faust
43ff89802c Fix errorprone warnings that should be errors
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
2022-10-23 12:41:39 -07:00
Shen Lin
bb2fb2ffd6 Ensure search highlight position when scheduled runnable starts
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
2022-10-21 14:01:47 +08:00
Treehugger Robot
bdcd3a3975 Merge "network: fix binder object leakage in settings" 2022-10-21 03:25:39 +00:00
Gil Cukierman
a2ddff3865 Honor DISALLOW_CELLULAR_2G User Restriction in Enable2gPreferenceController
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
2022-10-19 21:01:17 +00:00
Jason Huang
2bb35ff3fc network: fix binder object leakage in settings
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
2022-10-19 22:07:55 +08:00
Bonian Chen
90dcc7c5c1 Merge "[Settings] align the long press behavior on secondary sim" 2022-10-19 08:01:34 +00:00
Bonian Chen
7364b9bbe3 [Settings] align the long press behavior on secondary sim
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
2022-10-19 01:47:11 +00:00
Treehugger Robot
e8160af796 Merge "Fix crash when input illegal proxy port number" 2022-10-18 20:17:08 +00:00
Treehugger Robot
d791f7b967 Merge "Fix crash when showing error dialog in NetworkRequestDialogActivity" 2022-10-18 04:09:49 +00:00
Shen Lin
a911e61ce7 Fix crash when input illegal proxy port number
Bug: 253951250
Test: manual and atest
Change-Id: I80d2f0e3ce2df86a081b29d8633e06cfc648baeb
2022-10-18 09:18:57 +08:00
Shen Lin
72e5a7ea21 Fix crash when showing error dialog in NetworkRequestDialogActivity
Fix: 253913148
Test: manual
Change-Id: I23593da1ef6d72806f22d3501b06a8e7abadb100
2022-10-17 09:30:16 +08:00
Treehugger Robot
df8e9c630a Merge "Fix "show system apps" status lost when switching on/off dark theme" 2022-10-13 14:09:17 +00:00
Shen Lin
d956175333 Fix "show system apps" status lost when switching on/off dark theme
Bug: 253388290
Test: manual and atest
Change-Id: I5833f94478c2faaf53d40652f0e7ce92adb3e8b6
2022-10-13 12:19:11 +00:00
Treehugger Robot
007c215c3e Merge "Add fallback summary text if there is no matching screen timeout value" 2022-10-11 05:51:12 +00:00
Shen Lin
97a61bad7d Add fallback summary text if there is no matching screen timeout value
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
2022-10-09 01:59:02 +00:00
Xin Li
2af8366306 Merge "Merge TP1A.221005.003" 2022-10-05 22:20:14 +00:00
Treehugger Robot
bcde51cf09 Merge "Remove A2dp offload disabled and LE audio offload enabled combination" 2022-10-05 16:04:05 +00:00
Alice Kuo
7cc845026c Remove A2dp offload disabled and LE audio offload enabled combination
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
2022-10-04 23:48:11 +08:00
Xin Li
f51d201af3 Merge TP1A.221005.003
Merged-In: Ia825853dde2e966e3d390cecfbe1a99f6439d31e
Change-Id: Ia7b51d3cc694287b930d240c77e5ba0ed9a527f4
2022-10-03 13:17:48 -07:00
Arc Wang
6626e50dd8 Merge "Fix USB OTG hot plug out nndexOutOfBoundsException" 2022-09-28 01:22:51 +00:00
ot904699
aa76620073 Fix USB OTG hot plug out nndexOutOfBoundsException
Open Settings, then open Storage , plug in USB OTG with Disk, select Disk, open Files, play a video, press the back key, hot plug out USB OTG, the IndexOutOfBoundsException will happen

The root cause is when received the onVolumeStateChanged in StorageEventListener in StorageDashboardFragment, the volumeInfo
status is VolumeInfo.STATE_UNMOUNTED or VolumeInfo.STATE_EJECTING, mSelectedStorageEntry set to changedStorageEntry, cause the fail.

This is a fix for CL 225095144 bug.

Bug: 247737688
Test: Manual

Change-Id: I9535c49d65c42a8dfa8ccf4e271ae973d944d4b9
2022-09-26 08:15:48 +00:00
Bill Yi
5419d3f04e Merge "Import translations. DO NOT MERGE ANYWHERE" 2022-09-26 03:07:25 +00:00
Bill Yi
2a57051294 Merge "Import translations. DO NOT MERGE ANYWHERE" 2022-09-26 03:07:25 +00:00
Treehugger Robot
4d5951c6ef Merge "Settings: Protect sensitive data on the about phone" 2022-09-24 08:23:53 +00:00
Bill Yi
a068e61a94 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I0ad02e480a4a792ddeaa12e07a12f968659d3faa
2022-09-23 11:04:43 -07:00
Bill Yi
53322b1886 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I4a5a43e5ad52047121da5fc18e8cdfb7a84e1556
2022-09-23 11:01:33 -07:00
Tom Hsu
8a9dc9ca90 Merge "[Settings] Update UI when bluetooth connection is down." 2022-09-23 06:39:35 +00:00
Gil Cukierman
594002e21a Merge "Use AAPT2 For SettingsUnitTests" 2022-09-22 13:40:19 +00:00
tom hsu
3d138b372b [Settings] Update UI when bluetooth connection is down.
- When Airplane mode on, all connection shall be disconnected. In
   current design, when bluebooth disconnected, network page in Settings
   does not udpate the UI.

Bug: b/246925011
Test: Maunal
Change-Id: I1bf56e96737157d8e76057028b22e94e0e8d76e4
2022-09-22 19:34:35 +08:00
Gil Cukierman
4429054bb1 Use AAPT2 For SettingsUnitTests
Forces tradefed to use aapt2 for SettingsUnitTests to get around
the issue of Settings.apk not being parseable by aapt.

Bug: 247779071
Test: atest SettingsUnitTests
Change-Id: I8af260f8d2c438512d3e61f0028accf7b40c8a00
2022-09-21 17:48:20 +00:00
althafvly
ed95f35423 Settings: Protect sensitive data on the about phone
- Hide some personal info like phone number and IMEI.
- IMEI shows on a tap, so why not.
- Avoid showing this in screenshot/screenrecord

Co-authored-by: El Dainosor <eldainosor@gmail.com>
Change-Id: I45b7898da440c36045aec64a0a86fb804116cd9d
2022-09-17 13:48:02 +00:00
Treehugger Robot
0960af0bf3 Merge "Mark DataUsageState as nullable to avoid potential NPE risk" 2022-09-15 11:56:51 +00:00
Shen Lin
eb627be0b4 Mark DataUsageState as nullable to avoid potential NPE risk
mDataUsageState is nullable in UnrestrictedDataAccessPreference.java, so we'd better
add a annotation to getDataUsageState(), and add a null-check before calling it.

Bug: 246828843

Test: manual and Robotest.
Change-Id: If7fea53ec7efd004391a09becdba5709ae686f40
2022-09-15 14:23:38 +08:00
Treehugger Robot
8b0e08ecee Merge "Fix compile warnings due to non-varargs call of varargs method" 2022-09-14 04:16:30 +00:00
Treehugger Robot
8f793f5e4f Merge "Fix the IllegalArgumentException from RecyclerView" 2022-09-14 03:55:49 +00:00
Shen Lin
c463aee2b8 Fix the IllegalArgumentException from RecyclerView
Attempt to remove the animator as early as possible to avoid a RecyclerView crash.

Bug: 246411107
Related bug: 184214085

Test: manual.
Change-Id: I8fcb06836217f4de200a53bb88a1a0b5e42bbe21
2022-09-13 08:46:30 +00:00
Bill Yi
677cd61616 Merge "Merge TP1A.220905.004 to aosp-master - DO NOT MERGE" 2022-09-12 17:59:03 +00:00
Treehugger Robot
4378ee11ad Merge "Fix potential NPE crash in ConversationHeaderPreferenceController" 2022-09-09 14:20:05 +00:00