java.lang.Object | |
↳ | lineageos.profiles.ConnectionSettings |
The ConnectionSettings
class allows for creating Network/Hardware overrides
depending on their capabilities.
Example for enabling/disabling sync settings:
ConnectionSettings connectionSettings = new ConnectionSettings(ConnectionSettings.PROFILE_CONNECTION_SYNC, shouldBeEnabled() ?STATE_ENABLED
:STATE_DISALED
, true) profile.setConnectionSettings(connectionSettings);
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ConnectionSettings.BooleanState |
BooleanStates for specific ConnectionSettings
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | PROFILE_CONNECTION_2G3G4G |
The PROFILE_CONNECTION_2G3G4G allows for flipping between 2G/3G/4G (if exists)
on the device.
|
|||||||||
int | PROFILE_CONNECTION_BLUETOOTH |
The PROFILE_CONNECTION_BLUETOOTH allows for enabling and disabling the Bluetooth device
(if exists) on the device.
|
|||||||||
int | PROFILE_CONNECTION_GPS |
The PROFILE_CONNECTION_GPS allows for enabling and disabling the GPS radio (if exists)
on the device.
|
|||||||||
int | PROFILE_CONNECTION_MOBILEDATA |
The PROFILE_CONNECTION_MOBILEDATA allows for enabling and disabling the mobile
data connection.
|
|||||||||
int | PROFILE_CONNECTION_NFC |
The PROFILE_CONNECTION_NFC allows for enabling and disabling the NFC device
(if exists) on the device.
|
|||||||||
int | PROFILE_CONNECTION_SYNC |
The PROFILE_CONNECTION_SYNC allows for enabling and disabling the global sync state
on the device.
|
|||||||||
int | PROFILE_CONNECTION_WIFI |
The PROFILE_CONNECTION_WIFI allows for enabling and disabling the WiFi connection
on the device.
|
|||||||||
int | PROFILE_CONNECTION_WIFIAP |
The PROFILE_CONNECTION_WIFIAP allows for enabling and disabling the WiFi hotspot
on the device.
|
|||||||||
int | PROFILE_CONNECTION_WIMAX | This constant was deprecated in API level 7. No replacement. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Unwrap
ConnectionSettings from a parcel.
| |||||||||||
Construct a
ConnectionSettings with a connection id and default states.
| |||||||||||
Construct a
ConnectionSettings with a connection id, default value
, and if the setting should override the user defaults.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieve the connection id associated with the
ConnectionSettings
| |||||||||||
Get the subscription id which this
ConnectionSettings should apply to.
| |||||||||||
Get the default value for the
ConnectionSettings
| |||||||||||
Check whether or not the
ConnectionSettings overrides user settings.
| |||||||||||
Set whether or not the
ConnectionSettings should override default user values
| |||||||||||
Set the default value for the
ConnectionSettings
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
The PROFILE_CONNECTION_2G3G4G
allows for flipping between 2G/3G/4G (if exists)
on the device.
The PROFILE_CONNECTION_BLUETOOTH
allows for enabling and disabling the Bluetooth device
(if exists) on the device. Boolean connection settings ConnectionSettings.BooleanState
The PROFILE_CONNECTION_GPS
allows for enabling and disabling the GPS radio (if exists)
on the device. Boolean connection settings ConnectionSettings.BooleanState
The PROFILE_CONNECTION_MOBILEDATA
allows for enabling and disabling the mobile
data connection. Boolean connection settings ConnectionSettings.BooleanState
The PROFILE_CONNECTION_NFC
allows for enabling and disabling the NFC device
(if exists) on the device. Boolean connection settings ConnectionSettings.BooleanState
The PROFILE_CONNECTION_SYNC
allows for enabling and disabling the global sync state
on the device. Boolean connection settings ConnectionSettings.BooleanState
The PROFILE_CONNECTION_WIFI
allows for enabling and disabling the WiFi connection
on the device. Boolean connection settings ConnectionSettings.BooleanState
The PROFILE_CONNECTION_WIFIAP
allows for enabling and disabling the WiFi hotspot
on the device. Boolean connection settings ConnectionSettings.BooleanState
This constant was deprecated
in API level 7.
No replacement.
The PROFILE_CONNECTION_WIMAX
allows for enabling and disabling the WIMAX radio (if exists)
on the device. Boolean connection settings ConnectionSettings.BooleanState
Unwrap ConnectionSettings
from a parcel.
Construct a ConnectionSettings
with a connection id and default states.
Parameters | |
---|---|
connectionId |
int : ex: #PROFILE_CONNECTION_NFC
|
Construct a ConnectionSettings
with a connection id, default value
, and if the setting should override the user defaults.
Parameters | |
---|---|
connectionId |
int : an identifier for the ConnectionSettings (ex:#PROFILE_CONNECTION_WIFI) |
value |
int : default value for the ConnectionSettings (ex:STATE_ENABLED ) |
override |
boolean : whether or not the ConnectionSettings should override user defaults
|
See also:
Retrieve the connection id associated with the ConnectionSettings
Returns | |
---|---|
int |
an integer identifier |
Get the subscription id which this ConnectionSettings
should apply to.
Returns | |
---|---|
int |
Get the default value for the ConnectionSettings
Returns | |
---|---|
int |
integer value corresponding with its state |
Check whether or not the ConnectionSettings
overrides user settings.
Returns | |
---|---|
boolean |
true if override |
Set whether or not the ConnectionSettings
should override default user values
Parameters | |
---|---|
override |
boolean : boolean override
|
Set the default value for the ConnectionSettings
Parameters | |
---|---|
value |
int : ConnectionSettings.BooleanState
|