@@ -77,18 +77,12 @@ public class SdlService {
7777
7878 private static final String IMAGE_DIR = "assets/images/" ;
7979
80-
81-
8280 // variable to create and call functions of the SyncProxy
8381 private SdlManager sdlManager = null ;
8482 private List <ChoiceCell > choiceCellList ;
8583
8684 private SdlServiceCallback callback ;
8785
88- private ButtonName [] buttonNames = {ButtonName .PLAY_PAUSE , ButtonName .SEEKLEFT , ButtonName .SEEKRIGHT , ButtonName .AC_MAX , ButtonName .AC , ButtonName .RECIRCULATE ,
89- ButtonName .FAN_UP , ButtonName .FAN_DOWN , ButtonName .TEMP_UP , ButtonName .FAN_DOWN , ButtonName .DEFROST_MAX , ButtonName .DEFROST_REAR , ButtonName .DEFROST ,
90- ButtonName .UPPER_VENT , ButtonName .LOWER_VENT , ButtonName .VOLUME_UP , ButtonName .VOLUME_DOWN , ButtonName .EJECT , ButtonName .SOURCE , ButtonName .SHUFFLE , ButtonName .REPEAT }; private OnButtonListener onButtonListener ;
91-
9286 public SdlService (BaseTransportConfig config , SdlServiceCallback callback ){
9387 this .callback = callback ;
9488 buildSdlManager (config );
@@ -334,7 +328,11 @@ public void onComplete(boolean success) {
334328 * Attempts to Subscribe to all preset buttons
335329 */
336330 private void subscribeToButtons () {
337- onButtonListener = new OnButtonListener () {
331+ ButtonName [] buttonNames = {ButtonName .PLAY_PAUSE , ButtonName .SEEKLEFT , ButtonName .SEEKRIGHT , ButtonName .AC_MAX , ButtonName .AC , ButtonName .RECIRCULATE ,
332+ ButtonName .FAN_UP , ButtonName .FAN_DOWN , ButtonName .TEMP_UP , ButtonName .FAN_DOWN , ButtonName .DEFROST_MAX , ButtonName .DEFROST_REAR , ButtonName .DEFROST ,
333+ ButtonName .UPPER_VENT , ButtonName .LOWER_VENT , ButtonName .VOLUME_UP , ButtonName .VOLUME_DOWN , ButtonName .EJECT , ButtonName .SOURCE , ButtonName .SHUFFLE , ButtonName .REPEAT };
334+
335+ OnButtonListener onButtonListener = new OnButtonListener () {
338336 @ Override
339337 public void onPress (ButtonName buttonName , OnButtonPress buttonPress ) {
340338 sdlManager .getScreenManager ().setTextField1 ("Subscribed Button Named: " + buttonName + " was pressed" );
@@ -356,15 +354,6 @@ public void onError(String info) {
356354 }
357355 }
358356
359- /**
360- * Attempts to Unsubscribe to all preset Buttons
361- */
362- private void unsubscribeToPresetButtons () {
363- for (ButtonName buttonName : buttonNames ) {
364- sdlManager .getScreenManager ().removeButtonListener (buttonName , onButtonListener );
365- }
366- }
367-
368357 /**
369358 * Will show a sample test message on screen as well as speak a sample test message
370359 */
0 commit comments