@mojro/react-native-gnss-tracking-health 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -176,16 +176,18 @@ import { collectSystemHealth, useSystemHealth } from "react-native-gnss-tracking
176
176
  const health = await collectSystemHealth();
177
177
  ```
178
178
 
179
- ### Background restrictions (battery optimization + Samsung "Never sleeping apps")
179
+ ### Background restrictions (battery optimization + OEM allowlists)
180
180
 
181
181
  Android only. The library ships a small native module (autolinked; rebuild the app after installing). It reports **two different settings separately**:
182
182
 
183
183
  | Setting | Detectable? | How |
184
184
  |---------|-------------|-----|
185
185
  | Android "Ignore battery optimizations" (Doze) | **Yes** | `PowerManager.isIgnoringBatteryOptimizations()` |
186
- | Samsung "Never sleeping apps" list | **No** | Samsung documents an intent to *open* the list but no public API to *read* it |
186
+ | OEM allowlists (Samsung Never sleeping apps, Oppo/OnePlus Startup manager, Vivo Background startup, Xiaomi Autostart, …) | **No** | OEMs expose intents to *open* the screen but no public API to *read* membership |
187
187
 
188
- Because Samsung offers no way to read the list, the library never reports it as verified. `neverSleepingApps.verifiable` is always `false`; `userConfirmed` only reflects what the driver told you via `setNeverSleepingAppsConfirmed()` (persisted natively).
188
+ Because no OEM lets an app read these lists, the library never reports membership as verified. `neverSleepingApps.verifiable` is always `false`; `userConfirmed` only reflects what the driver told you via `setNeverSleepingAppsConfirmed()` (persisted natively).
189
+
190
+ Supported OEM families for direct navigation: **Samsung**, **Xiaomi/Redmi/POCO**, **Huawei/Honor**, **Oppo**, **Realme**, **OnePlus**, **Vivo/iQOO**, **Asus**, **Nokia/HMD**, **Letv/LeEco**, **Meizu**, **Motorola/Moto**.
189
191
 
190
192
  ```js
191
193
  import {
@@ -198,25 +200,29 @@ import {
198
200
 
199
201
  const s = await getBackgroundSettingsStatus();
200
202
  // s.ignoringBatteryOptimizations -> true | false (verified) | null
201
- // s.isSamsung, s.manufacturer, s.model
203
+ // s.isSamsung, s.oemFamily, s.manufacturer, s.model
202
204
  // s.neverSleepingApps = {
203
205
  // applicable, verifiable: false,
204
206
  // state: "not_applicable" | "unverified" | "user_confirmed" | "user_reported_missing",
205
207
  // userConfirmed: true | false | null,
206
- // settingsScreenAvailable
208
+ // settingsScreenAvailable, oemFamily, label, target
207
209
  // }
208
210
 
209
- if (s.isSamsung && s.neverSleepingApps.state !== NEVER_SLEEPING_STATE.USER_CONFIRMED) {
210
- const opened = await openNeverSleepingApps(); // deep link to the exact screen
211
- if (!opened) await openBatteryOptimizationSettings(); // fallback
211
+ if (
212
+ s.neverSleepingApps.applicable &&
213
+ s.neverSleepingApps.state !== NEVER_SLEEPING_STATE.USER_CONFIRMED
214
+ ) {
215
+ const r = await openNeverSleepingApps(); // OEM screen only (no generic fallback)
216
+ // { opened, target, isOemScreen, manufacturer, oemFamily }
217
+ if (!r.opened) await openBatteryOptimizationSettings(); // fallback
212
218
  // When the driver returns, ask them, then:
213
219
  await setNeverSleepingAppsConfirmed(true); // or false / null to clear
214
220
  }
215
221
  ```
216
222
 
217
- `collectSystemHealth()` also includes `manufacturer`, `isSamsung` and `neverSleepingApps`. These are diagnostic only and do **not** affect device fitness. If `configure({ isIgnoringBatteryOptimizations })` is not set, the native PowerManager check is used.
223
+ `collectSystemHealth()` also includes `manufacturer`, `isSamsung`, `oemFamily` and `neverSleepingApps`. These are diagnostic only and do **not** affect device fitness. If `configure({ isIgnoringBatteryOptimizations })` is not set, the native PowerManager check is used.
218
224
 
219
- The Samsung screen is `com.samsung.android.sm.ACTION_OPEN_CHECKABLE_LISTACTIVITY` (package `com.samsung.android.lool`, `activity_type=2`). OEM screens can change between One UI versions, so `openNeverSleepingApps()` resolves `false` instead of throwing; test on the One UI versions you support. The library manifest adds the `<queries>` entry needed on Android 11+.
225
+ Samsung's screen is `com.samsung.android.sm.ACTION_OPEN_CHECKABLE_LISTACTIVITY` (package `com.samsung.android.lool`, `activity_type=2`). ColorOS / OxygenOS / Oplus devices try `com.oplus.safecenter` then legacy `com.coloros.safecenter` / `com.oneplus.security`. Vivo tries Background startup + whitelist activities. OEM screens change between OS versions, so `openNeverSleepingApps()` resolves `{ opened: false }` instead of throwing; test on the builds you support. The library manifest adds the `<queries>` entries needed on Android 11+.
220
226
 
221
227
  #### Open the right background screen on any Android device
222
228
 
@@ -224,10 +230,10 @@ The Samsung screen is `com.samsung.android.sm.ACTION_OPEN_CHECKABLE_LISTACTIVITY
224
230
  import { openBackgroundRestrictionSettings } from "react-native-gnss-tracking-health";
225
231
 
226
232
  const r = await openBackgroundRestrictionSettings();
227
- // { opened: true, target: "xiaomi_autostart", isOemScreen: true, manufacturer: "Xiaomi" }
233
+ // { opened: true, target: "xiaomi_autostart", isOemScreen: true, manufacturer: "Xiaomi", oemFamily: "xiaomi" }
228
234
  ```
229
235
 
230
- Tries, in order: the manufacturer's own screen (Samsung Never sleeping apps, Xiaomi Autostart, Huawei/Honor Startup manager, Oppo/Realme/OnePlus Startup manager, Vivo/iQOO Background startup, Asus, Nokia, Letv), then Android's "Optimize battery usage" list, then this app's "App info" page. It never rejects. `target` tells you which one opened (`isOemScreen: false` means a universal fallback). OEM screens are undocumented and vary by model and OS version, so test on the devices you support. No manufacturer lets an app read whether it was added to these lists, so this only navigates; it cannot verify.
236
+ Tries, in order: the manufacturer's own screen (Samsung Never sleeping apps, Xiaomi Autostart, Huawei/Honor Startup manager, Oppo/Realme/OnePlus Startup manager, Vivo/iQOO Background startup, Asus, Nokia, Letv, Meizu, Motorola/Lenovo background or system battery list), then Android's "Optimize battery usage" list, then this app's "App info" page. It never rejects. `target` tells you which one opened (`isOemScreen: false` means a universal fallback). OEM screens are undocumented and vary by model and OS version, so test on the devices you support. No manufacturer lets an app read whether it was added to these lists, so this only navigates; it cannot verify.
231
237
 
232
238
  ### Time / timezone (standalone)
233
239
 
@@ -235,7 +241,7 @@ Android auto date/time + timezone lives in its **own native package** (not mixed
235
241
 
236
242
  ```
237
243
  android/src/main/java/com/gnsstrackinghealth/
238
- GnssTrackingHealthSettingsModule.java # battery / Samsung only
244
+ GnssTrackingHealthSettingsModule.java # battery + OEM allowlist screens
239
245
  autodatetime/
240
246
  AutoDateTimeModule.java # AUTO_TIME + AUTO_TIME_ZONE
241
247
  AutoDateTimePackage.java
@@ -350,7 +356,7 @@ src/
350
356
  gnssMonitor.js # peer: react-native-gnss-status-checker
351
357
  deviceFitness.js
352
358
  systemHealth.js
353
- backgroundSettings.js # battery optimization + Samsung Never sleeping apps
359
+ backgroundSettings.js # battery optimization + OEM allowlist screens
354
360
  timeValidation.js # standalone time/tz
355
361
  traceAnalyzer.js
356
362
  adapters/normalizeLocation.js
@@ -11,14 +11,24 @@
11
11
  <package android:name="com.miui.securitycenter" />
12
12
  <package android:name="com.miui.powerkeeper" />
13
13
  <package android:name="com.huawei.systemmanager" />
14
+ <!-- ColorOS / OxygenOS / Oplus (Oppo, Realme, OnePlus) -->
15
+ <package android:name="com.oplus.safecenter" />
16
+ <package android:name="com.oplus.battery" />
14
17
  <package android:name="com.coloros.safecenter" />
18
+ <package android:name="com.coloros.oppoguardelf" />
15
19
  <package android:name="com.oppo.safe" />
16
20
  <package android:name="com.oneplus.security" />
21
+ <!-- Vivo / iQOO -->
17
22
  <package android:name="com.vivo.permissionmanager" />
18
23
  <package android:name="com.iqoo.secure" />
24
+ <package android:name="com.vivo.abe" />
19
25
  <package android:name="com.asus.mobilemanager" />
20
26
  <package android:name="com.evenwell.powersaving.g3" />
21
27
  <package android:name="com.letv.android.letvsafe" />
28
+ <package android:name="com.meizu.safe" />
29
+ <!-- Motorola / Lenovo (some Motos share Lenovo security screens) -->
30
+ <package android:name="com.lenovo.security" />
31
+ <package android:name="com.lenovo.safecenter" />
22
32
  </queries>
23
33
 
24
34
  </manifest>