@@ -371,7 +371,7 @@ static string ToString (ForegroundService value)
371371 // This attribute allows multiple values
372372 var values = new List < string > ( ) ;
373373
374- /* if (value.HasFlag (ForegroundService.TypeConnectedDevice))
374+ if ( value . HasFlag ( ForegroundService . TypeConnectedDevice ) )
375375 values . Add ( "connectedDevice" ) ;
376376 if ( value . HasFlag ( ForegroundService . TypeDataSync ) )
377377 values . Add ( "dataSync" ) ;
@@ -396,19 +396,13 @@ static string ToString (ForegroundService value)
396396 if ( value . HasFlag ( ForegroundService . TypeShortService ) )
397397 values . Add ( "shortService" ) ;
398398 if ( value . HasFlag ( ForegroundService . TypeSpecialUse ) )
399- values.Add ("specialUse");*/
400-
401- foreach ( ForegroundService fs in Enum . GetValues ( typeof ( ForegroundService ) ) ) {
402- if ( fs == ForegroundService . TypeManifest )
403- continue ;
404- if ( fs == ForegroundService . TypeNone )
405- continue ;
406- if ( ( value & fs ) != 0 ) {
407- var name = fs . ToString ( ) . Replace ( "Type" , string . Empty ) ;
408- var firstChar = char . ToLower ( name [ 0 ] ) ;
409- values . Add ( $ "{ firstChar } { name . Substring ( 1 ) } ") ;
410- }
411- }
399+ values . Add ( "specialUse" ) ;
400+
401+ // When including a non-stable value you can cast the integer value
402+ // to ForegroundService. We need to do this because the Build.Tasks
403+ // only build against the latest STABLE api.
404+ //if (value.HasFlag (ForegroundService()128))
405+ // values.Add ("newValue");
412406
413407 return string . Join ( "|" , values . ToArray ( ) ) ;
414408 }
0 commit comments