Handle backgrounded apps for direct sensor connections

Uses the stopAll()/recoverAll() logic to temporarily stop/enable
sensors for direct connections when an app becomes idle/active.

Bug: 74395023
Test: CTS SensorDirectReportTest and verify pass
Test: 1) Subscribe to sensor on sensorlogger
      2) Put app to background and wait
      3) Verify subscription is disabled once app is idle
      4) Put app to foreground and verify app can receive sensor samples
Test: Verify above test while a_sns_test streaming samples
Test: Verify above test with sensor service restrict and privacy mode
Change-Id: Id1981213fc13a9012fa756b8cd35fae6f144c105
4 files changed