# Motion Activated Device Lock

### Overview <a href="#overview-0" id="overview-0"></a>

Motion intelligence software is revolutionizing safety initiatives in the workplace by preventing distracted driving. It enables fleet managers to keep track of their employees' compliance with safe-driving habits such as speed monitoring and avoiding phone usage. Motion Activated Device Lock is a Launcher feature that ensures workers remain focused on the job at hand, reducing the risk of accidents and other potential hazards. It locks the device while the user is driving. When the user stops driving, the user will be navigated back to the home screen and can use the device normally.

### User Guide

Motion Activated Device Lock locks the screen display and prevents access to unauthorized apps and functionality whenever driving is detected. This allows IT administrators to monitor driver behavior to ensure Android enterprise device policy compliance.

1. If this feature is enabled in the configuration, the device will be disabled when driving is detected.
2. The message ‘For your safety, this device will remain locked while the vehicle is in motion’ will be displayed on the screen. Users will not be able to navigate away from this screen while they are driving.
3. Starting in Launcher 3.21.15, when the user stops driving, an "Exit Motion Lock" button will be displayed. The user must press the button in order to exit the Motion Lock UI. Prior to 3.21.15, when the user stops driving, the user will be navigated back to the home screen and can use the device normally.

### Feature Configuration <a href="#advanced-configuration-4" id="advanced-configuration-4"></a>

To set up the Motion Activated Device Lock feature for a particular device profile or device group, please follow the steps below:

#### Enabling Motion Lock <a href="#enabling-motion-lock-5" id="enabling-motion-lock-5"></a>

Motion Activated Device Lock feature can be enabled or disabled within the Launcher configuration. If lockInMotion is set to true, the device will be locked while the user is driving. If lockInMotion is set to false, the device will not be locked while the user is driving.

```json
 "settings": {
    ...
    "lockInMotion" : true,

  ...
  }
```

#### Setting Up The Range <a href="#setting-up-the-range-6" id="setting-up-the-range-6"></a>

If lockInMotion is set to true, you can set up the range where the Motion Activated Device Lock feature will be enabled by defining the percentage level in the configuration. For instance, if lockInMotionConfidence is set to 50 (can range from 0 to 100), the device will be locked when there is at least 50 percent confidence that the user is driving.

```json
    "lockInMotionConfidence" : 50,
```

#### Setting Up The Interval <a href="#setting-up-the-interval-7" id="setting-up-the-interval-7"></a>

If lockInMotion is set to true, you can determine motion information from the system by defining the interval (in milliseconds) in the configuration. The default is 5000 ms (5 seconds). Introduced in Launcher version 3.11.4.

```json
    "lockInMotionInterval": 5000, 
```

#### Enabling GPS <a href="#enabling-gps-8" id="enabling-gps-8"></a>

If lockInMotionUseGps is set to true, GPS will be utilized to enable the Motion Activated Device Lock feature when driving is detected. If lockInMotionUseGps is false, the Motion Activated Device Lock feature will not be enabled when driving is detected. Note that this setting will only be utilized if lockInMotion is set to true.

```json
    "lockInMotionUseGps": true,
```

#### Setting Up The Speed Threshold <a href="#setting-up-the-speed-threshold-9" id="setting-up-the-speed-threshold-9"></a>

If lockInMotionUseGps is set to true, you can set up the movement speed threshold required to lock the device by defining the number of miles per hour in the configuration. For instance, if it is set to 2, the device will be locked if the detected speed is greater than or equal to 2 miles per hour. The default is 5 miles per hour.

```json
   "lockInMotionSpeedInMph": 5,
```

#### Setting Up The GPS Time Interval <a href="#setting-up-the-gps-time-interval-10" id="setting-up-the-gps-time-interval-10"></a>

If lockInMotionUseGps is set to true, you can set up the GPS minimum time interval in the configuration. For instance, if it is set to 10000, the GPS update time interval will run every 10 seconds. The default is 5000 milliseconds.

```json
  "lockInMotionGpsUpdateInterval": 5000,
```

#### Setting Up The GPS Distance Threshold <a href="#setting-up-the-gps-distance-threshold-11" id="setting-up-the-gps-distance-threshold-11"></a>

The GPS provides updates on the speed when it notices that the device has traveled the defined interval distance in meters. To set up the GPS distance threshold, define the number of meters in the configuration. For instance, if it is set to 5, the GPS updates will run every 5 meters. The default is 0, which means that GPS data will provide updates constantly. Note that this setting will only be utilized if lockInMotionUseGps is set to true.

```json
    "lockInMotionGpsMinDistanceThreshold": 0
```

#### Allow Application Launch during Motion Lock <a href="#putting-it-all-together-9" id="putting-it-all-together-9"></a>

Beginning in Launcher version 3.20.x, an **Allow in Motion Lock** list of three or fewer applications or web shortcuts can be selected. The allowed apps will be displayed in the locked view at the bottom of the screen. Only applications that are also accessible with the user's role can be allowed for use during motion lock. To add an app to the **Allow In Motion Lock** list, include `"allowInMotionLock": true` in the app's layout object.

#### Adding Enter Motion Lock Shortcut <a href="#putting-it-all-together-9" id="putting-it-all-together-9"></a>

Starting in Launcher 3.21.15, a shortcut item can be added to the Launcher home screen that allows for entering Motion Lock. Create a shortcut that uses the action com.bluefletch.launcher.ENTER\_MOTION\_LOCK. When entering Motion Lock using this action, Launcher will not force itself to the foreground, but will display the Motion Lock UI, and any applications that are marked as "allowInMotionLock" can be started from the Motion Lock UI.

```
{
    "label": "Enter Motion Lock",
    "action": "com.bluefletch.launcher.ENTER_MOTION_LOCK"
}
```

#### Putting It All Together <a href="#putting-it-all-together-9" id="putting-it-all-together-9"></a>

For the example described above, the full configuration for the Motion Lock mode is as follows:

```json
  "layouts": {
      "Associates": [
         {
          "label": "Enter Motion Lock",
          "action":"com.bluefletch.launcher.ENTER_MOTION_LOCK"
        }
        {
          "package": "com.bluefletch.ems.support",
          "allowInMotionLock": true
        },
        {
          "package": "com.google.android.apps.maps",
          "allowInMotionLock": true
        },
        {
          "package": "com.android.dialer",
          "allowInMotionLock": true
        },
        {
          "package": "com.bluefletch.ems.deviceinformation"
        }
      ]
  },
  ...
  "settings": {
    ...
    "lockInMotion" : true,
    "lockInMotionConfidence" : 50,
    "lockInMotionInterval": 5000,

    "lockInMotionUseGps": true,
    "lockInMotionSpeedInMph": 5,
    "lockInMotionGpsUpdateInterval": 5000,
    "lockInMotionGpsMinDistanceThreshold": 0
    ...
  }
```

{% hint style="info" %}
Motion Activated Device Lock was introduced in Launcher 3.5.x.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bluefletch.com/bluefletch-enterprise/product-guides/bluefletch-launcher/security-and-safety/motion-activated-device-lock.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
