com.smartdevicelink.proxy.rpc.ChangeRegistration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdl_java_se Show documentation
Show all versions of sdl_java_se Show documentation
The app library component of SDL is meant to run on the end userâs smart-device from within SDL enabled apps, as an embedded app, or connected to the cloud. App libraries allow the apps to connect to SDL enabled head-units and hardware through bluetooth, USB, and TCP for Android, and cloud and embedded apps can connect through web sockets, Java Beans, and other custom transports. Once the library establishes a connection between the smart device and head-unit through the preferred method of transport, the two components are able to communicate using the SDL defined protocol. The app integrating this library project is then able to expose its functionality to the head-unit through text, media, and other interactive elements.
/*
* Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package com.smartdevicelink.proxy.rpc;
import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.proxy.rpc.enums.Language;
import java.util.Hashtable;
import java.util.List;
/**
* If the app recognizes during the app registration that the SDL HMI language
* (voice/TTS and/or display) does not match the app language, the app will be
* able (but does not need) to change this registration with changeRegistration
* prior to app being brought into focus.
*
* Function Group: Base
*
* HMILevel can by any
*
* Note:
*
* SDL will send the language value confirmed to be supported by HMI via UI.GetCapabilities.
* Parameter List
*
*
*
* Name
* Type
* Description
* Req.
* Notes
* Version Available
*
*
* Language
* Language
* Requested SDL voice engine (VR+TTS) language registration.
* Y
*
* SmartDeviceLink 2.0
*
*
* hmiDisplayLanguage
* Language
* Request display language registration.
* Y
* Minvalue=0; Maxvalue=2000000000
* SmartDeviceLink 2.0
*
*
*
* appName
* String
* Request new app name registration
* N
* maxlength:100
* SmartDeviceLink 2.0
*
*
* ttsName
* TTSChunk
* Request new ttsName registration
* N
* minsize:1; maxsize:100
* SmartDeviceLink 2.0
*
*
* ngnMediaScreenAppName
* String
* Request new app short name registration
* N
* maxlength: 100
* SmartDeviceLink 2.0
*
*
* vrSynonyms
* String
* Request new VR synonyms registration
* N
* maxlength: 40; minsize:1; maxsize:100
* SmartDeviceLink 2.0
*
*
*
* Response
*
* Non-default Result Codes:
* SUCCESS
* INVALID_DATA
* OUT_OF_MEMORY
* TOO_MANY_PENDING_REQUESTS
* APPLICATION_NOT_REGISTERED
* GENERIC_ERROR
* REJECTED
* DISALLOWED
*
* @see RegisterAppInterface
* @since SmartDeviceLink 2.0
*/
public class ChangeRegistration extends RPCRequest {
public static final String KEY_LANGUAGE = "language";
public static final String KEY_HMI_DISPLAY_LANGUAGE = "hmiDisplayLanguage";
public static final String KEY_APP_NAME = "appName";
public static final String KEY_TTS_NAME = "ttsName";
public static final String KEY_NGN_MEDIA_SCREEN_NAME = "ngnMediaScreenAppName";
public static final String KEY_VR_SYNONYMS = "vrSynonyms";
/**
* Constructs a new ChangeRegistration object
*/
public ChangeRegistration() {
super(FunctionID.CHANGE_REGISTRATION.toString());
}
/**
* Constructs a new ChangeRegistration object indicated by the Hashtable
* parameter
*
* @param hash The Hashtable to use
*/
public ChangeRegistration(Hashtable hash) {
super(hash);
}
/**
* Constructs a new ChangeRegistration object
*
* @param language a language value
* @param hmiDisplayLanguage a Language value
*/
public ChangeRegistration(@NonNull Language language, @NonNull Language hmiDisplayLanguage) {
this();
setLanguage(language);
setHmiDisplayLanguage(hmiDisplayLanguage);
}
/**
* Sets language
*
* @param language a language value
*/
public ChangeRegistration setLanguage(@NonNull Language language) {
setParameters(KEY_LANGUAGE, language);
return this;
}
/**
* Gets language
*
* @return Language -a Language value
*/
public Language getLanguage() {
return (Language) getObject(Language.class, KEY_LANGUAGE);
}
/**
* Sets HMI display language
*
* @param hmiDisplayLanguage a Language value
*/
public ChangeRegistration setHmiDisplayLanguage(@NonNull Language hmiDisplayLanguage) {
setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
return this;
}
/**
* Gets HMI display language
*
* @return Language -a Language value
*/
public Language getHmiDisplayLanguage() {
return (Language) getObject(Language.class, KEY_HMI_DISPLAY_LANGUAGE);
}
/**
* Sets app name
*
* @param appName App name to set
*/
public ChangeRegistration setAppName(String appName) {
setParameters(KEY_APP_NAME, appName);
return this;
}
/**
* Gets app name
*
* @return The app name
*/
public String getAppName() {
return getString(KEY_APP_NAME);
}
/**
* Sets NGN media screen app name
*
* @param ngnAppName The NGN app name
*/
public ChangeRegistration setNgnMediaScreenAppName(String ngnAppName) {
setParameters(KEY_NGN_MEDIA_SCREEN_NAME, ngnAppName);
return this;
}
/**
* Gets NGN media screen app name
*
* @return The NGN app name
*/
public String getNgnMediaScreenAppName() {
return getString(KEY_NGN_MEDIA_SCREEN_NAME);
}
/**
* Sets the TTS name
*
* @param ttsName The TTS name to set
*/
public ChangeRegistration setTtsName(List ttsName) {
setParameters(KEY_TTS_NAME, ttsName);
return this;
}
/**
* Gets the TTS name
*
* @return The TTS name
*/
@SuppressWarnings("unchecked")
public List getTtsName() {
return (List) getObject(TTSChunk.class, KEY_TTS_NAME);
}
/**
* Gets the List representing the an array of 1-100 elements, each
* element containing a voice-recognition synonym
*
* @return List -a List value representing the an array of
* 1-100 elements, each element containing a voice-recognition
* synonym
*/
@SuppressWarnings("unchecked")
public List getVrSynonyms() {
return (List) getObject(String.class, KEY_VR_SYNONYMS);
}
/**
* Sets a vrSynonyms representing the an array of 1-100 elements, each
* element containing a voice-recognition synonym
*
* @param vrSynonyms a List value representing the an array of 1-100
* elements
*
* Notes:
*
* - Each vr synonym is limited to 40 characters, and there can
* be 1-100 synonyms in array
* - May not be the same (by case insensitive comparison) as
* the name or any synonym of any currently-registered
* application
*
*/
public ChangeRegistration setVrSynonyms(List vrSynonyms) {
setParameters(KEY_VR_SYNONYMS, vrSynonyms);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy