88import net .sharksystem .asap .MultiASAPEngineFS ;
99import net .sharksystem .asap .android .service .ASAPService ;
1010
11- public class ASAPServiceCreationIntent extends Intent {
11+ import java .util .ArrayList ;
12+ import java .util .Collection ;
1213
14+ public class ASAPServiceCreationIntent extends Intent {
1315 private final CharSequence owner ;
1416 private final CharSequence rootFolder ;
1517 private final boolean onlineExchange ;
1618 private final long maxExecutionTime ;
19+ private ArrayList <CharSequence > supportFormatsList ;
1720
1821 public ASAPServiceCreationIntent (Activity activity , CharSequence owner , CharSequence rootFolder ,
19- boolean onlineExchange )
22+ boolean onlineExchange ,
23+ Collection <CharSequence > supportedFormats )
2024 throws ASAPException {
2125
22- this (activity , owner , rootFolder , onlineExchange ,
26+ this (activity , owner , rootFolder , onlineExchange , supportedFormats ,
2327 MultiASAPEngineFS .DEFAULT_MAX_PROCESSING_TIME );
2428 }
2529
2630 public ASAPServiceCreationIntent (Activity activity , CharSequence owner , CharSequence rootFolder ,
27- boolean onlineExchange , long maxExecutionTime )
31+ boolean onlineExchange , Collection < CharSequence > supportedFormats , long maxExecutionTime )
2832 throws ASAPException {
2933
3034 super (activity , ASAPService .class );
@@ -37,10 +41,18 @@ public ASAPServiceCreationIntent(Activity activity, CharSequence owner, CharSequ
3741 this .putExtra (ASAP .ONLINE_EXCHANGE , onlineExchange );
3842 this .putExtra (ASAP .MAX_EXECUTION_TIME , maxExecutionTime );
3943
44+ ArrayList <CharSequence > supportFormatsList = new ArrayList <>();
45+ for (CharSequence supportedFormat : supportedFormats ) {
46+ supportFormatsList .add (supportedFormat );
47+ }
48+ this .putCharSequenceArrayListExtra (ASAP .SUPPORTED_FORMATS , supportFormatsList );
49+
50+
4051 this .owner = owner ;
4152 this .rootFolder = rootFolder ;
4253 this .onlineExchange = onlineExchange ;
4354 this .maxExecutionTime = maxExecutionTime ;
55+ this .supportFormatsList = supportFormatsList ;
4456 }
4557
4658 public ASAPServiceCreationIntent (Intent intent ) {
@@ -53,7 +65,7 @@ public ASAPServiceCreationIntent(Intent intent) {
5365 ASAP .ONLINE_EXCHANGE_DEFAULT );
5466 this .maxExecutionTime = intent .getLongExtra (ASAP .MAX_EXECUTION_TIME ,
5567 MultiASAPEngineFS .DEFAULT_MAX_PROCESSING_TIME );
56-
68+ this . supportFormatsList = intent . getCharSequenceArrayListExtra ( ASAP . SUPPORTED_FORMATS );
5769 }
5870
5971 public CharSequence getOwner () {
@@ -72,6 +84,10 @@ public long getMaxExecutionTime() {
7284 return this .maxExecutionTime ;
7385 }
7486
87+ public ArrayList getSupportedFormats () {
88+ return this .supportFormatsList ;
89+ }
90+
7591 public String toString () {
7692 StringBuilder sb = new StringBuilder ();
7793
@@ -83,8 +99,9 @@ public String toString() {
8399 sb .append (this .onlineExchange );
84100 sb .append (" | maxExecutionTime: " );
85101 sb .append (this .maxExecutionTime );
102+ sb .append (" | supportedFormats: " );
103+ sb .append (this .supportFormatsList );
86104
87105 return sb .toString ();
88106 }
89-
90107}
0 commit comments