Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test DPC UI app crashes immediately as soon as it is launched #223

Closed
1infoteste opened this issue Jul 3, 2024 · 8 comments
Closed

Test DPC UI app crashes immediately as soon as it is launched #223

1infoteste opened this issue Jul 3, 2024 · 8 comments

Comments

@1infoteste
Copy link

1infoteste commented Jul 3, 2024

I've been unable to launch Test DPC's policy settings app since last May, it crashes instantly when I try to launch it. Device is Samsung Galaxy A34 5G. OS is Android 14 w/ Samsung's OneUI 6.0. The version I'm running is the one available at Google Play.

@1infoteste 1infoteste changed the title Test DPC UI app crashes immediately when it is launched Test DPC UI app crashes immediately as soon as it is launched Jul 3, 2024
@michal-murin
Copy link

I confirm this is an issue on Android 13, OneUI 5.1 too. In my case no crash occurs, but the UI is not reacting at all. The only way to remove the device owner is via the app itself which is not possible right now.

@1infoteste
Copy link
Author

I've tried again after installing the 07/17 update. Still crashes on launch but the error message has changed, now Android suggests me to clear cache or tells me that the app is buggy instead of suggesting me to put it to Deep Sleep.

@1infoteste
Copy link
Author

1infoteste commented Jul 20, 2024

Tried again after installing the 07/19 update. Issue still persists, same behavior as before.

@pfmaggi
Copy link
Collaborator

pfmaggi commented Aug 29, 2024

Can you share some additional information and logs / bugreport about this crashes?

How are you installing TestDPC and setting it up as Device Owner or Profile Owner?

@1infoteste
Copy link
Author

I've set it as up as a Device Owner following the instructions on the README. I'm not a dev, just using the app for productivity, so I don't really know how to generate a log ATM.

@pfmaggi
Copy link
Collaborator

pfmaggi commented Sep 2, 2024

TestDPC is a test application and should not be used in production.

I'm closing the issue as we can't reproduce it.

@pfmaggi pfmaggi closed this as completed Sep 2, 2024
@michal-murin
Copy link

Hello, I'm aware of the fact it's an application meant for testing. We use it when we don't want to use a real UEM.

I've just installed the TestDPC app from the Google Play:

  • version 9.0.12
  • device Google Pixel 7
  • OS Android 15 Beta (AP31.240517.031)

I've set the device owner using this adb command:

adb shell dpm set-device-owner "com.afwsamples.testdpc/.DeviceAdminReceiver"

When I start the app the logcat in Android Studio is immediately flooded with new logs the app crashes. When I filtered the logs for com.afwsamples.testdpc I saw a pattern of repeating the same logs over and over again.

Transition requested (#3189): android.os.BinderProxy@6447e64 TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=39 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.afwsamples.testdpc/.PolicyManagementActivity } baseActivity=ComponentInfo{com.afwsamples.testdpc/com.afwsamples.testdpc.PolicyManagementActivity} topActivity=ComponentInfo{com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} origActivity=null realActivity=ComponentInfo{com.afwsamples.testdpc/com.afwsamples.testdpc.PolicyManagementActivity} numActivities=2 lastActiveTime=1817345 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@f0478cd} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 136 - 0, 0) topActivityInfo=ActivityInfo{d441582 com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=true appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= falseisLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false topActivityEligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=1080 topActivityLetterboxHeight=2400 isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false cameraCompatTaskInfo=CameraCompatTaskInfo { cameraCompatControlState=hidden freeformCameraCompatMode=inactive}}}, pipTask = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 3189 }
com.afwsamples.testdpc:19fc985: onRequestHide at ORIGIN_SERVER reason HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR fromUser false
com.afwsamples.testdpc:19fc985: onCancelled at PHASE_SERVER_SHOULD_HIDE
GoogleInputMethodService.onStartInput():1937 onStartInput(EditorInfo{EditorInfo{packageName=com.afwsamples.testdpc, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=0, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false)
App-specific configuration not found for packageName: com.afwsamples.testdpc and userId: 0
Sent Transition (#3189) createdAt=10-01 12:12:33.207 via request=TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=39 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.afwsamples.testdpc/.PolicyManagementActivity } baseActivity=ComponentInfo{com.afwsamples.testdpc/com.afwsamples.testdpc.PolicyManagementActivity} topActivity=ComponentInfo{com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} origActivity=null realActivity=ComponentInfo{com.afwsamples.testdpc/com.afwsamples.testdpc.PolicyManagementActivity} numActivities=2 lastActiveTime=1817345 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{e920af4 Task{285608a #39 type=standard A=10297:com.afwsamples.testdpc}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 136 - 0, 0) topActivityInfo=ActivityInfo{2482a04 com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=true appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= falseisLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false topActivityEligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=1080 topActivityLetterboxHeight=2400 isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false cameraCompatTaskInfo=CameraCompatTaskInfo { cameraCompatControlState=hidden freeformCameraCompatMode=inactive}}}, pipTask = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 3189 }
Permission grant result requestId=-1343711486182311052 callingUid=10297 callingPackage=com.afwsamples.testdpc permission=android.permission.POST_NOTIFICATIONS isImplicit=false result=2 isPermissionRationaleShown=falseisPackageRestrictedByEnhancedConfirmation=true
Transition requested (#3191): android.os.BinderProxy@dad2da TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=39 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.afwsamples.testdpc/.PolicyManagementActivity } baseActivity=ComponentInfo{com.afwsamples.testdpc/com.afwsamples.testdpc.PolicyManagementActivity} topActivity=ComponentInfo{com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} origActivity=null realActivity=ComponentInfo{com.afwsamples.testdpc/com.afwsamples.testdpc.PolicyManagementActivity} numActivities=2 lastActiveTime=1817413 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@806630b} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 136 - 0, 0) topActivityInfo=ActivityInfo{267b5e8 com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=true appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= falseisLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false topActivityEligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=1080 topActivityLetterboxHeight=2400 isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false cameraCompatTaskInfo=CameraCompatTaskInfo { cameraCompatControlState=hidden freeformCameraCompatMode=inactive}}}, pipTask = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 3191 }
com.afwsamples.testdpc:ca7c4814: onRequestHide at ORIGIN_SERVER reason HIDE_SAME_WINDOW_FOCUSED_WITHOUT_EDITOR fromUser false
com.afwsamples.testdpc:ca7c4814: onCancelled at PHASE_SERVER_SHOULD_HIDE
GoogleInputMethodService.onStartInput():1937 onStartInput(EditorInfo{EditorInfo{packageName=com.afwsamples.testdpc, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=0, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false)
App-specific configuration not found for packageName: com.afwsamples.testdpc and userId: 0
Sent Transition (#3191) createdAt=10-01 12:12:33.275 via request=TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=39 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.afwsamples.testdpc/.PolicyManagementActivity } baseActivity=ComponentInfo{com.afwsamples.testdpc/com.afwsamples.testdpc.PolicyManagementActivity} topActivity=ComponentInfo{com.google.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} origActivity=null realActivity=ComponentInfo{com.afwsamples.testdpc/com.afwsamples.testdpc.PolicyManagementActivity} numActivities=2 lastActiveTime=1817413 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{e920af4 Task{285608a #39 type=standard A=10297:com.afwsamples.testdpc}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 136 - 0, 0) topActivityInfo=ActivityInfo{26250fb com.android.permissioncontroller.permission.ui.GrantPermissionsActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=true appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false topActivityEligibleForLetterboxEducation= falseisLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false topActivityEligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=1080 topActivityLetterboxHeight=2400 isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false cameraCompatTaskInfo=CameraCompatTaskInfo { cameraCompatControlState=hidden freeformCameraCompatMode=inactive}}}, pipTask = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 3191 }
Permission grant result requestId=-6704129847348223229 callingUid=10297 callingPackage=com.afwsamples.testdpc permission=android.permission.POST_NOTIFICATIONS isImplicit=false result=2 isPermissionRationaleShown=falseisPackageRestrictedByEnhancedConfirmation=true

The notifications permission is mentioned and indeed, I have not granted the app the notifications permission.

Looks like a stack overflow caused by the permission not being granted, because granting the permission in the Settings -> Apps -> etc. makes the app working again :)

@pfmaggi
Copy link
Collaborator

pfmaggi commented Oct 1, 2024

Can you please open a different issue?

Also, please review your reproduction steps. Installing TestDPC from Play requires setting up an account on the device and that block setting TestDPC as device owner:

$ adb shell dpm set-device-owner com.afwsamples.testdpc/.DeviceAdminReceiver

Exception occurred while executing 'set-device-owner':
java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device.
        at com.android.server.devicepolicy.DevicePolicyManagerService.enforceCanSetDeviceOwnerLocked(DevicePolicyManagerService.java:10745)
        at com.android.server.devicepolicy.DevicePolicyManagerService.setDeviceOwner(DevicePolicyManagerService.java:9393)
        at com.android.server.devicepolicy.DevicePolicyManagerServiceShellCommand.runSetDeviceOwner(DevicePolicyManagerServiceShellCommand.java:264)
        at com.android.server.devicepolicy.DevicePolicyManagerServiceShellCommand.onCommand(DevicePolicyManagerServiceShellCommand.java:87)
        at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
        at android.os.ShellCommand.exec(ShellCommand.java:38)
        at com.android.server.devicepolicy.DevicePolicyManagerService.onShellCommand(DevicePolicyManagerService.java:11168)
        at android.os.Binder.shellCommand(Binder.java:1230)
        at android.os.Binder.onTransact(Binder.java:1043)
        at android.app.admin.IDevicePolicyManager$Stub.onTransact(IDevicePolicyManager.java:6442)
        at android.os.Binder.execTransactInternal(Binder.java:1505)
        at android.os.Binder.execTransact(Binder.java:1444)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants