Closed Bug 1198338 Opened 6 years ago Closed 6 years ago

[Metrics] B2gDroid should support Metrics being collected on FxOS

Categories

(B2GDroid Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rdandu, Assigned: fabrice)

References

Details

Attachments

(2 files)

B2GDroid should support all Metrics that are being collected on FxOS on Gonk. These include
1) FTU Ping: The data should contain the info on HW device, and unique ID ()
   - FTU app should be run for B2GDroid, so the user opt-in (opt-out) for analytics is collected  
2) AppUsage: Collect time of Apps usage 
3) Support of metric roadmap items at https://wiki.mozilla.org/FirefoxOS/Metrics#Roadmap
Assignee: nobody → 2u
Assignee: 2u → fabrice
Advanced Metrics Framework & Custom Metrics (Bug 1152000) should also be functional on B2GDroid.
Blocks: b2gdroid
Fabrice, I know we said we'd drop the FTU, in general, but we may need the opt-in/opt-out screen for data collection.  NI'ing you for now to give a heads up.
Flags: needinfo?(fabrice)
Component: B2gInstaller → General
Flags: needinfo?(fabrice)
Product: Firefox OS → B2GDroid
Not sure which kind of UX we want there though? Jacqueline, help!
Flags: needinfo?(jsavory)
Hi Fabrice,

Do we have an API we can call to get the Hardware id?  Also, is there a way for us to tell if we need to call this API?

Thanks,

-tamara
Flags: needinfo?(fabrice)
I'm on it!

Ravi, I'm just wondering if this can be a single opt-in check box like the current data collection in FTU? Also, do you have any copy that we can include in the opt-in screen to explain the data collection to the user?
Flags: needinfo?(jsavory) → needinfo?(rdandu)
(In reply to Tamara Hills [:thills] from comment #4)
> Hi Fabrice,
> 
> Do we have an API we can call to get the Hardware id?  Also, is there a way
> for us to tell if we need to call this API?

Is that the IMEI? If so, I will add setting to let you get it, and the way to know if you have to use the setting is to test if navigator.mozTelephony is available (it's not on b2gdroid).
Flags: needinfo?(fabrice)
(In reply to Jacqueline Savory [:jsavory] UX from comment #5)
> Ravi, I'm just wondering if this can be a single opt-in check box like the
> current data collection in FTU? Also, do you have any copy that we can
> include in the opt-in screen to explain the data collection to the user?
This is being worked on in bug 1181295.
There will be a radiobox with three options (basic, advanced, none). The copy for is being discussed in the bug.
Flags: needinfo?(rdandu)
Attached patch get-imei.patchSplinter Review
That sets the deviceinfo.imei setting with the expected value.
Attachment #8664979 - Flags: review?(snorp)
Attachment #8664979 - Flags: review?(snorp) → review+
https://hg.mozilla.org/mozilla-central/rev/876b48d14ee0
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Marking as leave-open as we have another part coming for the ftu_ping piece.
Keywords: leave-open
Hi Fabrice,

When does this deviceinfo.imei setting get set?  If it fails to get the imei (assuming it uses the *#06# method) because the telephony stack is not available, does it retry?

Thanks,

-tamara
Flags: needinfo?(fabrice)
Hi Fabrice,

I need to simulate the condition where navigator.mozTelephony is not available.  Do you have instructions on how I can setup b2gdroid to test this?

I was thinking it could be simpler just to check if deviceinfo.imei exists, but then there could be network stack issues if the radio is not available and getting imei can fail, so it's probably better to know whether it's b2gdroid or not by checking the interface.

Thanks,

-tamara
(In reply to Tamara Hills [:thills] from comment #12)
> Hi Fabrice,
> 
> When does this deviceinfo.imei setting get set?  If it fails to get the imei
> (assuming it uses the *#06# method) because the telephony stack is not
> available, does it retry?

We do that early during b2g startup, but I have no way to know if it's long after Android is initialized. We don't retry for now - let's see if that's needed or not...


> I need to simulate the condition where navigator.mozTelephony is not
> available.  Do you have instructions on how I can setup b2gdroid to test
> this?
> 
> I was thinking it could be simpler just to check if deviceinfo.imei exists,
> but then there could be network stack issues if the radio is not available
> and getting imei can fail, so it's probably better to know whether it's
> b2gdroid or not by checking the interface.

There are build instructions at https://wiki.mozilla.org/B2gdroid
Let me know if they work for you!
Flags: needinfo?(fabrice)
Attached file packageinstall.txt
Hi Fabrice,

I had a little trouble with the instructions.  Everything worked fine until I got to the |mach package| and |mach install| part.  I attached the log of my package and install.  Let me know if you have any thoughts of what I can try.

This is my mozconfig.  Not sure if something can be missing from here:
ac_add_options --enable-application=mobile/android
ac_add_options --target=arm-linux-androideabi
ac_add_options --with-android-sdk="/Volumes/development/android-sdk-macosx"

Thanks,

-tamara
Flags: needinfo?(fabrice)
You built fennec, not b2gdroid! Here's my local mozconfig:

ac_add_options --enable-application=mobile/android/b2gdroid

ac_add_options --target=arm-linux-androideabi

# With the following Android SDK and NDK:
ac_add_options --with-android-sdk="/home/fabrice/.mozbuild/android-sdk-linux"
ac_add_options --with-android-ndk="/home/fabrice/.mozbuild/android-ndk-r8e"

ac_add_options --enable-android-apz

# ac_add_options --enable-debug
ac_add_options --enable-debug-symbols

ac_add_options --enable-updater

mk_add_options MOZ_OBJDIR=/home/fabrice/dev/builds/obj-b2gdroid
mk_add_options AUTOCLOBBER=1
mk_add_options MOZ_MAKE_FLAGS="-j8 -s"

ac_add_options --with-branding=mobile/android/b2gdroid/branding/unofficial

ac_add_options --with-ccache

GAIADIR=/home/fabrice/dev/gaia
MOZ_UPDATER=1

MOZTTDIR=/home/fabrice/dev/moztt


You may also need to export MOZ_TELEMETRY_REPORTING=1
Flags: needinfo?(fabrice)
Removing leave-open keyword from resolved bugs, per :sylvestre.
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.