Added End-User License Agreement

parent eaeed9a5
......@@ -23,10 +23,14 @@
package org.openconnectivity.otgc.splash.presentation.view;
import android.Manifest;
import android.app.Activity;
import android.app.Dialog;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProviders;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.provider.Settings;
import androidx.annotation.NonNull;
......@@ -46,12 +50,17 @@ import org.openconnectivity.otgc.di.Injectable;
import org.openconnectivity.otgc.login.presentation.view.LoginActivity;
import org.openconnectivity.otgc.splash.presentation.viewmodel.SplashViewModel;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import javax.inject.Inject;
public class SplashActivity extends AppCompatActivity implements Injectable {
private static final String PREFERENCE_EULA_ACCEPTED = "eula.accepted";
private static final String PREFERENCES_EULA = "eula";
private static final int PERMISSIONS_REQUEST_CODE = 1;
@Inject
......@@ -69,7 +78,8 @@ public class SplashActivity extends AppCompatActivity implements Injectable {
initViewModel();
mViewModel.checkIfPermissionsAreGranted();
showEulaDialog();
//mViewModel.checkIfPermissionsAreGranted();
}
@Override
......@@ -129,6 +139,27 @@ public class SplashActivity extends AppCompatActivity implements Injectable {
}
}
private void showEulaDialog() {
final SharedPreferences preferences = this.getSharedPreferences(PREFERENCES_EULA, Activity.MODE_PRIVATE);
if (!preferences.getBoolean(PREFERENCE_EULA_ACCEPTED, false)) {
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.eula_title);
builder.setCancelable(false);
builder.setPositiveButton(R.string.eula_accept_button,
(DialogInterface dialog, int which) -> {
preferences.edit().putBoolean(PREFERENCE_EULA_ACCEPTED, true).commit();
mViewModel.checkIfPermissionsAreGranted();
});
builder.setNegativeButton(R.string.eula_dismiss_button,
(DialogInterface dialog, int which) -> this.finish());
builder.setMessage(R.string.eula_body);
builder.create().show();
} else {
mViewModel.checkIfPermissionsAreGranted();
}
}
private void askForPermissions(@NonNull List<String> permissions) {
View messageView = View.inflate(this, R.layout.fragment_dialog, null);
TextView alertMessage = messageView.findViewById(R.id.text_dialog_message);
......
......@@ -23,6 +23,58 @@
<resources>
<string name="app_name" translatable="false">OTGC</string>
<string name="eula_title" translatable="false"><b>End User License Agreement</b></string>
<string name="eula_body" translatable="false">
<b>OCF ONBOARDING TOOL AND GENERIC CLIENT (OTGC)</b>\n
<b>End User License Agreement</b>\n
\n
This OCF Onboarding Tool and Generic Client End User License Agreement (this “<b>EULA</b>”) is a binding agreement between you and Open Connectivity Foundation, Inc. a Delaware nonprofit corporation (“<b>OCF</b>”) governing use of OCF’s proprietary software program known as the “OCF Onboarding Tool and Generic Client” (the “<b>Software</b>”). In this EULA, unless the context clearly indicates otherwise, all references to “<b>you</b>” or “<b>your</b>,” regardless of capitalization, means you individually and any company or entity “<b>Licensee</b>”) you may be using the Software on behalf of.\n
\n
BY DOWNLOADING AND USING THE SOFTWARE, YOU ACCEPT AND AGREE TO THE TERMS OF THIS EULA ON YOUR OWN INDIVIDUAL BEHALF AND ON BEHALF OF ANY COMPANY OR ENTITY YOU ARE USING THE SOFTWARE ON BEHALF OF. IF YOU DO NOT OR CAN NOT AGREE TO THIS EULA ON YOUR OWN BEHALF AND ON BEHALF OF SUCH COMPANY OR ENTITY, YOU HAVE NO LICENSE TO, AND MUST NOT ACCESS OR USE, THE SOFTWARE.\n
\n
<b>1. Definitions</b>. For purposes of this EULA, the following terms have the following meanings:\n
\t<b>(a) “Authorized User”</b> means those individual persons that Licensee has authorized to use the Software pursuant to the license granted under this EULA; provided however, in the event that the Licensee includes a company or entity, Licensee shall only authorize employees of Licensee or contractors that have agreed in writing or are otherwise legally bound to abide by the terms of this EULA.\n
\t<b>(b) “CPL”</b> or <b>“Certified Product List”</b> means a list maintained by OCF of products that have passed the OCF Certification Testing and designated by OCF as certified products, such list provided in a machine readable format.\n
\t<b>(c) “Documentation”</b> means any materials provided by OCF, in printed, electronic or other form, that describe the installation, operation, use or technical specifications of the Software.\n
\t<b>(d) “Software”</b> means OCF’s proprietary software program known as the “OCF Onboarding Tool and Generic Client.”\n
\t<b>(e) “OCF Certified Products”</b> shall mean the products that have passed the OCF Certification Testing and are designated by OCF as certified products.\n
\t<b>(f) “Third Party”</b> means any individual or entity other than Licensee, OCF, or an Authorized User.\n
<b>2. License Grant</b>b>. Subject to your strict compliance with this EULA, OCF hereby grants you a non-exclusive, non-transferable, personal, non-sublicensable, limited license during the term of this EULA to use the Software solely in accordance with the Documentation and this EULA, solely for the purpose of managing, controlling and interfacing with OCF Certified Products within networks that you are authorized to use. This EULA and the foregoing license will terminate immediately, either with respect to just you individually or with respect to Licensee and all of its Authorized Users, as the case may be, on the earlier to occur of:\n
\t<b>(a)</b> your ceasing to be an Authorized User for any reason;\n
\t<b>(b)</b> notice of termination by OCF in the event you breach the terms of this EULA and either (i) such breach, by its nature, is not curable or (ii) you have failed to cure such breach within thirty (30) days after OCF provided you with notice that such breach has occurred;\n
\t<b>(c)</b> upon notice if OCF ceases to provide or maintain the Software; or\n
\t<b>(d)</b> notice of termination by Licensee for any reason or no reason. Upon termination of this EULA, all licenses granted hereunder shall terminate, and you shall promptly stop using the Software and the Documentation. Any terms that are intended to survive termination of this EULA, as indicated by their nature, express terms, or context, shall survive such termination, including without limitation <b>Section 10</b>.\n
<b>3. Scope of License</b>. The license granted herein includes the limited right and license to:\n
\t<b>(a)</b> Use, access, and install the Software in accordance with this EULA and the Documentation, solely for the purpose of managing, controlling and interfacing with OCF Certified Products within networks that you are authorized to use.\n
\t<b>(b)</b> Download, print, or otherwise view and display any Documentation and use such Documentation, solely in support of your licensed use of the Software in accordance with this EULA.\n
<b>4. Copies</b>. All copies of the Documentation and Software made by you:\n
\t<b>(a)</b> will be the exclusive property of OCF;\n
\t<b>(b)</b> will be subject to the terms and conditions of this EULA;\n
\t<b>(c)</b> must include all trademark, copyright, patent and other intellectual property rights notices contained in the original; and\n
\t<b>(d)</b> must include or be accompanied by a copy of this EULA.\n
<b>5. Use Restrictions</b>. You shall not, directly or indirectly:\n
\t<b>(a)</b> use (including make any copies of) the Software or Documentation beyond the scope of the license granted hereunder;\n
\t<b>(b)</b> distribute the Software without a copy of this EULA;\n
\t<b>(c)</b> remove, delete, alter or obscure any trademarks or any copyright, trademark, patent or other intellectual property or proprietary rights notices from the Software or Documentation, including any copy thereof;\n
\t<b>(d)</b> use the Software in, or in association with, the design, construction, maintenance or operation of any hazardous environments or systems, including:\n
\t\t<b>(i)</b> power generation systems;\n
\t\t<b>(ii)</b> aircraft navigation or communication systems, air traffic control systems or any other transport management systems;\n
\t\t<b>(iii)</b> safety-critical applications, including medical or life-support systems, vehicle operation applications or any police, fire or other safety response systems; and\n
\t\t<b>(iv)</b> military or aerospace applications, weapons systems or environments;\n
\t<b>(e)</b> use the Software in violation of any federal, state or local law, regulation or rule; or\n
\t<b>(f)</b> use the Software to attempt to, or to in fact, circumvent any OCF security system or otherwise breach any OCF-established security protocols.\n
<b>6. Modifications; Support</b>. You understand and agree that OCF may make modifications and updates to the Software and Documentation from time to time in its sole discretion, including but not limited to bug fixes and security patches. However, OCF is not required to make such modifications or to otherwise provide support for the Software.\n
<b>7. Compliance Measures</b>. The Software may contain technological copy protection or other security features designed to prevent unauthorized use of the Software, including features to protect against use of the Software that is beyond the scope of the license granted in this EULA or that is prohibited by the terms of this EULA. You shall not, and shall not attempt to, remove, disable, circumvent or otherwise create or implement any workaround to any such copy protection or security features.\n
<b>8. Intellectual Property Rights</b>. You acknowledge that the Software is provided under license, and not sold, to you. You do not acquire any ownership interest in the Software under this EULA, or any other rights to the Software other than to use the Software in accordance with the license granted under this EULA, subject to all terms, conditions and restrictions contained therein and herein. OCF reserves and shall retain its entire right, title and interest in and to the Software and all intellectual property rights arising out of or relating to the Software, subject to the licenses expressly granted in this EULA. You shall use commercially reasonable efforts to safeguard all Software (including all copies thereof) from infringement, misappropriation, theft, misuse or unauthorized access.\n
<b>9. Export Regulation</b>. The Software may be subject to US export control laws, including the US Export Administration Act and its associated regulations. You shall not, directly or indirectly, export, re-export or release the Software to, or make the Software accessible from, any jurisdiction or country to which export, re-export or release is prohibited by law, rule or regulation. You shall comply with all applicable federal laws, regulations and rules, and complete all required undertakings (including obtaining any necessary export license or other governmental approval), prior to exporting, re-exporting, releasing or otherwise making the Software available outside the United States.\n
<b>10. Disclaimer of Warranties and Liability For Use of The Software and CPL</b>. THE SOFTWARE AND CPL ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY REPAIR, SERVICING OR CORRECTION. IN NO EVENT WILL OCF OR ITS AFFILIATES, OR ANY OF ITS OR THEIR RESPECTIVE AGENTS, DIRECTORS, OFFICERS, LICENSORS OR SERVICE PROVIDERS, BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, LOSS OF BUSINESS PROFITS, LOSS OF BUSINESS INFORMATION, LOSS OF BUSINESS INTERRUPTION OR OTHER COMPENSATORY, INCIDENTAL OR CONSEQUENTIAL DAMAGES, TO YOU FOR ANY USE, INTERRUPTION, DELAY OR INABILITY TO USE THE SOFTWARE OR CPL. YOU ARE PROVIDED THE SOFTWARE PURSUANT TO THE TERMS OF THIS EULA, SOLELY FOR THE USE IN CONNECTION WITH TERMS OF THE LICENSE GRANT CONTAINED IN SECTION 2 HEREOF. TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, YOU HEREBY RELEASE OCF, ITS OFFICERS, DIRECTORS AND AGENTS FROM ANY AND ALL LIABILITY ARISING FROM OR RELATED TO ALL CLAIMS CONCERNING THE SOFTWARE OR ITS USE.\n
Without limiting the generality of the foregoing warranty disclaimers and limitations of liability, if you access the CPL, OCF does not and cannot guarantee that the CPL will be available at all times or that your ability to access the CPL will be uninterrupted, and neither OCF nor any third party acting on OCF’s behalf to provide such CPL, shall have any liability to you or any third party arising from (a) your inability to access the CPL for any reason, including without limitation due to scheduled or emergency maintenance, or (b) any delay, whether or not caused by OCF or its agents, in updating the CPL with current information, or (c) any errors or inaccuracies in the CPL for any reason, or for reasons related to the functioning of the OCF Certificate Management System, actions by unauthorized third parties, or otherwise. Furthermore, if you access the CPL or distribute software (including the Software) or products that access the CPL, you agree to indemnify, defend, and hold OCF and its affiliates, and any of its or their respective agents, directors, officers, licensors, and service providers from and against any and all claims, lawsuits, losses, damages, penalties, fines, liabilities, costs, and expenses (including without limitation attorneys’ fees) incurred by any of them arising from or related to use of the CPL by you, by any recipient of software that you distribute that is programmed to access the CPL, or by any recipient of any device that you manufacture or distribute that comes preinstalled with firmware that is programmed to access the CPL.\n
<b>11. Governing Law</b>. This EULA shall be governed by and construed in accordance with the internal laws of the State of Delaware without giving effect to any choice or conflict of law provision or rule (whether of the State of Delaware or any other jurisdiction) that would cause the application of laws of any jurisdiction other than those of the State of Delaware.\n
BY CLICKING THE BUTTON INDICATING YOUR ACCEPTANCE OR INSTALLING THE SOFTWARE, YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, UNDERSTOOD IT, AND AGREE TO BE BOUND BY ITS TERMS AND CONDITIONS. YOU ALSO AGREE THAT THIS AGREEMENT IS THE COMPLETE AND EXCLUSIVE STATEMENT OF AGREEMENT BETWEEN YOU AND OCF CONCERNING THE SUBJECT MATTER HEREOF AND SUPERSEDES ALL PROPOSALS OR PRIOR AGREEMENTS, VERBAL OR WRITTEN, AND ANY OTHER COMMUNICATIONS BETWEEN YOU AND OCF RELATING TO THE SUBJECT MATTER HEREOF. NO AMENDMENT TO THIS AGREEMENT SHALL BE EFFECTIVE UNLESS SIGNED BY A DULY AUTHORIZED REPRESENTATIVE OF OCF.
</string>
<string name="eula_accept_button" translatable="false">Accept</string>
<string name="eula_dismiss_button" translatable="false">Cancel</string>
<string name="permissions_dialog_title">Permissions</string>
<string name="permissions_dialog_explain_message">In order to ensure that the application can be executed correctly, we need the following permission:</string>
<string name="permissions_dialog_location_explain"><b>Location</b>: to display the list of available Wi-Fi networks.</string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment