@@ -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" ;
@@ -104,7 +102,7 @@ public void onCreate() {
104102 @ SuppressLint ("NewApi" )
105103 public void enterForeground () {
106104 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O ) {
107- NotificationChannel channel = new NotificationChannel (APP_ID , "SdlService" , NotificationManager .IMPORTANCE_DEFAULT );
105+ NotificationChannel channel = new NotificationChannel (BuildConfig . SDL_APP_ID , "SdlService" , NotificationManager .IMPORTANCE_DEFAULT );
108106 NotificationManager notificationManager = (NotificationManager ) getSystemService (Context .NOTIFICATION_SERVICE );
109107 if (notificationManager != null ) {
110108 notificationManager .createNotificationChannel (channel );
@@ -161,14 +159,14 @@ private void startProxy() {
161159 } else {
162160 securityLevel = MultiplexTransportConfig .FLAG_MULTI_SECURITY_OFF ;
163161 }
164- transport = new MultiplexTransportConfig (this , APP_ID , securityLevel );
162+ transport = new MultiplexTransportConfig (this , BuildConfig . SDL_APP_ID , securityLevel );
165163 if (BuildConfig .REQUIRE_AUDIO_OUTPUT .equals ("TRUE" ) ) {
166164 ((MultiplexTransportConfig )transport ).setRequiresAudioSupport (true );
167165 }
168166 } else if (BuildConfig .TRANSPORT .equals ("TCP" )) {
169167 transport = new TCPTransportConfig (TCP_PORT , DEV_MACHINE_IP_ADDRESS , true );
170168 } else if (BuildConfig .TRANSPORT .equals ("MULTI_HB" )) {
171- MultiplexTransportConfig mtc = new MultiplexTransportConfig (this , APP_ID , MultiplexTransportConfig .FLAG_MULTI_SECURITY_OFF );
169+ MultiplexTransportConfig mtc = new MultiplexTransportConfig (this , BuildConfig . SDL_APP_ID , MultiplexTransportConfig .FLAG_MULTI_SECURITY_OFF );
172170 mtc .setRequiresHighBandwidth (true );
173171 transport = mtc ;
174172 }
@@ -215,8 +213,8 @@ public void onError(String info, Exception e) {
215213 @ Override
216214 public LifecycleConfigurationUpdate managerShouldUpdateLifecycle (Language language , Language hmiLanguage ) {
217215 boolean isNeedUpdate = false ;
218- String appName = APP_NAME ;
219- String ttsName = APP_NAME ;
216+ String appName = BuildConfig . SDL_APP_NAME ;
217+ String ttsName = BuildConfig . SDL_APP_NAME ;
220218 switch (language ) {
221219 case ES_MX :
222220 isNeedUpdate = true ;
@@ -260,7 +258,7 @@ public boolean onSystemInfoReceived(SystemInfo systemInfo) {
260258 SdlArtwork appIcon = new SdlArtwork (ICON_FILENAME , FileType .GRAPHIC_PNG , R .mipmap .ic_launcher , true );
261259
262260 // The manager builder sets options for your session
263- SdlManager .Builder builder = new SdlManager .Builder (this , APP_ID , APP_NAME , listener );
261+ SdlManager .Builder builder = new SdlManager .Builder (this , BuildConfig . SDL_APP_ID , BuildConfig . SDL_APP_NAME , listener );
264262 builder .setAppTypes (appType );
265263 builder .setTransportType (transport );
266264 builder .setAppIcon (appIcon );
@@ -375,7 +373,7 @@ private void performWelcomeSpeak() {
375373 */
376374 private void performWelcomeShow () {
377375 sdlManager .getScreenManager ().beginTransaction ();
378- sdlManager .getScreenManager ().setTextField1 (APP_NAME );
376+ sdlManager .getScreenManager ().setTextField1 (BuildConfig . SDL_APP_NAME );
379377 sdlManager .getScreenManager ().setTextField2 (WELCOME_SHOW );
380378 sdlManager .getScreenManager ().setPrimaryGraphic (new SdlArtwork (SDL_IMAGE_FILENAME , FileType .GRAPHIC_PNG , R .drawable .sdl , true ));
381379 sdlManager .getScreenManager ().commit (new CompletionListener () {
0 commit comments