Forum Discussion

Elijah's avatar
Elijah
Level 2.0: Eclair
14 days ago

Problem Joining Work Profile From Android Device

I created an enrollment token for an enterprise for work profile, and I ensured that

setAllowPersonalUsage("PERSONAL_USAGE_ALLOWED"); was set for the token. 

 

How ever when I try to join from my android 11(tecno) and android 14(google pixel 7) device with work profile via the ADP app, I get :

Can't add work Profile

A work profile can't be added to this Pixel. If you have questions, contact your IT admin.

 However from my emulator device running Android 15, I could join the enterprise using work profile.

  • Elijah's avatar
    Elijah
    Level 2.0: Eclair
    5 days ago

    I have been able to setup a work profile from my google pixel 7 phone; the reason why it was not setting up was because there were about 4 users on the device, which was the maximum, I had to delete a user and try to setup the work profile again. I also ensured I had enough storage on my device.

    However, I can't still setup work profile(BYOD) on the tecno device, I am suspecting it might be due to low memory(the device has 2gb of RAM).

    Thanks jasonbayton, Moombas for the assistance.

    • Moombas's avatar
      Moombas
      Level 4.1: Jelly Bean
      5 days ago

      Hmm, wonder why 4 users (or even more) on a single device make sense, so from my perspective unexpected but nice that you figured it out at least for 1 device.

       

      Ever tried a completely fresh tecno device and add it then (without anything special installed,) so only 1 "private user" and then try adding the work profile?

      Low RAM should only cause a device acting slow.

      • jasonbayton's avatar
        jasonbayton
        Level 4.0: Ice Cream Sandwich
        5 days ago

        Low-ram devices may opt out of Work profile support.

         

        These were two excellent examples to remind me to to ask far more detail about the device. Good edge cases!

  • Moombas's avatar
    Moombas
    Level 4.1: Jelly Bean
    12 days ago

    Hi, i guess because of enrollment QR, it's cope, so try to add the relevant PROVISIONING_MODE to the enrollment QR. Example:

    "android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE":{"PROVISIONING_MODE":"MANAGED_PROFILE"}

    I have in mind, this is required for COPE or even FULLY_MANAGED_DEVICE for a COBO.

    • jasonbayton's avatar
      jasonbayton
      Level 4.0: Ice Cream Sandwich
      12 days ago

      Nah that isn't required. 

  • jasonbayton's avatar
    jasonbayton
    Level 4.0: Ice Cream Sandwich
    14 days ago

    Ok, it looks fine. 

     

    Can you replicate this with a new token, and are you ensuring you aren't just allowing the token to expire? The default expiry time isn't very long. What does your token.create payload look like?

    • Elijah's avatar
      Elijah
      Level 2.0: Eclair
      13 days ago

      yes, my token expiry is about 24hrs...

      here is the token create payload function:

      private static String getQrCodeStringWorkProfile(String enterpriseName, String policyName) throws GeneralSecurityException, IOException {
      EnrollmentToken token =
      new EnrollmentToken().setPolicyName(policyName).setDuration("86400s").setAllowPersonalUsage("PERSONAL_USAGE_ALLOWED");
      
      return getAndroidManagementClient()
      .enterprises()
      .enrollmentTokens()
      .create(enterpriseName, token)
      .execute().getQrCode();
      }

       

      • jasonbayton's avatar
        jasonbayton
        Level 4.0: Ice Cream Sandwich
        12 days ago

        That also doesn't show anything obviously wrong. As you're doing a work profile, can you spin up a new token, test on problem devices, and capture a bug report immediately after failure?

  • jasonbayton's avatar
    jasonbayton
    Level 4.0: Ice Cream Sandwich
    14 days ago

    Could you pop the full JSON payload here? Obscure the token first 

    • Elijah's avatar
      Elijah
      Level 2.0: Eclair
      14 days ago

      You mean this, the enrollment QR code JSON payload:

       

      {"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME":"com.google.android.apps.work.clouddpc/.receivers.CloudDeviceAdminReceiver","android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM":"I5YvS0O5hXY46mb01BlRjq4oJJGs2kuUcHvVkAPEXlg","android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION":"https://play.google.com/managed/downloadManagingApp?identifier=setup","android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE":{"com.google.android.apps.work.clouddpc.EXTRA_ENROLLMENT_TOKEN":"BV****BTAAHYOMWOJNZT"}}

       

      I am using the AMA Java library