diff options
author | NicoleYarroch <nicole@livio.io> | 2019-07-10 16:22:26 -0400 |
---|---|---|
committer | NicoleYarroch <nicole@livio.io> | 2019-07-10 16:22:26 -0400 |
commit | c9e82f0b154983e107321125642b32ace8a2d5bb (patch) | |
tree | dc378347c6b9331c614a6ab8ed0dff3e6dcb2254 | |
parent | a9bcb721402f8d61561d009d97ddd11ffc374af3 (diff) | |
download | sdl_android-c9e82f0b154983e107321125642b32ace8a2d5bb.tar.gz |
Added CloseApplication request and response
3 files changed, 123 insertions, 0 deletions
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java index c59dccfc9..e2e28f72c 100644 --- a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java +++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java @@ -100,6 +100,7 @@ public enum FunctionID{ GET_APP_SERVICE_DATA(53, "GetAppServiceData"),
GET_FILE(54, "GetFile"),
PERFORM_APP_SERVICES_INTERACTION(55, "PerformAppServiceInteraction"),
+ CLOSE_APPLICATION(58, "CloseApplication"),
// NOTIFICATIONS
ON_HMI_STATUS(32768, "OnHMIStatus"),
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplication.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplication.java new file mode 100644 index 000000000..317302482 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplication.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2019 Livio, 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 Livio 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. + * + * Created by Nicole Yarroch on 7/10/19 3:55 PM + */ + +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCRequest; + +import java.util.Hashtable; + +/** + * Used by an app to set itself to a `HMILevel` of `NONE`. The app will close but will still be registered. If the app is a navigation app it will no longer be used as the preferred mobile-navigation application by the module. + */ +public class CloseApplication extends RPCRequest { + /** + * Constructs a new CloseApplication object + */ + public CloseApplication() { + super(FunctionID.CLOSE_APPLICATION.toString()); + } + + /** + * Constructs a new CloseApplication object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public CloseApplication(Hashtable<String, Object> hash) { + super(hash); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplicationResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplicationResponse.java new file mode 100644 index 000000000..8724e7190 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloseApplicationResponse.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2019 Livio, 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 Livio 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. + * + * Created by Nicole Yarroch on 7/10/19 3:55 PM + */ + +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCResponse; + +import java.util.Hashtable; + +/** + * Response to the request to close this app on the module. + */ +public class CloseApplicationResponse extends RPCResponse { + /** + * Constructs a new CloseApplicationResponse object + */ + public CloseApplicationResponse() { + super(FunctionID.CLOSE_APPLICATION.toString()); + } + + /** + * Constructs a new CloseApplicationResponse object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public CloseApplicationResponse(Hashtable<String, Object> hash) { + super(hash); + } +} |