Closed Bug 1523939 Opened 6 years ago Closed 5 years ago

Investigation: does glean really need an `initialize` method on Android?

Categories

(Data Platform and Tools :: Glean: SDK, enhancement, P3)

enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: Dexter, Unassigned)

References

Details

(Whiteboard: [telemetry:glean-rs:backlog])

Apparently, on Android, there's a way to automatically init things by using ContentProviders. This is not official, however Google does it quite in a few places so it should be safe enough (thanks Sebastian for finding this!).

The WorkManager library for scheduling background jobs, has an interesting comment in the initialize() method. And the docs say: "By default, this method should not be called because WorkManager is automatically initialized."

They do that by defining a ContentProvider:

https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/work/workmanager/src/main/AndroidManifest.xml#26

The ContentProvider will do the initialization:

https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/work/workmanager/src/main/java/androidx/work/impl/WorkManagerInitializer.java#40

After creating the application process Android will create an instance of all ContentProviders (that is not really documented)

Blocks: 1491345
Whiteboard: [telemetry:mobilesdk:m?]
Priority: -- → P3
Whiteboard: [telemetry:mobilesdk:m?] → [telemetry:mobilesdk:backlog]
Component: Telemetry → Glean: SDK
Product: Toolkit → Data Platform and Tools
Version: Trunk → unspecified
Whiteboard: [telemetry:mobilesdk:backlog] → [telemetry:glean-rs:m?]
Summary: Investigation: does glean really need an `initialize` method? → Investigation: does glean really need an `initialize` method on Android?
Whiteboard: [telemetry:glean-rs:m?] → [telemetry:glean-rs:backlog]
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.