nic-delhi / AarogyaSetu_Android

Aarogya Setu Android app native code
https://www.aarogyasetu.gov.in/
Other
2.89k stars 1.9k forks source link

[Enhancement] Social Distancing Breach Alert #491

Open transility-dev opened 4 years ago

transility-dev commented 4 years ago

In current scenario of India fighting with COVID-19, it is important to follow social distancing to stay safe and healthy. This is how we can help our nation in this war. In daily routine, being at crowded places, it is inevitable to not get into close proximity of others.

To alert user if they are breaching social distancing knowingly or unknowingly, we have added feature in Arogya setup app. Arogya Setu users will be empowered to maintain social distancing through this feature.

Feature details:

Single user breach: Be Cautious !! You are getting in close proximity to other Arogya Setu users, please keep safe distance. If they are your family members, add them as “Family” to avoid further alerts for these people.

Multiple user breach: Be Cautious !! You are getting in close proximity to another Arogya Setu user, please keep safe distance. If the person is your family member, add the person as “family” to avoid further alerts for this person.

Technical details:

  1. Store whitelisted devices: Added new table in the existing database “white_list_devices” to store the device name and address to whom user has marked safe.
  2. Identification of social breach: Within exiting Bluetooth device scan we are checking if the device is not in white list and is very close ~ less than 2 meters (rssi value is greater than -50).
  3. Alerts in case of social distancing is breached and user can add his family members to safe list to avoid future alerts from these people:
    • Notification alert: (When app is in background) Notification alert with a default notification sound will be shown to the user.
    • Popup alert: (When app is in foreground) Popup (Dialog) Alert with default sound will be shown to the user.

Social_Breach_Device_Notification Social_Breach_Multiple_User_Alert Social_Breach_Single_User_Alert

transility-dev commented 4 years ago

An alert based on RSSI won't work or takes more research into. The app is not running on equal hardware specs and given Bluetooth's range is pretty high than the usual social distance limit with different phones, it's pretty unreliable.

Can you explain in detail of the steps you have taken in terms of calibrating this in different hardware and other test conditions?

Checkout this thread for more details : https://stackoverflow.com/a/14123916

Using the Bluetooth RSSI for tracking nearby users was an existing approach with "Arogya Setu" app.

  1. In present logic for nearby Aarogya Setu user's device Bluetooth RSSI value gets recorded as distance in the database which is submitted to the server for further analysis contact tracing.

  2. Using the RSSI value we can easily know if the signal is getting stronger or weaker, therefore, we will know if we are moving towards or away from nearby Bluetooth device. We can get fairly accurate estimate of distance for detecting close proximity using RSSI, especially in our case as we are looking for users who are in very close and don’t have any obstacles in between. Reference link: https://www.bluetooth.com/blog/proximity-and-rssi/

  3. We have tested the implementation between multiple devices. Here are details of close proximity tests we have performed: A. Testing in open premises: We kept two devices very close to each other and there was no obstacle between devices. It shows alert to user to follow social distancing. As distance between devices was increased, RSSI value decreased accordingly. B. Testing in close premises with obstacles: With devices in two different rooms, with obstacles in between. In this case RSSI value was beyond the limits that we have used. With the obstacle in between the RSSI value also get impacted and no alert was shown to the user.

Devices that were used to test:

  1. Samsung Tab A(Android 8.0)
  2. Motorola one power(Android 10)
  3. Infinix hot 8(Android 9.0)
  4. Samsung tab S2 (Android 7.0)
  5. Lenovo K9 (Android 8.1)