@@ -60,10 +60,8 @@ public class SdlService extends Service {
6060
6161 private static final String TAG = "SDL Service" ;
6262
63- private static final String APP_NAME = "Hello Sdl" ;
6463 private static final String APP_NAME_ES = "Hola Sdl" ;
6564 private static final String APP_NAME_FR = "Bonjour Sdl" ;
66- private static final String APP_ID = "8678309" ;
6765
6866 private static final String ICON_FILENAME = "hello_sdl_icon.png" ;
6967 private static final String SDL_IMAGE_FILENAME = "sdl_full_image.png" ;
@@ -105,7 +103,7 @@ public void onCreate() {
105103 public void enterForeground () {
106104 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
107105 try {
108- NotificationChannel channel = new NotificationChannel (APP_ID , "SdlService" , NotificationManager .IMPORTANCE_DEFAULT );
106+ NotificationChannel channel = new NotificationChannel (BuildConfig . SDL_APP_ID , "SdlService" , NotificationManager .IMPORTANCE_DEFAULT );
109107 NotificationManager notificationManager = (NotificationManager ) getSystemService (Context .NOTIFICATION_SERVICE );
110108 if (notificationManager != null ) {
111109 notificationManager .createNotificationChannel (channel );
@@ -168,14 +166,14 @@ private void startProxy() {
168166 } else {
169167 securityLevel = MultiplexTransportConfig .FLAG_MULTI_SECURITY_OFF ;
170168 }
171- transport = new MultiplexTransportConfig (this , APP_ID , securityLevel );
169+ transport = new MultiplexTransportConfig (this , BuildConfig . SDL_APP_ID , securityLevel );
172170 if (BuildConfig .REQUIRE_AUDIO_OUTPUT .equals ("TRUE" ) ) {
173171 ((MultiplexTransportConfig )transport ).setRequiresAudioSupport (true );
174172 }
175173 } else if (BuildConfig .TRANSPORT .equals ("TCP" )) {
176174 transport = new TCPTransportConfig (TCP_PORT , DEV_MACHINE_IP_ADDRESS , true );
177175 } else if (BuildConfig .TRANSPORT .equals ("MULTI_HB" )) {
178- MultiplexTransportConfig mtc = new MultiplexTransportConfig (this , APP_ID , MultiplexTransportConfig .FLAG_MULTI_SECURITY_OFF );
176+ MultiplexTransportConfig mtc = new MultiplexTransportConfig (this , BuildConfig . SDL_APP_ID , MultiplexTransportConfig .FLAG_MULTI_SECURITY_OFF );
179177 mtc .setRequiresHighBandwidth (true );
180178 transport = mtc ;
181179 }
@@ -222,8 +220,8 @@ public void onError(String info, Exception e) {
222220 @ Override
223221 public LifecycleConfigurationUpdate managerShouldUpdateLifecycle (Language language , Language hmiLanguage ) {
224222 boolean isNeedUpdate = false ;
225- String appName = APP_NAME ;
226- String ttsName = APP_NAME ;
223+ String appName = BuildConfig . SDL_APP_NAME ;
224+ String ttsName = BuildConfig . SDL_APP_NAME ;
227225 switch (language ) {
228226 case ES_MX :
229227 isNeedUpdate = true ;
@@ -267,7 +265,7 @@ public boolean onSystemInfoReceived(SystemInfo systemInfo) {
267265 SdlArtwork appIcon = new SdlArtwork (ICON_FILENAME , FileType .GRAPHIC_PNG , R .mipmap .ic_launcher , true );
268266
269267 // The manager builder sets options for your session
270- SdlManager .Builder builder = new SdlManager .Builder (this , APP_ID , APP_NAME , listener );
268+ SdlManager .Builder builder = new SdlManager .Builder (this , BuildConfig . SDL_APP_ID , BuildConfig . SDL_APP_NAME , listener );
271269 builder .setAppTypes (appType );
272270 builder .setTransportType (transport );
273271 builder .setAppIcon (appIcon );
@@ -382,7 +380,7 @@ private void performWelcomeSpeak() {
382380 */
383381 private void performWelcomeShow () {
384382 sdlManager .getScreenManager ().beginTransaction ();
385- sdlManager .getScreenManager ().setTextField1 (APP_NAME );
383+ sdlManager .getScreenManager ().setTextField1 (BuildConfig . SDL_APP_NAME );
386384 sdlManager .getScreenManager ().setTextField2 (WELCOME_SHOW );
387385 sdlManager .getScreenManager ().setPrimaryGraphic (new SdlArtwork (SDL_IMAGE_FILENAME , FileType .GRAPHIC_PNG , R .drawable .sdl , true ));
388386 sdlManager .getScreenManager ().commit (new CompletionListener () {
0 commit comments