• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][Difficulty: Beginner] Enable 'Smart Lock' on Bluetooth LE devices

Search This thread

MishaalRahman

Editor in Chief
Nov 2, 2015
1,042
2,132
www.xda-developers.com
Android 5.0 Lollipop added the ability to keep your device unlocked so long as you stay connected to a trusted bluetooth device. Dubbed "Smart Lock", the feature is quite useful if you own a smart wearable that you keep on you at all times. However, Smart Lock is unavailable for devices that connect to your phone via Bluetooth Low Energy. Some manufacturers offer the ability to simulate Smart Lock through keeping their app on in the background (such as Xiaomi's Mi Band and the Mi Fit app), but others do not.

If you, for instance, own a basic Fitbit or one of the new Honor Z1 bands among others, then you'll be able to keep your phone unlocked so long as your wearable is in range of your phone by following this Tasker guide.

Prerequisites

  1. Secure Settings plug-in
  2. Bluetooth 4.0 LE enabled device
  3. A Bluetooth LE Scanner app

Instructions

  1. Ensure that Secure Settings is set as a Device Administrator by opening the app and going to the Preferences screen. This is so the plugin has the ability to enable/disable the lockscreen.
  2. Bring your phone and your device close together. Open the BLE Scanner app you downloaded above, and press SCAN.
  3. Write down the MAC ID of the device that shows up at the top of the list. This should be the address of the Fitbit or other wearable, in case the name doesn't properly populate.
  4. Click + to create a new Profile and name it "Watch Near" or anything else you want.
  5. Select the State context, then select "BT Near" under "Net."
  6. Once you're in the BT Near setting, type in the Bluetooth Address that you wrote down earlier under "Address." Additionally, select "Low-Energy (LE) Devices" and "Unpaired Devices". Leave everything else unchecked and/or default.
  7. Press the back key to save and exit the context setup.
  8. Tasker will now ask you to set up a new task associated with this context. Click on "New Task" and optionally give the task a name. Before we move on, here's a picture of what the context screen should look like.
fWMQ4Fy.jpg


Now that you've got the context set-up, we're going to make a simple entry and exit task to correspond to when your phone connects/disconnects to your smart wearable.

  1. Plugin --> Secure Settings. Under the Dev Admin Actions dropdown, select Password/Pin. Make sure that the box is set as "DISABLED" and that Device Admin Enabled is checked. Press the save icon up top to exit, then press the back key once you're back in Tasker.
  2. Press back once more to exit the task creation. Now expand the Profile you just created by tapping on its name. Long-press on the Task that launches, the select "Add Exit Task."
  3. Within this new task, you're going to do the opposite of what you did above. Plugin --> Secure Settings. Select Password/Pin under Dev Admin Actions again, but this time change the box to "ENABLED" and set up the password or pin code that you desire. Exit out all the way after you're done.

That's it! Your phone should now automatically disable the pin/password when your bluetooth device is in range, otherwise it will re-enabled it. You can expand the power of this task by adding some alerts for when your device and phone disconnects, the choice is up to you!
 
Last edited:

darren1

Senior Member
Oct 31, 2010
382
124
This is great thanks, I am using this with a cheap Bluetooth tracker keyring I got from eBay for 99p.

Edit

I need to test this a little more with the tag. The tag seems to power its self off which means it doesn't then trigger BT Near.
 
Last edited:

deepsync

Member
Dec 11, 2005
43
6
Where is the Secure Settings plug-in? There is an app of that name, by intangibleObject - is that what you mean?
The Secure Settings Plugin is in an app called "Tasker".

However, having setup this instructions it seems to me that Secure Settings or TAsker never triggers a lockscreen/password protection to be active. What is your default state ? OS Version ? Do you have any initial password options enabled ?
 

fjuniper

Senior Member
Dec 19, 2010
302
97
Bristol
The Secure Settings Plugin is in an app called "Tasker".
Ah, thanks - I have Tasker, but didn't realise what the OP meant.
However, having setup this instructions it seems to me that Secure Settings or TAsker never triggers a lockscreen/password protection to be active. What is your default state ? OS Version ? Do you have any initial password options enabled ?
I haven't had time to try it yet - I am on Marshmallow and have a BT LE step counter to test it with, when I have a chance.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Android 5.0 Lollipop added the ability to keep your device unlocked so long as you stay connected to a trusted bluetooth device. Dubbed "Smart Lock", the feature is quite useful if you own a smart wearable that you keep on you at all times. However, Smart Lock is unavailable for devices that connect to your phone via Bluetooth Low Energy. Some manufacturers offer the ability to simulate Smart Lock through keeping their app on in the background (such as Xiaomi's Mi Band and the Mi Fit app), but others do not.

    If you, for instance, own a basic Fitbit or one of the new Honor Z1 bands among others, then you'll be able to keep your phone unlocked so long as your wearable is in range of your phone by following this Tasker guide.

    Prerequisites

    1. Secure Settings plug-in
    2. Bluetooth 4.0 LE enabled device
    3. A Bluetooth LE Scanner app

    Instructions

    1. Ensure that Secure Settings is set as a Device Administrator by opening the app and going to the Preferences screen. This is so the plugin has the ability to enable/disable the lockscreen.
    2. Bring your phone and your device close together. Open the BLE Scanner app you downloaded above, and press SCAN.
    3. Write down the MAC ID of the device that shows up at the top of the list. This should be the address of the Fitbit or other wearable, in case the name doesn't properly populate.
    4. Click + to create a new Profile and name it "Watch Near" or anything else you want.
    5. Select the State context, then select "BT Near" under "Net."
    6. Once you're in the BT Near setting, type in the Bluetooth Address that you wrote down earlier under "Address." Additionally, select "Low-Energy (LE) Devices" and "Unpaired Devices". Leave everything else unchecked and/or default.
    7. Press the back key to save and exit the context setup.
    8. Tasker will now ask you to set up a new task associated with this context. Click on "New Task" and optionally give the task a name. Before we move on, here's a picture of what the context screen should look like.
    fWMQ4Fy.jpg


    Now that you've got the context set-up, we're going to make a simple entry and exit task to correspond to when your phone connects/disconnects to your smart wearable.

    1. Plugin --> Secure Settings. Under the Dev Admin Actions dropdown, select Password/Pin. Make sure that the box is set as "DISABLED" and that Device Admin Enabled is checked. Press the save icon up top to exit, then press the back key once you're back in Tasker.
    2. Press back once more to exit the task creation. Now expand the Profile you just created by tapping on its name. Long-press on the Task that launches, the select "Add Exit Task."
    3. Within this new task, you're going to do the opposite of what you did above. Plugin --> Secure Settings. Select Password/Pin under Dev Admin Actions again, but this time change the box to "ENABLED" and set up the password or pin code that you desire. Exit out all the way after you're done.

    That's it! Your phone should now automatically disable the pin/password when your bluetooth device is in range, otherwise it will re-enabled it. You can expand the power of this task by adding some alerts for when your device and phone disconnects, the choice is up to you!