Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
android_packages_apps_SetupWizard
Commits
aba4f6f1
Commit
aba4f6f1
authored
Jun 23, 2017
by
Aaron Kling
Committed by
Abhisek Devkota
Oct 25, 2017
Browse files
WifiSetup: If an ethernet connection is active, skip wifi setup
Change-Id: I6dc08e5e7d07c3650449fcf4374a375827eb3743
parent
356dcde8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
View file @
aba4f6f1
...
...
@@ -46,6 +46,7 @@ import android.hardware.fingerprint.FingerprintManager;
import
android.os.Binder
;
import
android.os.SystemProperties
;
import
android.os.UserHandle
;
import
android.net.ConnectivityManager
;
import
android.provider.Settings
;
import
android.telephony.ServiceState
;
import
android.telephony.SubscriptionManager
;
...
...
@@ -210,6 +211,14 @@ public class SetupWizardUtils {
disableComponentSets
(
context
,
GET_RECEIVERS
|
GET_SERVICES
);
}
public
static
boolean
isEthernetConnected
(
Context
context
)
{
ConnectivityManager
cm
=
(
ConnectivityManager
)
context
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
return
(
cm
.
getActiveNetworkInfo
()
!=
null
&&
cm
.
getActiveNetworkInfo
().
getType
()
==
ConnectivityManager
.
TYPE_ETHERNET
);
}
public
static
boolean
hasLeanback
(
Context
context
)
{
PackageManager
packageManager
=
context
.
getPackageManager
();
return
packageManager
.
hasSystemFeature
(
PackageManager
.
FEATURE_LEANBACK
);
...
...
@@ -243,7 +252,8 @@ public class SetupWizardUtils {
disableComponent
(
context
,
MobileDataActivity
.
class
);
disableComponent
(
context
,
ChooseDataSimActivity
.
class
);
}
if
(!
SetupWizardUtils
.
hasWifi
(
context
))
{
if
(!
SetupWizardUtils
.
hasWifi
(
context
)
||
isEthernetConnected
(
context
))
{
disableComponent
(
context
,
WifiSetupActivity
.
class
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment