Add suport for accessibility service permission

This commit is contained in:
Jonas L
2019-03-25 00:00:00 +00:00
parent b6f5edc976
commit 0e601995ec
10 changed files with 117 additions and 9 deletions
+3 -1
View File
@@ -57,5 +57,7 @@ export const prepareDeviceEntry = ({ familyId, userId, deviceAuthToken, deviceId
defaultUserTimeout: 0,
considerRebootManipulation: false,
currentOverlayPermission: 'not granted',
highestOverlayPermission: 'not granted'
highestOverlayPermission: 'not granted',
asEnabled: false,
wasAsEnabled: false
})
@@ -107,6 +107,20 @@ export async function dispatchUpdateDeviceStatus ({ deviceId, action, cache }: {
}
}
if (action.newAccessibilityServiceEnabled !== undefined) {
const hasChanged = deviceEntry.asEnabled !== action.newAccessibilityServiceEnabled
deviceEntry.asEnabled = action.newAccessibilityServiceEnabled
if (action.newAccessibilityServiceEnabled) {
deviceEntry.wasAsEnabled = true
}
if (hasChanged && (deviceEntry.asEnabled !== deviceEntry.wasAsEnabled)) {
deviceEntry.hadManipulation = true
}
}
if (action.newAppVersion !== undefined) {
const hasChanged = deviceEntry.currentAppVersion !== action.newAppVersion
@@ -58,6 +58,10 @@ export async function dispatchIgnoreManipulation ({ action, cache }: {
deviceEntry.highestOverlayPermission = deviceEntry.currentOverlayPermission
}
if (action.ignoreAccessibilityServiceManipulation) {
deviceEntry.wasAsEnabled = deviceEntry.asEnabled
}
if (action.ignoreDidReboot) {
deviceEntry.didReboot = false
}
+3 -1
View File
@@ -95,7 +95,9 @@ export const generateServerDataStatus = async ({ database, clientStatus, familyI
defUserTimeout: item.defaultUserTimeout,
rebootIsManipulation: item.considerRebootManipulation,
cOverlay: item.currentOverlayPermission,
hOverlay: item.highestOverlayPermission
hOverlay: item.highestOverlayPermission,
asEnabled: item.asEnabled,
wasAsEnabled: item.wasAsEnabled
}))
}
}