本文整理汇总了Java中com.smartdevicelink.proxy.rpc.enums.AppHMIType类的典型用法代码示例。如果您正苦于以下问题:Java AppHMIType类的具体用法?Java AppHMIType怎么用?Java AppHMIType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AppHMIType类属于com.smartdevicelink.proxy.rpc.enums包,在下文中一共展示了AppHMIType类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testListEnum
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
/**
* Verifies the possible enum values of AmbientLightStatus.
*/
public void testListEnum() {
List<AppHMIType> enumValueList = Arrays.asList(AppHMIType.values());
List<AppHMIType> enumTestList = new ArrayList<AppHMIType>();
enumTestList.add(AppHMIType.DEFAULT);
enumTestList.add(AppHMIType.COMMUNICATION);
enumTestList.add(AppHMIType.MEDIA);
enumTestList.add(AppHMIType.MESSAGING);
enumTestList.add(AppHMIType.NAVIGATION);
enumTestList.add(AppHMIType.INFORMATION);
enumTestList.add(AppHMIType.SOCIAL);
enumTestList.add(AppHMIType.BACKGROUND_PROCESS);
enumTestList.add(AppHMIType.PROJECTION);
enumTestList.add(AppHMIType.TESTING);
enumTestList.add(AppHMIType.SYSTEM);
enumTestList.add(AppHMIType.REMOTE_CONTROL);
assertTrue("Enum value list does not match enum class list",
enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
}
示例2: SdlProxyBase
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的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);
}
示例3: registerAppInterfacePrivate
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的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);
}
示例4: SdlProxyALM
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
/**
* @deprecated
* Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
*
* Takes advantage of the advanced lifecycle management.
*
* @param listener Reference to the object in the App listening to callbacks from SDL.
* @param sdlProxyConfigurationResources Proxy configuration resources.
* @param appName Name of the application displayed on SDL.
* @param ttsName TTS name.
* @param ngnMediaScreenAppName Name of the application displayed on SDL for Navigation equipped
* vehicles. Limited to five characters.
* @param vrSynonyms A vector of strings, all of which can be used as voice commands too
* @param isMediaApp Indicates if the app is a media application.
* @param sdlMsgVersion Indicates the version of SDL SmartDeviceLink Messages desired. Must be less than
* or equal to the version of SDL SmartDeviceLink running on the vehicle.
* @param languageDesired Indicates the language desired for the SDL interface.
* @param hmiDisplayLanguageDesired Desired language in HMI.
* @param appType Type of application.
* @param appID Identifier of the client application.
* @param autoActivateID ID used to re-register previously registered application.
* @param callbackToUIThread If true, all callbacks will occur on the UI thread.
* @param preRegister Flag that indicates that client should be pre-registred or not
* @throws SdlException
*/
@Deprecated
public SdlProxyALM(IProxyListenerALM listener, SdlProxyConfigurationResources sdlProxyConfigurationResources,
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) throws SdlException {
super( listener,
sdlProxyConfigurationResources,
/*enable advanced lifecycle management*/true,
appName,
ttsName,
ngnMediaScreenAppName,
vrSynonyms,
isMediaApp,
sdlMsgVersion,
languageDesired,
/*HMI Display Language Desired*/hmiDisplayLanguageDesired,
/*App Type*/appType,
/*App ID*/appID,
autoActivateID,
callbackToUIThread,
preRegister,
new BTTransportConfig());
SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, sdlProxyConfigurationResources, " +
"appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, sdlMsgVersion, languageDesired, appType, appID, autoActivateID, " +
"callbackToUIThread and version", SDL_LIB_TRACE_KEY);
}
示例5: testValidEnums
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
/**
* Verifies that the enum values are not null upon valid assignment.
*/
public void testValidEnums () {
String example = "DEFAULT";
AppHMIType enumDefault = AppHMIType.valueForString(example);
example = "COMMUNICATION";
AppHMIType enumCommunication = AppHMIType.valueForString(example);
example = "MEDIA";
AppHMIType enumMedia = AppHMIType.valueForString(example);
example = "MESSAGING";
AppHMIType enumMessaging = AppHMIType.valueForString(example);
example = "NAVIGATION";
AppHMIType enumNavigation = AppHMIType.valueForString(example);
example = "INFORMATION";
AppHMIType enumInformation = AppHMIType.valueForString(example);
example = "SOCIAL";
AppHMIType enumSocial = AppHMIType.valueForString(example);
example = "BACKGROUND_PROCESS";
AppHMIType enumBackgroundProcess = AppHMIType.valueForString(example);
example = "PROJECTION";
AppHMIType enumProjection = AppHMIType.valueForString(example);
example = "TESTING";
AppHMIType enumTesting = AppHMIType.valueForString(example);
example = "SYSTEM";
AppHMIType enumSystem = AppHMIType.valueForString(example);
example = "REMOTE_CONTROL";
AppHMIType enumRemoteControl = AppHMIType.valueForString(example);
assertNotNull("DEFAULT returned null", enumDefault);
assertNotNull("COMMUNICATION returned null", enumCommunication);
assertNotNull("MEDIA returned null", enumMedia);
assertNotNull("MESSAGING returned null", enumMessaging);
assertNotNull("NAVIGATION returned null", enumNavigation);
assertNotNull("INFORMATION returned null", enumInformation);
assertNotNull("SOCIAL returned null", enumSocial);
assertNotNull("BACKGROUND_PROCESS returned null", enumBackgroundProcess);
assertNotNull("PROJECTION returned null", enumProjection);
assertNotNull("TESTING returned null", enumTesting);
assertNotNull("SYSTEM returned null", enumSystem);
assertNotNull("REMOTE_CONTROL returned null", enumRemoteControl);
}
示例6: testInvalidEnum
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
/**
* Verifies that an invalid assignment is null.
*/
public void testInvalidEnum () {
String example = "deFaUlt";
try {
AppHMIType temp = AppHMIType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (IllegalArgumentException exception) {
fail("Invalid enum throws IllegalArgumentException.");
}
}
示例7: testNullEnum
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
/**
* Verifies that a null assignment is invalid.
*/
public void testNullEnum () {
String example = null;
try {
AppHMIType temp = AppHMIType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
}
catch (NullPointerException exception) {
fail("Null string throws NullPointerException.");
}
}
示例8: setVrAppHMITypes
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
public Builder setVrAppHMITypes(Vector<AppHMIType> val)
{ vrAppHMITypes = val; return this; }
示例9: buildRegisterAppInterface
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
public static RegisterAppInterface buildRegisterAppInterface(
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, DeviceInfo deviceInfo) {
RegisterAppInterface msg = new RegisterAppInterface();
if (correlationID == null) {
correlationID = 1;
}
msg.setCorrelationID(correlationID);
if (sdlMsgVersion == null) {
sdlMsgVersion = new SdlMsgVersion();
sdlMsgVersion.setMajorVersion(Integer.valueOf(SDL_MSG_MAJOR_VERSION));
sdlMsgVersion.setMinorVersion(Integer.valueOf(SDL_MSG_MINOR_VERSION));
}
msg.setSdlMsgVersion(sdlMsgVersion);
msg.setDeviceInfo(deviceInfo);
msg.setAppName(appName);
msg.setTtsName(ttsName);
if (ngnMediaScreenAppName == null) {
ngnMediaScreenAppName = appName;
}
msg.setNgnMediaScreenAppName(ngnMediaScreenAppName);
if (vrSynonyms == null) {
vrSynonyms = new Vector<String>();
vrSynonyms.add(appName);
}
msg.setVrSynonyms(vrSynonyms);
msg.setIsMediaApplication(isMediaApp);
if (languageDesired == null) {
languageDesired = Language.EN_US;
}
msg.setLanguageDesired(languageDesired);
if (hmiDisplayLanguageDesired == null) {
hmiDisplayLanguageDesired = Language.EN_US;
}
msg.setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
msg.setAppHMIType(appType);
msg.setAppID(appID);
return msg;
}
示例10: testJsonConstructor
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
/**
* Tests a valid JSON construction of this RPC message.
*/
public void testJsonConstructor () {
JSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());
assertNotNull(Test.NOT_NULL, commandJson);
try {
Hashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);
RegisterAppInterface cmd = new RegisterAppInterface(hash);
JSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());
assertNotNull(Test.NOT_NULL, body);
// Test everything in the json body.
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());
assertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());
JSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);
JSONArray ttsNameArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterface.KEY_TTS_NAME);
List<TTSChunk> ttsNameList = new ArrayList<TTSChunk>();
for (int index = 0; index < ttsNameArray.length(); index++) {
TTSChunk chunk = new TTSChunk(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)ttsNameArray.get(index)) );
ttsNameList.add(chunk);
}
assertTrue(Test.TRUE, Validator.validateTtsChunks(ttsNameList, cmd.getTtsName()));
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HMI_DISPLAY_LANGUAGE_DESIRED), cmd.getHmiDisplayLanguageDesired().toString());
JSONArray appHmiTypeArray = JsonUtils.readJsonArrayFromJsonObject(parameters, RegisterAppInterface.KEY_APP_HMI_TYPE);
for (int index = 0; index < appHmiTypeArray.length(); index++) {
AppHMIType appHmiTypeItem = AppHMIType.valueForString( appHmiTypeArray.get(index).toString() );
assertEquals(Test.MATCH, appHmiTypeItem, cmd.getAppHMIType().get(index) );
}
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_ID), cmd.getAppID());
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_LANGUAGE_DESIRED), cmd.getLanguageDesired().toString());
JSONObject deviceInfoObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_DEVICE_INFO);
DeviceInfo deviceInfo = new DeviceInfo(JsonRPCMarshaller.deserializeJSONObject(deviceInfoObj));
assertTrue(Test.TRUE, Validator.validateDeviceInfo(deviceInfo, cmd.getDeviceInfo()) );
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_APP_NAME), cmd.getAppName());
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_NGN_MEDIA_SCREEN_APP_NAME), cmd.getNgnMediaScreenAppName());
assertEquals(Test.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, RegisterAppInterface.KEY_IS_MEDIA_APPLICATION), cmd.getIsMediaApplication());
List<String> vrSynonymsList = JsonUtils.readStringListFromJsonObject(parameters, RegisterAppInterface.KEY_VR_SYNONYMS);
List<String> testSynonymsList = cmd.getVrSynonyms();
assertEquals(Test.MATCH, vrSynonymsList.size(), testSynonymsList.size());
assertTrue(Test.TRUE, Validator.validateStringList(vrSynonymsList, testSynonymsList));
JSONObject sdlMsgVersionObj = JsonUtils.readJsonObjectFromJsonObject(parameters, RegisterAppInterface.KEY_SDL_MSG_VERSION);
SdlMsgVersion sdlMsgVersion = new SdlMsgVersion(JsonRPCMarshaller.deserializeJSONObject(sdlMsgVersionObj));
assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(sdlMsgVersion, cmd.getSdlMsgVersion()) );
assertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(parameters, RegisterAppInterface.KEY_HASH_ID), cmd.getHashID());
} catch (JSONException e) {
fail(Test.JSON_FAIL);
}
}
示例11: testBuildRegisterAppInterface
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
public void testBuildRegisterAppInterface () {
SdlMsgVersion testSMV = new SdlMsgVersion();
testSMV.setMajorVersion(1);
testSMV.setMinorVersion(0);
String testAppName = "test", testNGN = "ngn", testAppID = "id";
Vector<TTSChunk> testTTSName = TTSChunkFactory.createSimpleTTSChunks("name");
Vector<String> testSynonyms = new Vector<String>();
testSynonyms.add("examine");
Boolean testIMA = false;
Integer testCorrelationID = 0;
Language testLang = Language.EN_US, testHMILang = Language.EN_GB;
Vector<AppHMIType> testHMIType = new Vector<AppHMIType>();
testHMIType.add(AppHMIType.DEFAULT);
DeviceInfo testDI = RPCRequestFactory.BuildDeviceInfo(null);
RegisterAppInterface testRAI;
// Test -- buildRegisterAppInterface(String appName, String appID)
// ^ Calls another build method.
// Test -- buildRegisterAppInterface(String appName, Boolean isMediaApp, String appID)
// ^ Calls another build method.
// Test -- buildRegisterAppInterface(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)
testRAI = RPCRequestFactory.buildRegisterAppInterface(testSMV, testAppName, testTTSName, testNGN, testSynonyms, testIMA, testLang, testHMILang, testHMIType, testAppID, testCorrelationID,testDI);
assertTrue(Test.TRUE, Validator.validateSdlMsgVersion(testSMV, testRAI.getSdlMsgVersion()));
assertEquals(Test.MATCH, testAppName, testRAI.getAppName());
assertTrue(Test.TRUE, Validator.validateTtsChunks(testTTSName, testRAI.getTtsName()));
assertEquals(Test.MATCH, testNGN, testRAI.getNgnMediaScreenAppName());
assertTrue(Test.TRUE, Validator.validateStringList(testSynonyms, testRAI.getVrSynonyms()));
assertEquals(Test.MATCH, testIMA, testRAI.getIsMediaApplication());
assertEquals(Test.MATCH, testLang, testRAI.getLanguageDesired());
assertEquals(Test.MATCH, testHMILang, testRAI.getHmiDisplayLanguageDesired());
assertEquals(Test.MATCH, AppHMIType.DEFAULT, testRAI.getAppHMIType().get(0));
assertEquals(Test.MATCH, testAppID, testRAI.getAppID());
assertEquals(Test.MATCH, testCorrelationID, testRAI.getCorrelationID());
assertEquals(Test.MATCH, testDI, testRAI.getDeviceInfo());
testRAI = RPCRequestFactory.buildRegisterAppInterface(null, null, null, null, null, null, null, null, null, null, null,null);
assertEquals(Test.MATCH, (Integer) 1, testRAI.getCorrelationID());
assertEquals(Test.MATCH, testSMV.getMajorVersion(), testRAI.getSdlMsgVersion().getMajorVersion());
assertEquals(Test.MATCH, testSMV.getMinorVersion(), testRAI.getSdlMsgVersion().getMinorVersion());
assertNull(Test.NULL, testRAI.getAppName());
assertNull(Test.NULL, testRAI.getTtsName());
assertNull(Test.NULL, testRAI.getNgnMediaScreenAppName());
assertNull(Test.NULL, testRAI.getVrSynonyms());
assertNull(Test.NULL, testRAI.getIsMediaApplication());
assertNotNull(Test.NOT_NULL, testRAI.getLanguageDesired());
assertNotNull(Test.NOT_NULL, testRAI.getHmiDisplayLanguageDesired());
assertNull(Test.NULL, testRAI.getAppHMIType());
assertNull(Test.NULL, testRAI.getAppID());
assertNull(Test.NULL, testRAI.getDeviceInfo());
}
示例12: getAppHMIType
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
/**
* Gets a list of all applicable app types stating which classifications to
* be given to the app.e.g. for platforms , like GEN2, this will determine
* which "corner(s)" the app can populate
*
* @return List<AppHMIType> - a List value representing a list of all
* applicable app types stating which classifications to be given to
* the app
* @since SmartDeviceLinke 2.0
*/
@SuppressWarnings("unchecked")
public List<AppHMIType> getAppHMIType() {
return (List<AppHMIType>) getObject(AppHMIType.class, KEY_APP_HMI_TYPE);
}
示例13: setAppHMIType
import com.smartdevicelink.proxy.rpc.enums.AppHMIType; //导入依赖的package包/类
/**
* Sets a a list of all applicable app types stating which classifications
* to be given to the app. e.g. for platforms , like GEN2, this will
* determine which "corner(s)" the app can populate
*
* @param appHMIType
* a List<AppHMIType>
* <p></p>
* <b>Notes: </b>
* <ul>
* <li>Array Minsize: = 1</li>
* <li>Array Maxsize = 100</li>
* </ul>
* @since SmartDeviceLink 2.0
*/
public void setAppHMIType(List<AppHMIType> appHMIType) {
setParameters(KEY_APP_HMI_TYPE, appHMIType);
}