MrMannWood / launcher

Apache License 2.0
47 stars 9 forks source link

[FEATURE REQUEST] Work Apps #6

Closed 0xlne closed 2 years ago

0xlne commented 2 years ago

I have a work profile on my device & at this moment, Hex doesn't display the work apps.

triallax commented 2 years ago

Copying over my issue body from #9, in case it's useful:

I use Shelter to isolate some "Big Brother" apps from the other apps, and I can't seem to find apps in the work profile in Hex Launcher. Neither can I find them in Settings > Show All Apps, if that helps matters. I use Android 11 with a Samsung A51. Some links I found that might be useful: https://github.com/Neamar/KISS/issues/542 https://github.com/Neamar/KISS/pull/609

MrMannWood commented 2 years ago

I'm not familiar with work profiles at all, and Hex Launcher is a full re-implementation (e.g. not using the common library that most launchers use). If this is a "must have" feature for you, then you should look elsewhere for now. Sorry!

I will be looking at this as a long term task.

0xlne commented 2 years ago

Thanks for your response; for what it's worth,it's been done in some of the other FOSS apps (Posidon, Kvaesitso, Lawnchair) so a look at their source might help on how to access the list of apps within that work profile.

MrMannWood commented 2 years ago

This should be supported as as 1.4.4. I don't have access to a device with a work profile, so it would be great it someone could confirm that this actually works properly.

triallax commented 2 years ago

Unfortunately, on my device, the app crashes on launch with the following exception:

android.content.pm.PackageManager$NameNotFoundException: org.thoughtcrime.securesms
    at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:292)
    at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:264)
    at s2.d.b(Unknown Source:42)
    at s2.d.c(Unknown Source:159)
    at androidx.appcompat.widget.a1.run(:1)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.os.HandlerThread.run(HandlerThread.java:67)

org.thoughtcrime.securesms is the application ID of Signal, which I have installed in my work profile but not in my main one.

I've upgraded from Android 11 to Android 12 since I last commented, but Hex Launcher crashed before I upgraded too.

MrMannWood commented 2 years ago

Thanks for the bug report! I'll try to push a fix this weekend.

MrMannWood commented 2 years ago

It looks like this is caused because you have Signal set as one of your shortcuts. The way I'm reading and setting up the shortcuts is causing signal to crash, likely because it's in your work profile.

As a quick fix, you could clear the app's data. This will reset all of your settings (sorry!) but will solve the crashing problem. You would also need to not set another work profile app as a shortcut until I've implemented a proper fix.

triallax commented 2 years ago

Sorry, but I have no idea what you mean by setting Signal as one of my shortcuts. Also, clearing Hex Launcher's data (assuming that is what you mean by "app") doesn't fix the crash.

Sorry if I misunderstood something here.

MrMannWood commented 2 years ago

Nope, you've provided extremely valuable information.

0xlne commented 2 years ago

I tried updating from 1.4.3 to 1.4.5 (f-droid) & it kept crashing on launching. I also tried clearing app data, as well as uninstalling & installing from scratch - all with the same effect. 2 devices were tested: Samsung Galaxy Note 10+ on Android 11, & RedMagic 6 on Android 11.

Here's a logcat from the latter:

05-18 16:35:02.616 2343 3222 I CustomCommand: onActivityChange: com.mrmannwood.hexlauncher/.launcher.LauncherActivity isfull=true 05-18 16:35:02.616 17483 17483 I NubiaBinderProxy: initLastBindTime: USE_CACHE = true 05-18 16:35:02.618 3410 16567 E ProcessManager: r pkg:[com.mrmannwood.hexlauncher,0,1] 05-18 16:35:02.620 5273 5273 D ZLauncher3-R: -> onTaskSnapshotChanged() snapshot = com.android.systemui.shared.recents.model.ThumbnailData@2c542b7 05-18 16:35:02.620 17483 17483 I ActivityThread: bindApplication App com.mrmannwood.hexlauncher bindPrimeCore succeed 05-18 16:35:02.629 17483 17483 I ActivityThread: performLaunchActivity App com.mrmannwood.hexlauncher bindPrimeCore succeed 05-18 16:35:02.632 17483 17483 I ActivityThread: performLaunchActivity: ActivityInfo{34bd57 com.mrmannwood.hexlauncher.launcher.LauncherActivity} 05-18 16:35:02.632 17483 17483 W NubiaXmlCacheController: startCache() called 05-18 16:35:02.633 17483 17483 D ActivityThread: registerLongSnapReceiver for com.mrmannwood.hexlauncher.LauncherApplication@966a298 05-18 16:35:02.637 1003 1082 W DisplayIdentification: Invalid EDID: falling back to serial number due to missing display name. 05-18 16:35:02.637 1003 1082 W DisplayIdentification: Invalid EDID: falling back to ASCII text due to missing serial number. 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: QUALCOMM build : f7fceaaafa, I5121de8c99 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: Build Date : 11/12/20 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.35.01.01 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: Local Branch : 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: Remote Branch : 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: Remote Branch : 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: Reconstruct Branch : 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: Build Config : S P 10.0.7 AArch64 05-18 16:35:02.638 17483 17515 I AdrenoGLES-0: Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so 05-18 16:35:02.642 17483 17483 W DecorView[]: initIsSupportRecognition 669 or 666 do not support Recognition 05-18 16:35:02.644 17483 17515 I AdrenoGLES-0: PFP: 0x016dc087, ME: 0x00000000 05-18 16:35:02.239 0 0 D msm_dwc3_perf_vote_work: in_perf_mode:0, interrupts in last sample:389 05-18 16:35:02.662 5273 14112 I ZLauncher3-R: RecentsModel -> onTaskStackChangedBackground() userId = 0 05-18 16:35:02.664 5273 14112 I LoadPlan: preloadPlan new mRawTasks.size()=7 05-18 16:35:02.592 1543 1573 W ActivityManager: exception happend in cpusetForColdAPP 05-18 16:35:02.665 17483 17520 E ActivityThread: Failed to find provider info for cn.nubia.gamelauncher.db.AppAddProvider 05-18 16:35:02.669 17483 17483 I ViewRootImpl: updateForceDarkMode: useAutoDark = false 05-18 16:35:02.670 17483 17483 I ViewRootImpl: startAppTraversalsAccelerate mBasePackageName = com.mrmannwood.hexlauncher ,isEnableAppTraversalsAccelerate = true ,hasPendingPauseActivity = false 05-18 16:35:02.302 0 0 E [ZtemtDisp] [cabc_store: 345] cabc value = 25 05-18 16:35:02.723 1543 1571 D ArtManagerInternalImpl: /data/misc/iorapd/com.mrmannwood.hexlauncher/47/com.mrmannwood.hexlauncher.launcher.LauncherActivity/compiled_traces/compiled_trace.pb doesn't exist 05-18 16:35:02.312 0 0 E [ZtemtDisp] [cabc_store: 356] success to set cabc as = 25 05-18 16:35:02.724 1543 1571 I ActivityTaskManager: Displayed com.mrmannwood.hexlauncher/.launcher.LauncherActivity: +185ms 05-18 16:35:02.728 17483 17510 E AndroidRuntime: FATAL EXCEPTION: PackageManagerThread 05-18 16:35:02.728 17483 17510 E AndroidRuntime: Process: com.mrmannwood.hexlauncher, PID: 17483 05-18 16:35:02.728 17483 17510 E AndroidRuntime: android.content.pm.PackageManager$NameNotFoundException: com.microsoft.emmx 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:282) 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:254) 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at s2.d.b(Unknown Source:42) 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at s2.d.c(Unknown Source:159) 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at androidx.appcompat.widget.a1.run(:1) 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:938) 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at android.os.Looper.loop(Looper.java:262) 05-18 16:35:02.728 17483 17510 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67) 05-18 16:35:02.728 17483 17510 W System.err: Application uncaught exception in thread "PackageManagerThread" android.content.pm.PackageManager$NameNotFoundException: com.microsoft.emmx 05-18 16:35:02.728 17483 17510 W System.err: at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:282) 05-18 16:35:02.728 17483 17510 W System.err: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:254) 05-18 16:35:02.728 17483 17510 W System.err: at s2.d.b(Unknown Source:42) 05-18 16:35:02.728 17483 17510 W System.err: at s2.d.c(Unknown Source:159) 05-18 16:35:02.728 17483 17510 W System.err: at androidx.appcompat.widget.a1.run(:1) 05-18 16:35:02.728 17483 17510 W System.err: at android.os.Handler.handleCallback(Handler.java:938) 05-18 16:35:02.728 17483 17510 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99) 05-18 16:35:02.728 17483 17510 W System.err: at android.os.Looper.loop(Looper.java:262) 05-18 16:35:02.728 17483 17510 W System.err: at android.os.HandlerThread.run(HandlerThread.java:67) 05-18 16:35:02.730 1543 2569 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1117 com.android.server.am.ActivityManagerService.feedbackIssue:22550 com.android.server.am.ActivityManagerService.feedbackCrash:22563 com.android.server.am.ActivityManagerService.handleApplicationCrashInner:10950 com.android.server.am.ActivityManagerService.handleApplicationCrash:10880 05-18 16:35:02.730 1543 17527 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2 05-18 16:35:02.731 1543 2569 W ActivityTaskManager: Force finishing activity com.mrmannwood.hexlauncher/.launcher.LauncherActivity 05-18 16:35:02.736 1543 2569 D ActivityTrigger: ActivityTrigger activityPauseTrigger 05-18 16:35:02.737 1543 2569 E Vibration4DService: notePausingActivity packageName:com.mrmannwood.hexlauncher,windowMode:1 05-18 16:35:02.741 5273 5273 D ZLauncher3-R: -> onTaskSnapshotChanged() snapshot = com.android.systemui.shared.recents.model.ThumbnailData@cd5b742

MrMannWood commented 2 years ago

Should be fixed in 1.4.6. I don't have a work profile and can't confirm, but fingers are crossed. Reopen if crash continues.