Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
feat(policies): add screen for notification
Browse files Browse the repository at this point in the history
Signed-off-by: Rafa Hernandez <rhernandez@teclib.com>
  • Loading branch information
rafaelje authored and ajsb85 committed Dec 17, 2018
1 parent f715b64 commit 9257d1a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
14 changes: 14 additions & 0 deletions app/src/main/java/org/flyve/mdm/agent/ui/PushPoliciesActivity.java
Expand Up @@ -4,6 +4,8 @@
import android.support.v7.app.AppCompatActivity;

import org.flyve.mdm.agent.R;
import org.flyve.mdm.agent.policies.PasswordEnablePolicy;
import org.flyve.mdm.agent.utils.FlyveLog;

public class PushPoliciesActivity extends AppCompatActivity {

Expand All @@ -12,6 +14,18 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_push_policies);

String payload = getIntent().getStringExtra("payload");

PasswordEnablePolicy airplaneModePolicy = new PasswordEnablePolicy(getApplicationContext());
airplaneModePolicy.setMqttEnable(false);
airplaneModePolicy.setValue(true);
airplaneModePolicy.setPriority(1);
FlyveLog.d("Password policy: " + payload);

try {
airplaneModePolicy.execute();
} catch (Exception ex) {
FlyveLog.d(ex.getMessage());
}
}
}
9 changes: 4 additions & 5 deletions app/src/main/res/layout/activity_push_policies.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".firebase.PushPoliciesActivity">
>

</android.support.constraint.ConstraintLayout>
</RelativeLayout>

0 comments on commit 9257d1a

Please sign in to comment.