From ac2b5c79384e48a1fdd453e5f7cc31d994c9387b Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 29 Jun 2014 14:22:30 +0200 Subject: [PATCH] Added restriction for heart rate sensor (Android "L") Refs #1757 --- CHANGELOG.md | 1 + src/biz/bokhorst/xprivacy/Meta.java | 1 + src/biz/bokhorst/xprivacy/XSensorManager.java | 3 +++ 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ed3b1d8..734ece74e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Changelog * Added parameter path to *MediaRecorder.setOutputFile* * Added restriction for *getPackagesForUid* * Added process name parameter to *queryContentProviders* +* Added restriction for heart rate sensor (Android "L") ([issue](/../../issues/1757)) [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) diff --git a/src/biz/bokhorst/xprivacy/Meta.java b/src/biz/bokhorst/xprivacy/Meta.java index 60490cb09..2017b09ca 100644 --- a/src/biz/bokhorst/xprivacy/Meta.java +++ b/src/biz/bokhorst/xprivacy/Meta.java @@ -273,6 +273,7 @@ public static List get() { mListHook.add(new Hook("sensors", "rotation", "", 3, null, null)); mListHook.add(new Hook("sensors", "temperature", "", 3, null, null)); mListHook.add(new Hook("sensors", "step", "", 3, null, null)); + mListHook.add(new Hook("sensors", "heartrate", "", 20, null, null)); mListHook.add(new Hook("shell", "sh", "", 10, "0.0", null).dangerous().whitelist(cTypeCommand)); mListHook.add(new Hook("shell", "su", "", 10, "0.0", null).dangerous().whitelist(cTypeCommand)); diff --git a/src/biz/bokhorst/xprivacy/XSensorManager.java b/src/biz/bokhorst/xprivacy/XSensorManager.java index 73cf10036..130d2641a 100644 --- a/src/biz/bokhorst/xprivacy/XSensorManager.java +++ b/src/biz/bokhorst/xprivacy/XSensorManager.java @@ -122,6 +122,9 @@ else if (type == Sensor.TYPE_ACCELEROMETER || type == Sensor.TYPE_LINEAR_ACCELER } else if (type == Sensor.TYPE_STEP_COUNTER || type == Sensor.TYPE_STEP_DETECTOR) { if (isRestricted(param, "step")) return true; + } else if (type == 21) { // TODO: replace by TYPE_HEART_RATE + if (isRestricted(param, "heartrate")) + return true; } else Util.log(this, Log.WARN, "Unknown sensor type=" + type); return false;