Phone app and iotcloud addition into the fourth benchmark and a few minor stuff
authorrtrimana <rtrimana@uci.edu>
Fri, 29 Sep 2017 18:51:31 +0000 (11:51 -0700)
committerrtrimana <rtrimana@uci.edu>
Fri, 29 Sep 2017 18:51:31 +0000 (11:51 -0700)
benchmarks/Java/HomeSecurityController/HomeSecurityController.java
benchmarks/Java/HomeSecurityController/README [new file with mode: 0644]
iotjava/iotruntime/master/RouterConfig.java
localconfig/mysql/iotcloudServer.config [new file with mode: 0644]
others/lede-gui/.idea/workspace.xml
others/lede-gui/lede-gui.iml

index c87eece..c146c6f 100644 (file)
@@ -20,13 +20,14 @@ import java.rmi.server.UnicastRemoteObject;
 // IoT Runtime Packages
 import iotruntime.slave.IoTSet;
 import iotruntime.slave.IoTRelation;
+import iotruntime.slave.IoTAddress;
 import iotcode.annotation.*;
 
 // IoT Driver Packages
 import iotcode.interfaces.*;
 
-// Checker annotations
-//import iotchecker.qual.*;
+// IoT Cloud
+import iotcloud.*;
 
 /** Class Home Security Controller for the home security application benchmark
  *
@@ -46,7 +47,12 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
        private static final int SECOND_TO_TURN_OFF = 1;                // in seconds
        private static final int LOCK_DOOR = 0;
        private static final int UNLOCK_DOOR = 1;
-
+       // For IoTCloud
+       private static final String BASE_URL = "http://dc-6.calit2.uci.edu/test.iotcloud/";
+       private static final String PASSWORD = "reallysecret";
+       private static final int LOCAL_MACHINE_ID = 399;
+       private static final int LISTENING_PORT = -1;   // We don't use any listening port for this application
+       
        /**
         *  IoT Sets and Relations
         *  <p>
@@ -64,6 +70,8 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
        @config private IoTSet<AlarmSmart> alarmSet;
        @config private IoTSet<RoomSmart> roomSet;
        @config private IoTSet<SmartthingsActuatorSmart> doorlockSet;
+       // Set of addresses for Fidelius connection (dc-6.calit2.uci.edu) to give access
+       @config private IoTSet<IoTAddress> iotcloudServer;
 
        @config private IoTRelation<RoomSmart, SmartthingsSensorSmart> roomSensorRelation;
        @config private IoTRelation<RoomSmart, CameraSmart> roomCameraRelation;
@@ -78,6 +86,10 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
 
        private static int sensorId = 0;
        private static int doorlockId = 0;
+       // Initialize values 1 and 0 (for active and not active)
+       private final IoTString ACTIVE = new IoTString("1");            // ACTIVE can mean detecting or being locked for doorlock
+       private final IoTString NOT_ACTIVE = new IoTString("0");        // NOT_ACTIVE can mean not detecting or being unlocked for doorlock
+       private Table t1 = null;
 
        /*******************************************************************************************************************************************
        **
@@ -92,10 +104,10 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                new ConcurrentHashMap<Integer, Boolean>();
        // Camera (true = motion)
        private Map<CameraSmart, Boolean> camDetectStatus =
-               new HashMap<CameraSmart, Boolean>();
+               new ConcurrentHashMap<CameraSmart, Boolean>();
        // Doorlock (true = locked)
        private Map<Integer, Boolean> doorlockStatus =
-               new HashMap<Integer, Boolean>();
+               new ConcurrentHashMap<Integer, Boolean>();
 
        // Alarm status
        private Map<Integer, Boolean> alarmStatus =
@@ -112,6 +124,116 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
        **
        *******************************************************************************************************************************************/
 
+       /** Method to initialize IoTCloud server (dc-6.calit2.uci.edu)
+        *
+        *   @return [void] None.
+        */
+       private void initIoTCloudServer() {
+
+               try {
+                       System.out.println("DEBUG: Initialize IoTCloud table!");
+                       // Get and init the IoTCloud server address
+                       // Setup table
+                       t1 = new Table(BASE_URL, PASSWORD, LOCAL_MACHINE_ID, LISTENING_PORT);
+                   t1.initTable();
+                       // Setup is done somewhere else, we just do rebuild()
+                       //t1.rebuild();
+                       System.out.println("DEBUG: Table initialized!");
+                       // Initialize sensors!
+                       // TODO: Still deciding whether to initialize all devices here or inside each init method
+                       int id = 0;
+                       // Initialize alarms! One alarm for now
+                       for(AlarmSmart alarm : alarmSet.values()) {
+                               createKeyIoTCloud("alarm", NOT_ACTIVE);
+                               System.out.println("DEBUG: Setting alarm to NOT-ACTIVE!");
+                       }
+                       // TODO: Just use alarm for now as a status to cloud
+                       /*for(SmartthingsSensorSmart smartSensor : smartSensorsSet.values()) {
+                               
+                               createKeyIoTCloud("sensor" + Integer.toString(id++), NOT_ACTIVE);
+                               System.out.println("DEBUG: Setting sensor" + id + " to NOT-ACTIVE!");                           
+                       }
+                       // Initialize cameras! One camera for now...
+                       for(CameraSmart cam : camSet.values()) {
+                               createKeyIoTCloud("camera", NOT_ACTIVE);
+                               System.out.println("DEBUG: Setting camera to NOT-ACTIVE!");
+                       }
+                       int doorId = 0;
+                       for(SmartthingsActuatorSmart doorlock : doorlockSet.values()) {
+                               createKeyIoTCloud("doorlock" + Integer.toString(doorId), NOT_ACTIVE);
+                               System.out.println("DEBUG: Setting doorlock" + id + " to NOT-ACTIVE!");
+                       }*/
+
+               } catch(Exception e) {
+                       e.printStackTrace();
+               }
+               System.out.println("DEBUG: Cloud server transactions committed successfully!");
+       }
+
+       /** Method to create key IoTCloud
+        *
+        *   @param key                 [String] , encrypted key.
+        *   @param val                         [IoTString] , encrypted value.
+        *
+        *   @return [void] None.
+        */
+       private void createKeyIoTCloud(String key, IoTString val) {
+
+               try {
+                       IoTString iotKey = new IoTString(key);
+                       t1.update();
+                       t1.createNewKey(iotKey, LOCAL_MACHINE_ID);
+                       t1.startTransaction();
+                       t1.addKV(iotKey, val);
+                       t1.commitTransaction();
+                       t1.update();
+                       System.out.println("DEBUG: Successfully committed transaction for: " + key);
+               } catch(Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       /** Method to update IoTCloud
+        *
+        *   @param key                 [String] , encrypted key.
+        *   @param val                         [IoTString] , encrypted value.
+        *
+        *   @return [void] None.
+        */
+       private void updateIoTCloud(String key, IoTString val) {
+
+               try {
+                       IoTString iotKey = new IoTString(key);
+                       t1.update();
+                       t1.startTransaction();
+                       t1.addKV(iotKey, val);
+                       t1.commitTransaction();
+                       t1.update();
+                       System.out.println("DEBUG: Successfully committed transaction for: " + key);
+               } catch(Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       /** Method to read IoTCloud
+        *
+        *   @param key                 [String] , encrypted key.
+        *   @param val                         [IoTString] , encrypted value.
+        *
+        *   @return [boolean] Check if it is ACTIVE or NOT_ACTIVE (true or false).
+        */
+       private boolean readIoTCloud(String key, IoTString iotTestVal) {
+
+               t1.update();
+               IoTString iotKey = new IoTString(key);
+               IoTString iotVal = t1.getCommitted(iotKey);
+
+               // Matching value and test value
+               if ((iotVal != null) && (iotVal.equals(iotTestVal) == true))
+            return true;
+        // Mismatch between value and test value
+        return false;
+       }
 
        /** Method to initialize Smartthings sensors
         *
@@ -130,6 +252,9 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                                System.out.println("DEBUG: Initialized smartthings sensor! ID: " + sensorId + " Room ID: " + rm.getRoomID());
                                senDetectStatus.put(sensorId, false);
                                System.out.println("DEBUG: Initialized sensor detection to false!");
+                               // Initialize IoTCloud
+//                             createKeyIoTCloud("sensor" + Integer.toString(sensorId), NOT_ACTIVE);
+//                             System.out.println("DEBUG: Setting sensor" + sensorId + " to NOT-ACTIVE!");
                                sen.setId(sensorId++);
                                sen.registerCallback(this);
                                System.out.println("DEBUG: Registered sensor callback!");
@@ -144,12 +269,10 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
         *
         *   @return [void] None.
         */
-       private void initCameras(RoomSmart rm) {
+       private void initCameras() {
 
-               // Get and init the IAS sensors for this specific room
-               HashSet<CameraSmart> cameras = roomCameraRelation.get(rm);
                // Setup the cameras, start them all and assign each one a motion detector
-               for (CameraSmart cam : cameras) {
+               for (CameraSmart cam : camSet.values()) {
 
                        // Each camera will have a motion detector unique to it since the motion detection has state
                        MotionDetection mo = new MotionDetection(12, 0.5f, 10, 10);
@@ -173,6 +296,10 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
 
                        // Initialize detection to false
                        camDetectStatus.put(cam, false);
+
+                       // Initialize IoTCloud
+//                     createKeyIoTCloud("camera", NOT_ACTIVE);
+//                     System.out.println("DEBUG: Setting camera to NOT-ACTIVE!");
                }
        }
 
@@ -186,7 +313,10 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                // Get and init the alarm (this single alarm set can serve multiple zones / rooms)
                Iterator alarmIt = alarmSet.iterator();
                AlarmSmart alm = (AlarmSmart) alarmIt.next();
-               // init the alarm controller, do it here since it only needs to be done once per controller
+               // Initialize IoTCloud - only 1 alarm
+//             createKeyIoTCloud("alarm", NOT_ACTIVE);
+//             System.out.println("DEBUG: Setting alarm to NOT-ACTIVE!");
+               // Initialize the alarm controller, do it here since it only needs to be done once per controller
                try {
                        alm.init();
                        System.out.println("DEBUG: Initialized alarm!");
@@ -217,6 +347,9 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                                System.out.println("DEBUG: Initialized doorlock! ID: " + doorlockId);
                                doorlockStatus.put(doorlockId, false);
                                System.out.println("DEBUG: Initialized doorlock status to false!");
+                               // Initialize IoTCloud
+//                             createKeyIoTCloud("doorlock" + Integer.toString(doorlockId), NOT_ACTIVE);
+//                             System.out.println("DEBUG: Setting doorlock to NOT-ACTIVE!");
                                doorlock.setId(doorlockId++);
                                doorlock.registerCallback(this);
                                System.out.println("DEBUG: Registered doorlock callback!");
@@ -271,14 +404,17 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
        public void newReadingAvailable(int _sensorId, int _value, boolean _activeValue) {
 
                System.out.println("DEBUG: Sensor reading value: " + _value);
+
+               String sensor = "sensor" + Integer.toString(_sensorId);
                if(_activeValue) {
-                       System.out.println("DEBUG: Sensor is detecting something: " + _activeValue);
+                       System.out.println("DEBUG: Sensor " + sensorId + " is detecting something: " + _activeValue);
                        senDetectStatus.put(_sensorId, true);
-
+                       //updateIoTCloud(sensor, ACTIVE);
                } else {
-                       //System.out.println("DEBUG: Sensor is not detecting something: " + _activeValue);
+                       //System.out.println("DEBUG: Sensor " + sensorId + " is not detecting something: " + _activeValue);
                        senDetectStatus.put(_sensorId, false);
-               } 
+                       //updateIoTCloud(sensor, NOT_ACTIVE);
+               }
        }
 
        /** Method to update state data structures for Smartthings actuators
@@ -287,15 +423,19 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
         */
        public void newActuatorReadingAvailable(int _sensorId, int _value, boolean _activeValue) {
 
-               System.out.println("DEBUG: Actuator reading value: " + _value);
+               System.out.println("DEBUG: Actuator " + _sensorId + " reading value: " + _value);
+
+               // Update IoTCloud              
+               String actuator = "doorlock" + Integer.toString(_sensorId);
                if(_activeValue) {
-                       System.out.println("DEBUG: Actuator is detecting something: " + _activeValue);
+                       System.out.println("DEBUG: Actuator " + _sensorId + " is detecting something: " + _activeValue);
                        doorlockStatus.put(_sensorId, true);
-
+                       //updateIoTCloud(actuator, ACTIVE);
                } else {
-                       //System.out.println("DEBUG: Sensor is not detecting something: " + _activeValue);
+                       //System.out.println("DEBUG: Actuator " + _sensorId + " is not detecting something: " + _activeValue);
                        doorlockStatus.put(_sensorId, false);
-               } 
+                       //updateIoTCloud(actuator, NOT_ACTIVE);
+               }
        }
 
 
@@ -328,14 +468,18 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
 
                        // Motion was detected
                        System.out.println("DEBUG: Camera detected something!");
-                       for(CameraSmart cam : cameras)
+                       for(CameraSmart cam : cameras) {
                                camDetectStatus.put(cam, true);
+                               //updateIoTCloud("camera", ACTIVE);
+                       }
                } else {
 
                        // No motion was detected
                        //System.out.println("DEBUG: Camera didn't detect anything!");
-                       for(CameraSmart cam : cameras)
+                       for(CameraSmart cam : cameras) {
                                camDetectStatus.put(cam, false);
+                               //updateIoTCloud("camera", NOT_ACTIVE);
+                       }
                }
        }
 
@@ -349,6 +493,7 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                Iterator alarmIt = alarmSet.iterator();
                AlarmSmart alm = (AlarmSmart) alarmIt.next();
                alm.setZone(zoneId, true, SECOND_TO_TURN_OFF);
+               updateIoTCloud("alarm", ACTIVE);
        }
 
 
@@ -363,6 +508,7 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                AlarmSmart alm = (AlarmSmart) alarmIt.next();
                // Turn this alarm off indefinitely
                alm.setZone(zoneId, false, SECOND_TO_TURN_ON);
+               updateIoTCloud("alarm", NOT_ACTIVE);
        }
 
 
@@ -377,7 +523,10 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                for (SmartthingsActuatorSmart doorlock : doorlocks) {
        
                        doorlock.actuate(LOCK_DOOR);
-                       System.out.println("DEBUG: Lock doorlock! ID: " + doorlock.getId());
+                       int doorId = doorlock.getId();
+                       System.out.println("DEBUG: Lock doorlock! ID: " + doorId);
+                       doorlockStatus.put(doorId, true);
+                       //updateIoTCloud("doorlock" + doorId, ACTIVE);
                }
        }
 
@@ -406,6 +555,17 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                                        turnOnAlarms(zoneId);
                                        System.out.println("DETECTION: Camera active in room: " + zoneId);
                                        lockDoors();
+                                       while(readIoTCloud("alarm", ACTIVE)) { 
+                                               System.out.println("DETECTION: Now alarm is on so wait here until turned off!");
+                                               try {
+                                                       Thread.sleep(5000); // sleep for a tenth of the time
+                                               } catch (Exception e) {
+                                                       e.printStackTrace();
+                                               }
+                                       } // Wait until turned off!
+                                       System.out.println("DETECTION: Now alarm is turned off!");
+                                       cleanUp();
+                                       return;
                                }
                        }
 
@@ -420,61 +580,50 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                                        System.out.println("DETECTION: Sensor active in room: " + zoneId);
                                        System.out.println("DETECTION: Detection by sensor: " + sensor.getId());
                                        lockDoors();
+                                       while(readIoTCloud("alarm", ACTIVE)) { 
+                                               System.out.println("DETECTION: Now alarm is on so wait here until turned off!");
+                                               try {
+                                                       Thread.sleep(5000); // sleep for a tenth of the time
+                                               } catch (Exception e) {
+                                                       e.printStackTrace();
+                                               }
+                                       } // Wait until turned off!
+                                       System.out.println("DETECTION: Now alarm is turned off!");
+                                       cleanUp();
+                                       return;
                                }
                        }
                }
        }
 
 
-       /** Check status of devices and turn off alarm accordingly
+       /** Clean up all status booleans
         *  <p>
-        *  If everything (camera and sensors) is set back to normal
-        *  then the system will turn off the alarm
         *
         *   @return [void] None.
         */
-       // TODO: Need to fix this part later
-       // TODO: Perhaps we should use a phone app to turn off the alarm
-       /*private void decideToTurnOffAlarm() {
+       private void cleanUp() {
 
-               // Check for motion in rooms and if there is motion then report
+               // Clear sensor status
+               for (Boolean senStatus : senDetectStatus.values()) {
+                       senStatus = false;
+               }
+               // Clear camera status
+               for (Boolean camStatus : camDetectStatus.values()) {
+                       camStatus = false;
+               }
+               // Clear doorlock status
+               for (Boolean doorStatus : doorlockStatus.values()) {
+                       doorStatus = false;
+               }
+               // Clear alarm status
+               updateIoTCloud("alarm", NOT_ACTIVE);
+               // Turn off alaarms
                for (RoomSmart room : roomSet.values()) {
-
                        int zoneId = room.getRoomID();
-                       // Loop through all the cameras in the room
-                       for (CameraSmart cam : roomCameraRelation.get(room)) {
-
-                               // Get the right camera and the right detection status (true or false)
-                               if (camDetectStatus.get(cam))   // Camera still active so alarm is still on, so false for off-alarm status
-
-                                       alarmStatus.put(zoneId, false);
-
-                               else
-
-                                       alarmStatus.put(zoneId, true);
-                               
-                       }
-
-                       // Loop through all the cameras in the room
-                       for (SmartthingsSensor sensor : roomSensorRelation.get(room)) {
-
-                               // Get the right sensor and the right detection status (true or false)
-                               if (senDetectStatus.get(sensor.getId()))        // Sensor still active so alarm is still on, so false for off-alarm status
-
-                                       alarmStatus.put(zoneId, false);
-
-                               else
-
-                                       alarmStatus.put(zoneId, true);
-                       }
-               }
-
-               // Turn on alarm in the right zone
-               for (Map.Entry<Integer, Boolean> alEnt : alarmStatus.entrySet()) {
-                       if (alEnt.getValue())   // if this zone is true, that means we need to turn off its alarm
-                               turnOffAlarms(alEnt.getKey());
+                       turnOffAlarms(zoneId);
                }
-       }*/
+       }
 
 
        /*******************************************************************************************************************************************
@@ -490,23 +639,30 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
         */
        public void init() {
 
+               // Initialize IoTCloud server
+               initIoTCloudServer();
+
                // Iterate over the set of rooms
                for (RoomSmart rm : roomSet.values()) {
 
                        // Init all Smartthings sensors
                        initSmartthingsSensors(rm);
-
-                       // Init all cameras
-                       initCameras(rm);
-
-                       // Init all doorlocks
-                       initDoorLocks();
+                       //try {
+                       //      Thread.sleep(5000);
+                       //} catch (Exception e) {
+                       //      e.printStackTrace();
+                       //}
 
                }
+               // Init all doorlocks
+               initDoorLocks();
 
                // Init all alarms
                initAlarms();
 
+               // Init all cameras
+               initCameras();
+
                System.out.println("DEBUG: Initialized all devices! Now starting detection loop!");
 
                // Run the main loop that will keep checking the sensors and cameras periodically
@@ -523,9 +679,6 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                                // Decide to turn on alarm if any of the sensor/camera detects something unusual
                                decideToTurnOnAlarm();
 
-                               // Decide to turn off alarm if every sensor/camera goes back to normal
-                               //decideToTurnOffAlarm();
-
                        } else {
 
                                try {
diff --git a/benchmarks/Java/HomeSecurityController/README b/benchmarks/Java/HomeSecurityController/README
new file mode 100644 (file)
index 0000000..ee6a513
--- /dev/null
@@ -0,0 +1,9 @@
+====================================
+Home Security Controller Application
+====================================
+Special instruction:
+1) To compile this application, we need to compile the iotjava libraries.
+2) Then, we need to download the iotcloud libraries: ssh://plrg.eecs.uci.edu/home/git/iotcloud
+3) We need to compile the iotcloud library, and copy the iotcloud folder from 
+   iotcloud/version2/src/java/iotcloud/bin/iotcloud/ and paste it into iot2/bin/
+4) The compilation will then find the needed iotcloud libraries in iot2/bin/iotcloud.
index 392fd74..760f3d2 100644 (file)
@@ -629,6 +629,9 @@ public final class RouterConfig {
                PrintWriter pwConfig = getPrintWriter(strConfigHost);
                // Configure NAT
                pwConfig.println("-t nat -A POSTROUTING -o eth0 -j MASQUERADE");
+               // Add the following 2 lines
+               pwConfig.println("-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT");
+               pwConfig.println("-A FORWARD -i wlan0 -o eth0 -j ACCEPT");
        }
 
        /**
diff --git a/localconfig/mysql/iotcloudServer.config b/localconfig/mysql/iotcloudServer.config
new file mode 100644 (file)
index 0000000..7970cff
--- /dev/null
@@ -0,0 +1,5 @@
+SELECT * FROM\r
+IoTAddress\r
+WHERE\r
+ID='CL1'\r
+;\r
index d764ed2..c0a6a8c 100644 (file)
@@ -64,7 +64,9 @@
           <provider selected="true" editor-type-id="text-editor">
             <state relative-caret-position="525">
               <caret line="51" column="12" selection-start-line="51" selection-start-column="8" selection-end-line="51" selection-end-column="12" />
-              <folding />
+              <folding>
+                <element signature="imports" expanded="false" />
+              </folding>
             </state>
           </provider>
         </entry>
           <provider selected="true" editor-type-id="text-editor">
             <state relative-caret-position="1590">
               <caret line="124" column="30" selection-start-line="124" selection-start-column="30" selection-end-line="124" selection-end-column="30" />
-              <folding />
+              <folding>
+                <element signature="e#0#121#0" expanded="false" />
+                <element signature="imports" expanded="false" />
+              </folding>
             </state>
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="ListActivity.java" pinned="false" current-in-tab="true">
+      <file leaf-file-name="ListActivity.java" pinned="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/src/main/java/com/example/lede2/ListActivity.java">
           <provider selected="true" editor-type-id="text-editor">
             <state relative-caret-position="15">
               <caret line="47" column="8" selection-start-line="47" selection-start-column="8" selection-end-line="47" selection-end-column="8" />
-              <folding>
-                <element signature="imports" expanded="true" />
-              </folding>
+              <folding />
             </state>
           </provider>
         </entry>
       </file>
+      <file leaf-file-name="activity_add_relation.xml" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/main/res/layout/activity_add_relation.xml">
+          <provider editor-type-id="text-editor">
+            <state relative-caret-position="1380">
+              <caret line="92" column="0" selection-start-line="92" selection-start-column="0" selection-end-line="92" selection-end-column="0" />
+              <folding />
+            </state>
+          </provider>
+          <provider selected="true" editor-type-id="android-designer2">
+            <state />
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="activity_enroll_device.xml" pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/src/main/res/layout/activity_enroll_device.xml">
+          <provider editor-type-id="text-editor">
+            <state relative-caret-position="120">
+              <caret line="8" column="0" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
+              <folding />
+            </state>
+          </provider>
+          <provider selected="true" editor-type-id="android-designer2">
+            <state />
+          </provider>
+        </entry>
+      </file>
     </leaf>
   </component>
   <component name="FileTemplateManagerImpl">
   </component>
   <component name="ProjectFrameBounds">
     <option name="x" value="65" />
-    <option name="y" value="24" />
+    <option name="y" value="-4" />
     <option name="width" value="1615" />
-    <option name="height" value="1026" />
+    <option name="height" value="1054" />
   </component>
   <component name="ProjectLevelVcsManager" settingsEditedManually="false">
     <OptionsSetting value="true" id="Add" />
       <foldersAlwaysOnTop value="true" />
     </navigator>
     <panes>
+      <pane id="Scope" />
+      <pane id="Scratches" />
+      <pane id="AndroidView">
+        <subPane />
+      </pane>
+      <pane id="PackagesPane" />
       <pane id="ProjectPane">
         <subPane>
           <PATH>
           </PATH>
         </subPane>
       </pane>
-      <pane id="Scope" />
-      <pane id="PackagesPane" />
-      <pane id="AndroidView">
-        <subPane />
-      </pane>
-      <pane id="Scratches" />
     </panes>
   </component>
   <component name="PropertiesComponent">
     </todo-panel>
   </component>
   <component name="ToolWindowManager">
-    <frame x="65" y="24" width="1615" height="1026" extended-state="6" />
-    <editor active="false" />
+    <frame x="65" y="-4" width="1615" height="1054" extended-state="6" />
+    <editor active="true" />
     <layout>
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32719547" sideWeight="0.49475157" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.28713968" sideWeight="0.45634162" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
       <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.135255" sideWeight="0.5436584" order="7" side_tool="true" content_ui="tabs" />
-      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.22370937" sideWeight="0.4915254" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.22370937" sideWeight="0.4915254" order="0" side_tool="false" content_ui="combo" />
       <window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32981715" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
       <window_info id="Assistant" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32950923" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.28713968" sideWeight="0.45634162" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
       <window_info id="Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2974108" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.20066519" sideWeight="0.4901211" order="1" side_tool="false" content_ui="tabs" />
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/main/AndroidManifest.xml">
+      <provider editor-type-id="android-manifest">
+        <state />
+      </provider>
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="420">
           <caret line="28" column="26" selection-start-line="28" selection-start-column="26" selection-end-line="28" selection-end-column="26" />
           <folding />
         </state>
       </provider>
-      <provider editor-type-id="android-manifest">
-        <state />
-      </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/main/assets/add_device.config">
       <provider selected="true" editor-type-id="text-editor">
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/res/layout/activity_add_relation.xml">
-      <provider editor-type-id="text-editor">
-        <state relative-caret-position="839">
-          <caret line="92" column="0" selection-start-line="92" selection-start-column="0" selection-end-line="92" selection-end-column="0" />
-          <folding />
-        </state>
-      </provider>
-      <provider selected="true" editor-type-id="android-designer2">
-        <state />
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/src/main/java/com/example/lede2/AddRelationActivity.java">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="660">
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/res/layout/activity_enroll_device.xml">
-      <provider editor-type-id="text-editor">
-        <state relative-caret-position="120">
-          <caret line="8" column="0" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
-          <folding />
-        </state>
-      </provider>
-      <provider selected="true" editor-type-id="android-designer2">
-        <state />
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/src/main/java/com/example/lede2/MainActivity.java">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="1350">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="525">
           <caret line="51" column="12" selection-start-line="51" selection-start-column="8" selection-end-line="51" selection-end-column="12" />
-          <folding />
+          <folding>
+            <element signature="imports" expanded="false" />
+          </folding>
         </state>
       </provider>
     </entry>
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="1590">
           <caret line="124" column="30" selection-start-line="124" selection-start-column="30" selection-end-line="124" selection-end-column="30" />
-          <folding />
+          <folding>
+            <element signature="e#0#121#0" expanded="false" />
+            <element signature="imports" expanded="false" />
+          </folding>
         </state>
       </provider>
     </entry>
         <state relative-caret-position="214">
           <caret line="51" column="47" selection-start-line="51" selection-start-column="47" selection-end-line="51" selection-end-column="47" />
           <folding>
-            <element signature="e#1964#1978#0" expanded="true" />
+            <element signature="e#1964#1978#0" expanded="false" />
           </folding>
         </state>
       </provider>
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="15">
           <caret line="47" column="8" selection-start-line="47" selection-start-column="8" selection-end-line="47" selection-end-column="8" />
-          <folding>
-            <element signature="imports" expanded="true" />
-          </folding>
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/main/res/layout/activity_add_relation.xml">
+      <provider editor-type-id="text-editor">
+        <state relative-caret-position="1380">
+          <caret line="92" column="0" selection-start-line="92" selection-start-column="0" selection-end-line="92" selection-end-column="0" />
+          <folding />
+        </state>
+      </provider>
+      <provider selected="true" editor-type-id="android-designer2">
+        <state />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/main/res/layout/activity_enroll_device.xml">
+      <provider editor-type-id="text-editor">
+        <state relative-caret-position="120">
+          <caret line="8" column="0" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
+          <folding />
         </state>
       </provider>
+      <provider selected="true" editor-type-id="android-designer2">
+        <state />
+      </provider>
     </entry>
   </component>
 </project>
\ No newline at end of file
index 288756d..6d95a2e 100644 (file)
       <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
       <excludeFolder url="file://$MODULE_DIR$/build/android-profile" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />