Skip to content

Commit

Permalink
cmsdk: Expose ProfileTrigger constructor for third parties.
Browse files Browse the repository at this point in the history
Change-Id: I96dbc4974f49d07df020510be59f6ad23040e448
  • Loading branch information
Adnan Begovic committed Aug 5, 2015
1 parent c2d967c commit 8481cec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/cm_current.txt
Expand Up @@ -172,6 +172,7 @@ package cyanogenmod.app {
}

public static class Profile.ProfileTrigger implements android.os.Parcelable {
ctor public Profile.ProfileTrigger(int, java.lang.String, int, java.lang.String);
method public int describeContents();
method public java.lang.String getId();
method public java.lang.String getName();
Expand Down
20 changes: 19 additions & 1 deletion src/java/cyanogenmod/app/Profile.java
Expand Up @@ -180,8 +180,26 @@ public static class ProfileTrigger implements Parcelable {
private String mName;
private int mState;


/**
* @hide
* Construct a {@link ProfileTrigger} based on its type {@link Profile.TriggerType} and if
* the trigger should fire on a {@link Profile.TriggerState} change.
*
* Example:
* <pre class="prettyprint">
* triggerId = trigger.getSSID(); // Use the AP's SSID as identifier
* triggerName = trigger.getTitle(); // Use the AP's name as the trigger name
* triggerType = Profile.TriggerType.WIFI; // This is a wifi trigger
* triggerState = Profile.TriggerState.ON_CONNECT; // On Connect of this, trigger
*
* Profile.ProfileTrigger profileTrigger =
* new Profile.ProfileTrigger(triggerType, triggerId, triggerState, triggerName);
* </pre>
*
* @param type a {@link Profile.TriggerType}
* @param id an identifier for the ProfileTrigger
* @param state {@link Profile.TriggerState} depending on the TriggerType
* @param name an identifying name for the ProfileTrigger
*/
public ProfileTrigger(int type, String id, int state, String name) {
mType = type;
Expand Down
1 change: 1 addition & 0 deletions system-api/cm_system-current.txt
Expand Up @@ -172,6 +172,7 @@ package cyanogenmod.app {
}

public static class Profile.ProfileTrigger implements android.os.Parcelable {
ctor public Profile.ProfileTrigger(int, java.lang.String, int, java.lang.String);
method public int describeContents();
method public java.lang.String getId();
method public java.lang.String getName();
Expand Down

0 comments on commit 8481cec

Please sign in to comment.