Zongle Wang

Results 374 comments of Zongle Wang
trafficstars

And I found the usage in Gradle like below, I'm trying to patch to ktlint https://github.com/gradle/gradle/blob/bd9a393c61eff03166198ef167857356313ad1ac/gradle/verification-metadata.xml#L727-L737

Dup with #21271, can be solved by https://github.com/gradle/gradle/issues/21271#issuecomment-1191143416 or https://github.com/gradle/gradle/issues/21271#issuecomment-1191657988.

```kotlin if (isDefaultLauncher) { // normal } else { startActivity(Intent(Settings.ACTION_HOME_SETTINGS)) } val isDefaultLauncher: Boolean get() = activity?.application?.isDefaultLauncher() == true fun ContextWrapper.isDefaultLauncher(): Boolean = getDefaultLauncherPackageName() == packageName fun ContextWrapper.getDefaultLauncherPackageName(): String? =...

Code below works not well. ```kotlin fun Context.setDefaultLauncher() { if (Build.VERSION.SDK_INT >= 33) { startActivity(Intent(Settings.ACTION_HOME_SETTINGS)) } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { getSystemService(RoleManager::class.java)?.let { roleManager -> val isRoleAvailable = roleManager.isRoleAvailable(RoleManager.ROLE_HOME)...

Find a workaround but not sure why. ```kotlin class FakeLauncherActivity : Activity() ``` ```xml ``` ```kotlin fun Context.setLauncher() { val componentName = ComponentName(this, FakeLauncherActivity::class.java) packageManager.setComponentEnabledSetting( componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP ) val...

Maybe, I need to borrow a physical device to test.

Seems on the Android 13 emulator, the system doesn't send `Intent.ACTION_CLOSE_SYSTEM_DIALOGS` broadcast after tap home button.

I'm retrying on my physical Pixel 6 (Android 13), still can't work. https://user-images.githubusercontent.com/10363352/198933338-0fe86b61-bee2-4927-9022-78aeb8939121.mov

@TheGamer1002 Did you upgrade your Pixel 6 pro to Android 13?