question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PostAuth activity not getting called.

See original GitHub issue

@iainmcgin Our qa finally got a phone into the right state for this to happen. Here’s the short version of the activity stack:

Running activities (most recent first):
  TaskRecord{e189f08 #3014 A=com.xfinity.digitalhome U=0 sz=2}
    Run #5: ActivityRecord{becfc11 u0 com.android.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity t3014}
    Run #4: ActivityRecord{a86dbf9 u0 com.xfinity.digitalhome/.auth.LoginActivity t3014}
  TaskRecord{eb020c6 #3012 A=com.google.android.gm U=0 sz=1}
    Run #3: ActivityRecord{db2673d u0 com.google.android.gm/.ConversationListActivityGmail t3012}
  TaskRecord{71ca3b4 #3008 A=com.google.android.apps.photos U=0 sz=3}
    Run #2: ActivityRecord{cb4ef2b u0 com.google.android.apps.photos/.localmedia.ui.LocalPhotosActivity t3008}
    Run #1: ActivityRecord{6a19a96 u0 com.google.android.apps.photos/.albums.grid.DeviceFoldersActivity t3008}
    Run #0: ActivityRecord{c47be97 u0 com.google.android.apps.photos/.home.HomeActivity t3008}

mResumedActivity: ActivityRecord{becfc11 u0 com.android.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity t3014}
mLastPausedActivity: ActivityRecord{ae0efd4 u0 com.xfinity.digitalhome/net.openid.appauth.AuthorizationManagementActivity t3014 f}

However, when the RedirectURIReceiverActivity is called, it’s interesting that the activity stack dump (via adb shell dumpsys activity activities) doesn’t even report AuthorizationManagementActivity as being alive anywhere. Hence it’s calling onCreate instead of Resuming it.

Running activities (most recent first):
  TaskRecord{e189f08 #3014 A=com.xfinity.digitalhome U=0 sz=3}
    Run #6: ActivityRecord{e8b4770 u0 com.xfinity.digitalhome/net.openid.appauth.RedirectUriReceiverActivity t3014}
    Run #5: ActivityRecord{becfc11 u0 com.android.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity t3014}
    Run #4: ActivityRecord{a86dbf9 u0 com.xfinity.digitalhome/.auth.LoginActivity t3014}
  TaskRecord{eb020c6 #3012 A=com.google.android.gm U=0 sz=1}
    Run #3: ActivityRecord{db2673d u0 com.google.android.gm/.ConversationListActivityGmail t3012}
  TaskRecord{71ca3b4 #3008 A=com.google.android.apps.photos U=0 sz=3}
    Run #2: ActivityRecord{cb4ef2b u0 com.google.android.apps.photos/.localmedia.ui.LocalPhotosActivity t3008}
    Run #1: ActivityRecord{6a19a96 u0 com.google.android.apps.photos/.albums.grid.DeviceFoldersActivity t3008}
    Run #0: ActivityRecord{c47be97 u0 com.google.android.apps.photos/.home.HomeActivity t3008}

mResumedActivity: ActivityRecord{e8b4770 u0 com.xfinity.digitalhome/net.openid.appauth.RedirectUriReceiverActivity t3014}
mLastPausedActivity: ActivityRecord{becfc11 u0 com.android.chrome/org.chromium.chrome.browser.customtabs.CustomTabActivity t3014}

I would have expected the AuthorizationManagementActivity to be in the same task record as my LoginActivity which is launching the authorization attempt. I have the full traces if you want them at 3 points in time:

  1. When on the custom tab
  2. When at a breakpoint in RedirectUriReceiverActivity before it sends the intent for AuthorizationManagementActivity
  3. When in the onCreate after that intent has been delivered.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:36 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mattingercommented, Sep 13, 2017

@iainmcgin I’ve been able now to produce this consistently. I installed an android 4.4.4 vm into genymotion. I also moved to the startActivityForResult/onActivityResult model, instead of using the service to start the activity.

However, when i call startActivityForResult, i get an immediate callback to onActivityResult, even before the onCreate of AuthorizationManagementActivity is called.

This seems to be due to the launchMode=“singleTask” present in the manifest.

Here’s a stack overflow post which points out the issue:

https://stackoverflow.com/questions/8960072/onactivityresult-with-launchmode-singletask

Changing that to launchMode=“singleTop” fixes things:

    <activity
        android:name="net.openid.appauth.AuthorizationManagementActivity"
        android:exported="false"
        android:launchMode="singleTop"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"
        tools:node="replace" />
0reactions
AshikAzeezcommented, Apr 26, 2020

android:launchMode="singleInstance" working for me. its calling override fun onNewIntent(intent: Intent?) Android Version:9 Screenshot from 2020-04-27 01-57-19 Screenshot from 2020-04-27 01-58-34 Screenshot from 2020-04-27 02-00-05

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSO SAML Auth service Post activity not triggered
In the SSO Auth service, after the user is authenticated, we want to load/switch to appropriate access group based on some criteria. For...
Read more >
How to proper post auth and login, cant seem to get it to work
Using choose options for developer tools. Click on the network tab and then headers. Input your url. You should see a name admin.booking.com....
Read more >
Logging sftp commands - Red Hat Customer Portal
I have a RHEL 7.2 system that I have set up a chroot jail and need to get some verbose logging but have...
Read more >
UDMP Guest portal not working | Ubiquiti Community
The Pre/Post auth rules are auto added by the new interface of UDMP controllder, manually added is the 10.0.0.1/32 address. When client connects,...
Read more >
Aruba Instant 6.4.3.x-4.2 Syslog Messages Reference Guide
Description: The RADIUS attribute is not known. ... receiving EAP packets from SOS before it received the New-AP message from STM. Execute.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found