Commit Graph

251 Commits

Author SHA1 Message Date
Manish Singh
8867f686d8 Hide VPNs from users that are hidden
Bug: 342562186
Test: manual
Change-Id: I288ac0a0eef48d4a94191de2292d02a0f93310aa
2024-05-30 15:25:35 +00:00
Sunny Shao
076ed573eb Revert^2 "Nullability Annotations replacement"
This reverts commit 19d1d3d15d.

Reason for revert: revert it because this is not the root cause.

bug: 316867690
Change-Id: I0f168dbb64044aa720202af7b1040afd4f028c9c
2024-01-10 07:34:01 +00:00
Sunny Shao
19d1d3d15d Revert "Nullability Annotations replacement"
This reverts commit cf0501e4d7.

Reason for revert: b/317462033, it seems a flaky but revert it first.

Change-Id: Ie1d5e279cca6477fc17d8c27c1ecda8d7a6b2553
2023-12-29 02:28:24 +00:00
sunnyshao
cf0501e4d7 Nullability Annotations replacement
-- Replace the android.annotation.Nullable / android.annotation.NonNull
   with androidx.annotation.Nullable / androidx.annotation.NonNull

Bug: 316867690
Test: build pass
Change-Id: I0c1da55dfb09ece855151c47e0492d6f46538621
2023-12-20 08:50:09 +08:00
Hansen Kurli
d881186df4 Merge "Create a new string to alert unsupported vpn start." into main am: 3c569b5379 am: 42ad676a4e am: b7ba4be4b3
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2831551

Change-Id: Ib74982008d3e123b00cf235f39f1b2d8f182c585
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-21 10:02:27 +00:00
Hansen Kurli
42ad676a4e Merge "Create a new string to alert unsupported vpn start." into main am: 3c569b5379
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2831551

Change-Id: I6ee70a33d9c5739ee2e44dcef8158c5f2b7767e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-21 08:59:06 +00:00
Hansen Kurli
3c569b5379 Merge "Create a new string to alert unsupported vpn start." into main 2023-11-21 08:21:33 +00:00
Hansen Kurli
e49454db98 Create a new string to alert unsupported vpn start.
Test: Manual test
Change-Id: Ic32db48671335a59c3bf8b43065cfef7c39c2936
2023-11-21 13:29:27 +08:00
Hansen Kurli
283cf1b75a Merge "Use AlertDialog to alert Unsupported VPN type." into main am: 643136bba6 am: f151e8bdd0 am: 579b7b3457
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2824760

Change-Id: I04e1ac5cd25b39c4b409731607444ccd961d53fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-16 12:39:33 +00:00
Hansen Kurli
f151e8bdd0 Merge "Use AlertDialog to alert Unsupported VPN type." into main am: 643136bba6
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2824760

Change-Id: I741bcfd4484ef711d3190c94c7dd4f2a1c325fed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-16 11:34:15 +00:00
Hansen Kurli
643136bba6 Merge "Use AlertDialog to alert Unsupported VPN type." into main 2023-11-16 11:08:33 +00:00
Hansen Kurli
54627f0798 Merge changes I7a017026,I76a5c940 into main am: 520d7c6758 am: 6d96b61bfa am: 0a173b2618
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2819338

Change-Id: I60593753806b8804b2647bd9251f630b6203a764
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 08:32:47 +00:00
Hansen Kurli
6d96b61bfa Merge changes I7a017026,I76a5c940 into main am: 520d7c6758
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2819338

Change-Id: I8341c0f82c7ca00dba4cf2590d37d25f9d1072ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-15 07:09:08 +00:00
Hansen Kurli
520d7c6758 Merge changes I7a017026,I76a5c940 into main
* changes:
  Remove the code of legacy VPN from Settings
  Remove legacy vpn types from R.array.vpn_types.
2023-11-15 06:35:47 +00:00
lucaslin
755662f72e Remove the code of legacy VPN from Settings
IKEv2 VPN options are now functional, so removing the code of
legacy VPN. (i.e. PPTP, L2TP/IPSec PSK, L2TP/IPSec RSA,
IPSec Xauth PSK, IPSec Xauth RSA, IPSec Hybrid RSA)

Bug: 161776767
Test: Build pass, m
Test: Flash and manual test
Test: atest SettingsUnitTests:com.android.settings.vpn2
Change-Id: I7a017026adec2452254c78ef5e0ebf61ce1a9ecf
2023-11-14 16:01:16 +08:00
Hansen Kurli
e554d06665 Remove legacy vpn types from R.array.vpn_types.
Remove the legacy vpn types from R.array.vpn_types.
Since the array of vpn types are now all allowed, the case of
using mAllowedTypes is no longer needed and removed.

Since R.array.vpn_types no longer match the constants in
VpnProfile, a conversion is needed from the VpnProfile constants
to the selected type position and vice versa.

Bug: 161776767
Test: m
Test: Flash and manual test setup VPNs
Change-Id: I76a5c940acf08c6d6adfe6ff270f39808abf88ab
2023-11-14 16:00:59 +08:00
Hansen Kurli
1fd7fe6373 Use AlertDialog to alert Unsupported VPN type.
Follow up of aosp/2822270. Show an AlertDialog instead of a Toast
when starting an unsupported VPN type.

Test: Manual test
Change-Id: I2ffb1bd48dcb91624012c404b8a6eed1df9b0b8d
2023-11-13 20:46:38 +08:00
Hansen Kurli
57fc6301dd Merge "Catch UnsupportedOperationException of startLegacyVpn" into main am: 485e8800ed am: 3a33f7178f am: c58030dcb0
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2822270

Change-Id: If90532bcf8c83e2088ee1d284c0b440c5ca6f16d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-13 06:54:15 +00:00
Hansen Kurli
3a33f7178f Merge "Catch UnsupportedOperationException of startLegacyVpn" into main am: 485e8800ed
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2822270

Change-Id: I84a308d94aed266f5125977cd7a385c315a72047
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-13 06:05:58 +00:00
Hansen Kurli
eea7c3c8d5 Catch UnsupportedOperationException of startLegacyVpn
startLegacyVpn may throw UnsupportedOperationException. Instead
of crashing Settings, catch the exception and show a Toast.

Bug: 161776767
Test: Manual test, connect legacy vpn profile and observe Toast.
Change-Id: I5947f2043aa68478f659b34531202f225eab4568
2023-11-08 20:39:00 +08:00
Cassie Wang
16e99c187f Merge "Add a config to show the Vpn options menu." into main am: 5abd3420c4
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2685406

Change-Id: Ib8a236bd666204b48faac0189fbcc1acfcb3e8ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-23 06:13:58 +00:00
Cassie Wang
760712201e Add a config to show the Vpn options menu.
Bug: 290124499
Test: m -j32 Settings
Change-Id: I14d59b656e917f6fb7a495f14297c594a115c018
2023-10-10 13:07:00 +09:00
Peter Kalauskas
80e914a263 Enable use_resource_processor for all sysui deps
This will make the build faster

Test: m checkbuild
Bug: 295208392
Change-Id: If75acb6b1c3f204e3686c20cef609f7cfabe15cf
2023-09-21 23:09:39 +00:00
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
Chaohui Wang
2541381259 Fix references to resources for Settings
Bug: 293810334
Test: m Settings
Change-Id: Ie140278f492ef7e1c062ec1ecae2866c521a86aa
2023-08-08 01:56:05 +00:00
Yu Chao (zhào-yò)
c9eca99ac1 Merge "Migrate VpnSettings from RestrictedSettingsFragment to RestrictedDashboardFragment." into udc-qpr-dev am: 8053947766
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24305937

Change-Id: I92ce6470673a5c7d36dd188bdb80902cb1103901
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-04 07:01:45 +00:00
Yu Chao
68e466ff01 Migrate VpnSettings from RestrictedSettingsFragment to RestrictedDashboardFragment.
This is required for adding an overlay vpn_settings2.xml for Tips
Button.

Test: VpnSettingsTest
Bug: 293213974
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f9ca569249331a062e6f58a49bb0bb53aa69b3db)
Merged-In: I26531afe75215c9531c0122d2e86fd5d0da4d3db
Change-Id: I26531afe75215c9531c0122d2e86fd5d0da4d3db
2023-08-04 05:51:48 +00:00
Yu Chao (zhào-yò)
2b2dfebaff Merge "Migrate VpnSettings from RestrictedSettingsFragment to RestrictedDashboardFragment." into main 2023-08-02 08:05:02 +00:00
Yu Chao
f9ca569249 Migrate VpnSettings from RestrictedSettingsFragment to RestrictedDashboardFragment.
This is required for adding an overlay vpn_settings2.xml for Tips
Button.

Change-Id: I26531afe75215c9531c0122d2e86fd5d0da4d3db
Test: VpnSettingsTest
Bug: 24179552
2023-08-01 08:13:14 +00:00
Cassie Wang
75842520d2 Add a config to show the Vpn options menu.
Bug: 290124499
Test: m -j32 Settings
Change-Id: I14d59b656e917f6fb7a495f14297c594a115c018
2023-07-25 10:31:45 +09:00
SongFerng Wang
7f29649aa9 Merge "Remove the owner" am: 286344d539 am: 448c8b61a8 am: 61ef9024c8
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2623772

Change-Id: I278260f1a36ed24fd1ca2d53ffc7ff2431fd1005
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-14 07:54:48 +00:00
SongFerngWang
f405dadcf2 Remove the owner
Bug: 286964921
Test: build pass
Change-Id: I4daf629e8cb994753dca36a811f0d25685df6928
2023-06-13 15:10:46 +08:00
SongFerngWang
e99db73c17 Modify the MetricsCategory as VPN_APP_MANAGEMENT
Bug: 260055313
Test: build pass
Change-Id: I7bb7d7519260abfa398b328829b559747d6f846b
2023-05-26 12:50:14 +08:00
Chiachang Wang
e428b25ea0 Merge "Populate ipsecSecret field in VpnProfile" am: 4c5334809d am: 4770d017dc am: cd33a0fa88
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2530499

Change-Id: I24723fadb4e89560ddb96da8149dc6dfa4e6ce6b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-13 10:25:09 +00:00
chiachangwang
02156d600d Populate ipsecSecret field in VpnProfile
This commit fixes IKEv2 RSA VPN could not be an always-on VPN
issue to populate ipsecSecret field from "IPsec user certificate".

Fields ipsecUserCert and ipsecSecret are required for a valid
VpnProfile. The ipsecSecret field in VpnProfile should be
populated from "IPsec user certificate" field. It's the matching
private key.

Bug: 263610164
Bug: 230727391
Test: Verify if IKEv2 RSA VPN can setup successfully and set as
      as always on VPN
Change-Id: I605b35fff9e399ee7b82d8441137984992ab2907
2023-04-13 07:47:53 +00:00
Bonian Chen
61c45064cd [Settings] Limit height of TextView when text too long
Adjust the layout through having ConstraintLayout for limiting the
height of TextView.

Bug: 205460459
Test: local

Change-Id: Ic15af4c9be393a6855d78a5d9af086b099c9b689
2023-01-10 07:36:21 +00:00
Treehugger Robot
9040efdccc Merge "Fix errorprone warnings that should be errors" am: 5744d7c560 am: 7094507528 am: 778ef161bb
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2255054

Change-Id: I1f3cbce7d5de6e63477bc2da2ad115ec53b06472
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-01 00:02:10 +00:00
Treehugger Robot
778ef161bb Merge "Fix errorprone warnings that should be errors" am: 5744d7c560 am: 7094507528
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2255054

Change-Id: I369fd8dc4e2cec46ffd4e61a32e7e55cb11b41a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-31 23:24:11 +00:00
Treehugger Robot
7094507528 Merge "Fix errorprone warnings that should be errors" am: 5744d7c560
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2255054

Change-Id: I65ce6c4fdedd32ff6feb4b5e210b508aafc4e589
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-31 22:57:02 +00: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
Treehugger Robot
772c437de4 Merge "Fix crash when input illegal proxy port number" am: e8160af796 am: 6372ae5e93 am: ab0dc7b129
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2255620

Change-Id: Ia9db49f176a65bb2d512cd7e0694284f03414a82
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 21:43:26 +00:00
Treehugger Robot
ab0dc7b129 Merge "Fix crash when input illegal proxy port number" am: e8160af796 am: 6372ae5e93
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2255620

Change-Id: Ida3089a2375e04b653058b380c2fd9f1f56a9fcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 21:10:26 +00:00
Treehugger Robot
6372ae5e93 Merge "Fix crash when input illegal proxy port number" am: e8160af796
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2255620

Change-Id: Idc35fa976db5cfde013ec9c32191869e84c7801f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 20:42:36 +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
Hugh Chen
f891f7ba86 RESTRICT AUTOMERGE Refactoring settings UI
Bug: 248174653
Test: build & boot pass
Change-Id: I124a65941349d3338145865cae2c8354678897fa
2022-10-11 04:30:09 +00:00
Robert Luo
36d320a8de Allow advanced VPN to manage connection status via its UI
Bug: 238641532
Test: atest -c VpnSettingsTest
Change-Id: Ia6f1d84bba38bab7f13f46dc8a4fdb4eb0505f8f
Merged-In: Ia6f1d84bba38bab7f13f46dc8a4fdb4eb0505f8f
2022-08-12 05:47:44 +08:00
Hugh Chen
1311019b9a RESTRICT AUTOMERGE Let advanced VPN profile visible immediately before the user consent to use VPN feature
- This CL will check whether advanced VPN apk is exist or not,
  and if so then show the preference of advanced VPN in the
  "Settings > Network & internet > VPN".

Bug: 239984274
Test: atest -c VpnSettingsTest
Change-Id: I8c11c7f2079d6ebec6c691b8bf2fb26dfc450663
2022-08-11 23:33:30 +08:00
Robert Luo
061a87fe1f Allow advanced VPN to manage connection status via its UI
Bug: 238641532
Test: atest -c VpnSettingsTest
Change-Id: Ia6f1d84bba38bab7f13f46dc8a4fdb4eb0505f8f
2022-07-29 18:31:13 +08:00
Hugh Chen
5cf2b7ff1f Refactor the condition order
Bug: 239984274
Test: atest -c VpnSettingsTest
Change-Id: Ic9e8c775b044fffd5dec5047fb53d75209418d85
2022-07-29 02:45:12 +00:00
Hugh Chen
f03cbcf83b Let advanced VPN profile visible immediately before the user consent to use VPN feature
- This CL will check whether advanced VPN apk is exist or not,
  and if so then show the preference of advanced VPN in the
  "Settings > Network & internet > VPN".

Bug: 239984274
Test: atest -c VpnSettingsTest
Change-Id: I8c11c7f2079d6ebec6c691b8bf2fb26dfc450663
2022-07-28 09:48:18 +00:00