public final class

Profile

extends Object
implements Parcelable Comparable
java.lang.Object
   ↳ lineageos.app.Profile

Class Overview

A class that represents a device profile. A Profile can serve a multitude of purposes, allowing the creator(user) to set overrides for streams, triggers, screen lock, brightness, various other settings.

Summary

Nested Classes
class Profile.DozeMode Doze modes available on a device  
class Profile.ExpandedDesktopMode Expanded desktop modes available on a device  
class Profile.LockMode Lock modes of a device  
class Profile.NotificationLightMode Notification light modes available on a device  
class Profile.ProfileTrigger A Profile.ProfileTrigger is a Profile.TriggerType which can be queried from the OS  
class Profile.TriggerState Various trigger states associated with a Profile.TriggerType  
class Profile.TriggerType Available trigger types on the device, usually hardware  
class Profile.Type A Profile type  
[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Constructors
Profile(String name)
Public Methods
void addSecondaryUuid(UUID uuid)
Add a secondary UUID to the Profile
int compareTo(Object obj)
AirplaneModeSettings getAirplaneMode()
Get the AirplaneModeSettings associated with the Profile
BrightnessSettings getBrightness()
Get the BrightnessSettings associated with the Profile
ConnectionSettings getConnectionSettingWithSubId(int subId)
Get the settings for a PROFILE_CONNECTION_2G3G4G by sub id.
Collection<ConnectionSettings> getConnectionSettings()
Get the ConnectionSettings for the Profile
int getDozeMode()
Get the Profile.DozeMode associated with the Profile
int getExpandedDesktopMode()
String getName()
Get the name associated with the Profile
int getNotificationLightMode()
Get the Profile.NotificationLightMode associated with the Profile
int getProfileType()
Get the Profile.Type of the Profile
RingModeSettings getRingMode()
Get the RingModeSettings for the Profile
LockSettings getScreenLockMode()
Get the LockSettings for the Profile
UUID[] getSecondaryUuids()
Get the secondary UUIDs for the Profile
ConnectionSettings getSettingsForConnection(int connectionId)
Get the settings for a connection id in the Profile
StreamSettings getSettingsForStream(int streamId)
Get the settings for a stream id in the Profile
Collection<StreamSettings> getStreamSettings()
Get the StreamSettings for the Profile
int getTriggerState(int type, String id)
Get the Profile.TriggerState for a Profile.ProfileTrigger with a given id
ArrayList<Profile.ProfileTrigger> getTriggersFromType(int type)
Get all the Profile.ProfileTriggers for a given Profile.TriggerType
UUID getUuid()
Get the UUID associated with the Profile
boolean isConditionalType()
Check if the given Profile is a CONDITIONAL
void setAirplaneMode(AirplaneModeSettings descriptor)
Set the AirplaneModeSettings associated with the Profile
void setBrightness(BrightnessSettings descriptor)
Set the BrightnessSettings associated with the Profile
void setConnectionSettings(ConnectionSettings descriptor)
Set the ConnectionSettings for the Profile
void setDozeMode(int dozeMode)
Set the Profile.DozeMode associated with the Profile
void setExpandedDesktopMode(int expandedDesktopMode)
void setName(String name)
Set a name for the Profile
void setNotificationLightMode(int notificationLightMode)
Set the Profile.NotificationLightMode associated with the Profile
void setProfileType(int type)
Set the Profile.Type for the Profile
void setRingMode(RingModeSettings descriptor)
Set the RingModeSettings for the Profile
void setScreenLockMode(LockSettings screenLockMode)
Set the LockSettings for the Profile
void setSecondaryUuids(List<UUID> uuids)
Set a list of secondary UUIDs for the Profile
void setStreamSettings(StreamSettings descriptor)
Set the StreamSettings for the Profile
void setTrigger(Profile.ProfileTrigger trigger)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable
From interface java.lang.Comparable

Public Constructors

public Profile (String name)

added in API level 2

Parameters
name String

Public Methods

public void addSecondaryUuid (UUID uuid)

added in API level 2

Add a secondary UUID to the Profile

public int compareTo (Object obj)

added in API level 2

Parameters
obj Object
Returns
int

public AirplaneModeSettings getAirplaneMode ()

added in API level 2

Get the AirplaneModeSettings associated with the Profile

Returns
AirplaneModeSettings

public BrightnessSettings getBrightness ()

added in API level 2

Get the BrightnessSettings associated with the Profile

Returns
BrightnessSettings

public ConnectionSettings getConnectionSettingWithSubId (int subId)

added in API level 5

Get the settings for a PROFILE_CONNECTION_2G3G4G by sub id.

Parameters
subId int: the sub id to lookup. Can be INVALID_SUBSCRIPTION_ID
Returns
ConnectionSettings ConnectionSettings

public Collection<ConnectionSettings> getConnectionSettings ()

added in API level 2

public int getDozeMode ()

added in API level 2

Get the Profile.DozeMode associated with the Profile

Returns
int

public int getExpandedDesktopMode ()

added in API level 2

Get the Profile.ExpandedDesktopMode for the Profile

Returns
int

public String getName ()

added in API level 2

Get the name associated with the Profile

Returns
String a string name of the profile

public int getNotificationLightMode ()

added in API level 5

Get the Profile.NotificationLightMode associated with the Profile

Returns
int

public int getProfileType ()

added in API level 2

Get the Profile.Type of the Profile

Returns
int

public RingModeSettings getRingMode ()

added in API level 2

Get the RingModeSettings for the Profile

Returns
RingModeSettings

public LockSettings getScreenLockMode ()

added in API level 2

Get the LockSettings for the Profile

Returns
LockSettings

public UUID[] getSecondaryUuids ()

added in API level 2

Get the secondary UUIDs for the Profile

Returns
UUID[] the secondary uuids for the Profile

public ConnectionSettings getSettingsForConnection (int connectionId)

added in API level 2

Get the settings for a connection id in the Profile

Parameters
connectionId int
Returns
ConnectionSettings ConnectionSettings

public StreamSettings getSettingsForStream (int streamId)

added in API level 2

Get the settings for a stream id in the Profile

Parameters
streamId int
Returns
StreamSettings StreamSettings

public Collection<StreamSettings> getStreamSettings ()

added in API level 2

public int getTriggerState (int type, String id)

added in API level 2

Get the Profile.TriggerState for a Profile.ProfileTrigger with a given id

Parameters
type int: Profile.TriggerType
id String: string id of Profile.ProfileTrigger
Returns
int Profile.TriggerState

public ArrayList<Profile.ProfileTrigger> getTriggersFromType (int type)

added in API level 2

Get all the Profile.ProfileTriggers for a given Profile.TriggerType

Parameters
type int: Profile.TriggerType
Returns
ArrayList<Profile.ProfileTrigger> an array list of Profile.ProfileTriggers

public UUID getUuid ()

added in API level 2

Get the UUID associated with the Profile

Returns
UUID the uuid for the profile

public boolean isConditionalType ()

added in API level 2

Check if the given Profile is a CONDITIONAL

Returns
boolean true if conditional

public void setAirplaneMode (AirplaneModeSettings descriptor)

added in API level 2

Set the AirplaneModeSettings associated with the Profile

public void setBrightness (BrightnessSettings descriptor)

added in API level 2

Set the BrightnessSettings associated with the Profile

Parameters
descriptor BrightnessSettings

public void setConnectionSettings (ConnectionSettings descriptor)

added in API level 2

Set the ConnectionSettings for the Profile

public void setDozeMode (int dozeMode)

added in API level 2

Set the Profile.DozeMode associated with the Profile

Parameters
dozeMode int

public void setExpandedDesktopMode (int expandedDesktopMode)

added in API level 2

Set the Profile.ExpandedDesktopMode for the Profile

Parameters
expandedDesktopMode int

public void setName (String name)

added in API level 2

Set a name for the Profile

Parameters
name String: a string for the Profile

public void setNotificationLightMode (int notificationLightMode)

added in API level 5

Set the Profile.NotificationLightMode associated with the Profile

Parameters
notificationLightMode int

public void setProfileType (int type)

added in API level 2

Set the Profile.Type for the Profile

Parameters
type int: a type of profile

public void setRingMode (RingModeSettings descriptor)

added in API level 2

Set the RingModeSettings for the Profile

public void setScreenLockMode (LockSettings screenLockMode)

added in API level 2

Set the LockSettings for the Profile

public void setSecondaryUuids (List<UUID> uuids)

added in API level 2

Set a list of secondary UUIDs for the Profile

public void setStreamSettings (StreamSettings descriptor)

added in API level 2

Set the StreamSettings for the Profile

public void setTrigger (Profile.ProfileTrigger trigger)

added in API level 2

Set a Profile.ProfileTrigger on the Profile

Parameters
trigger Profile.ProfileTrigger: a Profile.ProfileTrigger