Skip to content

Commit

Permalink
fix: Pin shortcut ANR
Browse files Browse the repository at this point in the history
Signed-off-by: Hu Shenghao <[email protected]>
  • Loading branch information
hushenghao committed Jan 10, 2025
1 parent 3e0b5a9 commit 36849ab
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- EdgeToEdge mode is enabled on the Easter Egg pages
- Upgrade project dependencies
- Known issue fixes

### v3.3.0 (2024-12-20)

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 彩蛋相关页面开启了 EdgeToEdge 模式
- 升级项目依赖项
- 修复已知问题

### v3.3.0 (2024-12-20)

Expand Down
4 changes: 3 additions & 1 deletion basic/consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
# EdgeToEdgeCompat
-keep class androidx.activity.EdgeToEdgeImpl { *; }
-keep class * extends androidx.activity.EdgeToEdgeImpl { *; }
-keep class com.google.android.material.internal.EdgeToEdgeUtils { *; }
-keep class com.google.android.material.internal.EdgeToEdgeUtils {
public static <methods>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,16 @@ object EasterEggShortcutsHelp {
val shortcutId = FORMAT_PIN_SHORTCUT_ID.format(egg.apiLevel)
val shortcut = createShortcutInfo(context, shortcutId, egg, true)
val callback = PinShortcutReceiver.registerCallbackWithTimeout(context)
ShortcutManagerCompat.requestPinShortcut(context, shortcut, callback)
cachedExecutor.execute {
ShortcutManagerCompat.requestPinShortcut(context, shortcut, callback)
}
}

fun autoReportShortcutUsed(context: Context, intent: Intent) {
val shortcutId = intent.getStringExtra(EXTRA_SHORTCUT_ID) ?: return
ShortcutManagerCompat.reportShortcutUsed(context, shortcutId)
cachedExecutor.execute {
ShortcutManagerCompat.reportShortcutUsed(context, shortcutId)
}
}

private class PinShortcutReceiver : BroadcastReceiver() {
Expand Down
3 changes: 2 additions & 1 deletion fastlane/metadata/android/en-US/changelogs/58.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- EdgeToEdge mode is enabled on the Easter Egg pages
- Upgrade project dependencies
- Upgrade project dependencies
- Known issue fixes
3 changes: 2 additions & 1 deletion fastlane/metadata/android/zh-CN/changelogs/58.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- 彩蛋相关页面开启了 EdgeToEdge 模式
- 升级项目依赖项
- 升级项目依赖项
- 修复已知问题

0 comments on commit 36849ab

Please sign in to comment.