本文整理汇总了Java中com.smartdevicelink.proxy.rpc.enums.Language类的典型用法代码示例。如果您正苦于以下问题:Java Language类的具体用法?Java Language怎么用?Java Language使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Language类属于com.smartdevicelink.proxy.rpc.enums包,在下文中一共展示了Language类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SdlProxyALM
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
/**
* @deprecated
* Constructor for the SdlProxy object, the proxy for communicating between the App and SDL
*
* Takes advantage of the advanced lifecycle management.
* @param listener - Reference to the object in the App listening to callbacks from SDL.
* @param appName - Name of the application displayed on SDL.
* @param isMediaApp - Indicates if the app is a media application.
*/
@Deprecated
public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,
Language languageDesired, Language hmiDisplayLanguageDesired, String appID) throws SdlException {
super( listener,
/*sdl proxy configuration resources*/null,
/*enable advanced lifecycle management*/true,
appName,
/*TTS Name*/null,
/*ngn media app*/null,
/*vr synonyms*/null,
/*is media app*/isMediaApp,
/*sdlMsgVersion*/null,
/*language desired*/languageDesired,
/*HMI Display Language Desired*/hmiDisplayLanguageDesired,
/*App Type*/null,
/*App ID*/appID,
/*autoActivateID*/null,
/*callbackToUIThread*/ false,
new BTTransportConfig());
}
示例2: testBuildChangeRegistration
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
public void testBuildChangeRegistration () {
Language testLang = Language.EN_US, testHMILang = Language.EN_AU;
Integer testCorrelationID = 0;
ChangeRegistration testCR;
// Test -- BuildChangeRegistration(Language language, Language hmiDisplayLanguage, Integer correlationID)
testCR = RPCRequestFactory.BuildChangeRegistration(testLang, testHMILang, testCorrelationID);
assertEquals(Test.MATCH, testLang, testCR.getLanguage());
assertEquals(Test.MATCH, testHMILang, testCR.getHmiDisplayLanguage());
assertEquals(Test.MATCH, testCorrelationID, testCR.getCorrelationID());
testCR = RPCRequestFactory.BuildChangeRegistration(null, null, null);
assertNull(Test.NULL, testCR.getLanguage());
assertNull(Test.NULL, testCR.getHmiDisplayLanguage());
assertNotNull(Test.NOT_NULL, testCR.getCorrelationID());
}
示例3: SdlProxyBase
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName,
String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion,
Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID,
String autoActivateID, boolean callbackToUIThread, boolean preRegister, String sHashID, Boolean bEnableResume, BaseTransportConfig transportConfig)
throws SdlException
{
performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, callbackToUIThread, preRegister, sHashID, bEnableResume, transportConfig);
}
示例4: registerAppInterfacePrivate
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
protected void registerAppInterfacePrivate(
SdlMsgVersion sdlMsgVersion, String appName, Vector<TTSChunk> ttsName,
String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,
String appID, Integer correlationID)
throws SdlException {
String carrierName = null;
if(telephonyManager != null){
carrierName = telephonyManager.getNetworkOperatorName();
}
deviceInfo = RPCRequestFactory.BuildDeviceInfo(carrierName);
RegisterAppInterface msg = RPCRequestFactory.buildRegisterAppInterface(
sdlMsgVersion, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
languageDesired, hmiDisplayLanguageDesired, appType, appID, correlationID, deviceInfo);
if (_bAppResumeEnabled)
{
if (_lastHashID != null)
msg.setHashID(_lastHashID);
}
Intent sendIntent = createBroadcastIntent();
updateBroadcastIntent(sendIntent, "RPC_NAME", FunctionID.REGISTER_APP_INTERFACE.toString());
updateBroadcastIntent(sendIntent, "TYPE", RPCMessage.KEY_REQUEST);
updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());
updateBroadcastIntent(sendIntent, "DATA",serializeJSON(msg));
sendBroadcastIntent(sendIntent);
sendRPCRequestPrivate(msg);
}
示例5: getSdlLanguage
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
/**
* Gets sdlLanguage set when application interface is registered.
*
* @return sdlLanguage
* @throws SdlException
*/
public Language getSdlLanguage() throws SdlException {
// Test if proxy has been disposed
if (_proxyDisposed) {
throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
}
// Test SDL availability
if (!_appInterfaceRegisterd) {
throw new SdlException("SDL is unavailable. Unable to get the sdlLanguage.", SdlExceptionCause.SDL_UNAVAILABLE);
}
return _sdlLanguage;
}
示例6: getHmiDisplayLanguage
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
/**
* Gets getHmiDisplayLanguage set when application interface is registered.
*
* @return hmiDisplayLanguage
* @throws SdlException
*/
public Language getHmiDisplayLanguage() throws SdlException {
// Test if proxy has been disposed
if (_proxyDisposed) {
throw new SdlException("This object has been disposed, it is no long capable of executing methods.", SdlExceptionCause.SDL_PROXY_DISPOSED);
}
// Test SDL availability
if (!_appInterfaceRegisterd) {
throw new SdlException("SDL is not connected. Unable to get the hmiDisplayLanguage.", SdlExceptionCause.SDL_UNAVAILABLE);
}
return _hmiDisplayLanguage;
}
示例7: BuildChangeRegistration
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
public static ChangeRegistration BuildChangeRegistration(Language language, Language hmiDisplayLanguage, Integer correlationID)
{
ChangeRegistration msg = new ChangeRegistration();
msg.setCorrelationID(correlationID);
msg.setLanguage(language);
msg.setHmiDisplayLanguage(hmiDisplayLanguage);
return msg;
}
示例8: testInvalidEnum
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
/**
* Verifies that an invalid assignment is null.
*/
public void testInvalidEnum () {
String example = "eN-Us";
try {
Language temp = Language.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (IllegalArgumentException exception) {
fail("Invalid enum throws IllegalArgumentException.");
}
}
示例9: testNullEnum
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
/**
* Verifies that a null assignment is invalid.
*/
public void testNullEnum () {
String example = null;
try {
Language temp = Language.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (NullPointerException exception) {
fail("Null string throws NullPointerException.");
}
}
示例10: getLanguage
import com.smartdevicelink.proxy.rpc.enums.Language; //导入依赖的package包/类
public Language getLanguage() {
return (Language) getObject(Language.class, KEY_LANGUAGE);
}