diff --git a/client/client/build.gradle b/client/client/build.gradle
index 7ecd3d4d..2fa6964d 100644
--- a/client/client/build.gradle
+++ b/client/client/build.gradle
@@ -36,8 +36,8 @@ android {
targetSdkVersion 25
multiDexEnabled true
- versionCode 3010031
- versionName "3.1.31"
+ versionCode 3010032
+ versionName "3.1.32"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
@@ -52,6 +52,8 @@ android {
}
// DEBUG_MODE_ENABLED: Make the agent print the debug logs.
buildConfigField "boolean", "DEBUG_MODE_ENABLED", "false"
+ // DISCLAIMER_ENABLED: Show disclaimer activity before start registrations.
+ buildConfigField "boolean", "DISCLAIMER_ENABLED", "true"
// ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE: Setting this to true will make the
// App list response to the service to include system apps as well.
buildConfigField "boolean", "ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE", "false"
@@ -179,6 +181,8 @@ android {
staging {
// DEBUG_MODE_ENABLED: Make the agent print the debug logs.
buildConfigField "boolean", "DEBUG_MODE_ENABLED", "true"
+ // DISCLAIMER_ENABLED: Show disclaimer activity before start registrations.
+ buildConfigField "boolean", "DISCLAIMER_ENABLED", "true"
// ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE: Setting this to true will make the
// App list response to the service to include system apps as well.
buildConfigField "boolean", "ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE", "false"
@@ -308,6 +312,8 @@ android {
// DEBUG_MODE_ENABLED: Make the agent print the debug logs.
// Make this false in production.
buildConfigField "boolean", "DEBUG_MODE_ENABLED", "true"
+ // DISCLAIMER_ENABLED: Show disclaimer activity before start registrations.
+ buildConfigField "boolean", "DISCLAIMER_ENABLED", "false"
// ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE: Setting this to true will make the
// App list response to the service to include system apps as well.
buildConfigField "boolean", "ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE", "false"
@@ -439,6 +445,8 @@ android {
// DEBUG_MODE_ENABLED: Make the agent print the debug logs.
// Make this false in production.
buildConfigField "boolean", "DEBUG_MODE_ENABLED", "false"
+ // DISCLAIMER_ENABLED: Show disclaimer activity before start registrations.
+ buildConfigField "boolean", "DISCLAIMER_ENABLED", "true"
// ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE: Setting this to true will make the
// App list response to the service to include system apps as well.
buildConfigField "boolean", "ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE", "false"
@@ -568,6 +576,8 @@ android {
// DEBUG_MODE_ENABLED: Make the agent print the debug logs.
// Make this false in production.
buildConfigField "boolean", "DEBUG_MODE_ENABLED", "true"
+ // DISCLAIMER_ENABLED: Show disclaimer activity before start registrations.
+ buildConfigField "boolean", "DISCLAIMER_ENABLED", "true"
// ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE: Setting this to true will make the
// App list response to the service to include system apps as well.
buildConfigField "boolean", "ALLOW_SYSTEM_APPS_IN_APPS_LIST_RESPONSE", "false"
diff --git a/client/client/src/main/java/org/wso2/iot/agent/activities/DisclaimerActivity.java b/client/client/src/main/java/org/wso2/iot/agent/activities/DisclaimerActivity.java
index f141ef8a..41c7c819 100644
--- a/client/client/src/main/java/org/wso2/iot/agent/activities/DisclaimerActivity.java
+++ b/client/client/src/main/java/org/wso2/iot/agent/activities/DisclaimerActivity.java
@@ -26,6 +26,9 @@
import org.wso2.iot.agent.R;
import org.wso2.iot.agent.api.DeviceInfo;
+import org.wso2.iot.agent.api.DeviceState;
+import org.wso2.iot.agent.utils.Constants;
+import org.wso2.iot.agent.utils.Response;
/**
* Activity which displays device information.
@@ -40,7 +43,15 @@ protected void onCreate(Bundle savedInstanceState) {
btnContinue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- Intent intent = new Intent(getApplicationContext(), AuthenticationActivity.class);
+ Class> nextActivityClass;
+ if (Constants.IS_CLOUD) {
+ nextActivityClass = AuthenticationActivity.class;
+ } else if (hasWorkProfileCapability()) {
+ nextActivityClass = WorkProfileSelectionActivity.class;
+ } else {
+ nextActivityClass = ServerConfigsActivity.class;
+ }
+ Intent intent = new Intent(getApplicationContext(), nextActivityClass);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
@@ -55,4 +66,13 @@ public void onClick(View v) {
});
}
+ /**
+ * Check capability to have a separate managed profile.
+ */
+ private boolean hasWorkProfileCapability() {
+ DeviceState state = new DeviceState(this);
+ Response androidForWorkCompatibility = state.evaluateAndroidForWorkCompatibility();
+ return androidForWorkCompatibility.getCode();
+ }
+
}
diff --git a/client/client/src/main/java/org/wso2/iot/agent/activities/SplashActivity.java b/client/client/src/main/java/org/wso2/iot/agent/activities/SplashActivity.java
index 286cb67b..d204e6d7 100644
--- a/client/client/src/main/java/org/wso2/iot/agent/activities/SplashActivity.java
+++ b/client/client/src/main/java/org/wso2/iot/agent/activities/SplashActivity.java
@@ -88,7 +88,7 @@ private void startActivity() {
instantiatedActivityClass = AlreadyRegisteredActivity.class;
} else if (Preference.hasPreferenceKey(this, Constants.TOKEN_EXPIRED)) {
instantiatedActivityClass = AuthenticationActivity.class;
- } else if (Constants.IS_CLOUD) {
+ } else if (Constants.DISCLAIMER_ENABLED) {
instantiatedActivityClass = DisclaimerActivity.class;
} else if (hasWorkProfileCapability()) {
instantiatedActivityClass = WorkProfileSelectionActivity.class;
diff --git a/client/client/src/main/java/org/wso2/iot/agent/activities/WorkProfileSelectionActivity.java b/client/client/src/main/java/org/wso2/iot/agent/activities/WorkProfileSelectionActivity.java
index c8381df5..fbe7e031 100644
--- a/client/client/src/main/java/org/wso2/iot/agent/activities/WorkProfileSelectionActivity.java
+++ b/client/client/src/main/java/org/wso2/iot/agent/activities/WorkProfileSelectionActivity.java
@@ -77,8 +77,9 @@ protected void onCreate(Bundle savedInstanceState) {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void manageAndroidForWorkReception() {
if (manager.isProfileOwnerApp(getApplicationContext().getPackageName())) {
- /* If the managed profile is already set up, we show the enrollment screen. */
+ /* If the managed profile is already set up, we show the enrollment screen. */
skipToEnrollment();
+ finish();
} else {
displayProfileProvisionPromptScreen();
}
diff --git a/client/client/src/main/java/org/wso2/iot/agent/utils/Constants.java b/client/client/src/main/java/org/wso2/iot/agent/utils/Constants.java
index f6982bc5..90e4fbcf 100644
--- a/client/client/src/main/java/org/wso2/iot/agent/utils/Constants.java
+++ b/client/client/src/main/java/org/wso2/iot/agent/utils/Constants.java
@@ -32,6 +32,7 @@ public class Constants {
public static final boolean IS_CLOUD = "release".equalsIgnoreCase(BuildConfig.BUILD_TYPE.trim());
public static final boolean DEBUG_MODE_ENABLED = BuildConfig.DEBUG_MODE_ENABLED;
+ public static final boolean DISCLAIMER_ENABLED = BuildConfig.DISCLAIMER_ENABLED;
public static final boolean SYSTEM_APP_ENABLED = BuildConfig.SYSTEM_APP_ENABLED;
public static final boolean AUTO_ENROLLMENT_BACKGROUND_SERVICE_ENABLED =
BuildConfig.AUTO_ENROLLMENT_BACKGROUND_SERVICE_ENABLED;
diff --git a/client/client/src/main/res/values/strings.xml b/client/client/src/main/res/values/strings.xml
index 8be458e2..4253cf28 100644
--- a/client/client/src/main/res/values/strings.xml
+++ b/client/client/src/main/res/values/strings.xml
@@ -363,10 +363,10 @@
\n\n- Set screen lock password expiration: This permission is required to allow you to remotely set an expiration time for your screen lock password.
\n\n- Set storage encryption: This permission is required to allow remote encryption of your device storage.
\n\n- Disable cameras: This is required to for you to remotely allow/disallow camera usage on your device.
-\n\nYou will be prompted to Activate Device Admin after registering your device with WSO2 Device cloud and by clicking "Activate" you consent to this App having access to the above administrator functions on your device.
+\n\nYou will be prompted to Activate Device Admin after registering your device with WSO2 IoT Server and by clicking "Activate" you consent to this App having access to the above administrator functions on your device.
\n\nYou can revoke your consent at anytime by opening WSO2 Device Management Agent app and clicking on "Unregister" or by going to Settings \-\>Security \-\> Device Administrators and Deactivating WSO2 Device Management Agent.
-\n\nAll remote operations can only be triggered from the Device Management Console in the WSO2 Device Cloud and can only be performed by authorized user.
-\n\nAll data sent to the WSO2 Device cloud is only accessible to the authorized user and can be permanently removed if needed.
+\n\nAll remote operations can only be triggered from the Device Management Console in the WSO2 IoT Server and can only be performed by authorized user.
+\n\nAll data sent to the WSO2 IoT Server is only accessible to the authorized user and can be permanently removed if needed.
Retype PIN Code
Please enter PIN code