android / enterprise-samples

Multiple samples showing the best practices in enterprise on Android.
Apache License 2.0
387 stars 241 forks source link

Android NfcProvisioning Sample does not work on Android 10 (Pixel 2) trying to provision DO on Android 8 (Samsung S7) #27

Closed idalv closed 1 year ago

idalv commented 4 years ago

I am trying the sample app, installed on a Pixel 2 (Android 10) to provision а factory reset Samsung S7 with Android 8.0. For a device owner I am using the Test DPC app. However it seems that the createNdefMessage is not called at all - nothing happens on the NFC programmer app either. I see the API is deprecated but it is still the recommended approach for NFC provisioning. Note that NFC provisioning is officially supported from Android 6+ looking at the Android Management API documentation. Nevertheless, I can find places that say that Android Beam (used by NFC) will work on Android 9 and below: https://support.google.com/nexus/answer/2781895?hl=en also https://www.xda-developers.com/google-deprecate-android-beam-api-nfc-share-files/ Additionally on the Android 10 I can not find a Setting to enable/disable the Beam.

So could you please help me with:

Thank you!

idalv commented 4 years ago

I just tried the sample on Android 9 to provision the same device - Samsung S7 w/ Android 9 - and it worked fine. Seems to be an Android 10 issue indeed.

moribm commented 4 years ago

I'm facing the same issue, there is a bug open here as well: https://issuetracker.google.com/issues/144370914

idalv commented 4 years ago

Thanks for sharing the bug. Will put a link to this issue there too.

zubairehman commented 4 years ago

@idalv could you please share your solution building on Android 9? I am unable to provision a device using this sample, here is the link to the issue I am having: https://github.com/android/enterprise-samples/issues/32

rxj1939708338 commented 2 years ago

Can Android10 devices be set to DeviceOwner via NFC?