Fix "Set as Default" error in ResolverActivity
Sometimes, we have seen cases that 'set as default' feature does not work properly in ResolverActivity. This issue occurs when an activity, with 'exported=false' attribute, is included in the list returned by PackageManager.queryIntentActivities(). By the logics in ResolverListController.java#getResolversForIntent(), the activity is removed from the list. This creates a difference between the list that ResolverActivity sends to PackageManager when calling addPreferredActivity() and the list PackageManager maintains. Due to the difference, PackageManager does not set preferredActivity requested from ResolverActivity, which results the showing of ResolverActivity the next time with same action(even though user has set preferred activity). To handle this issue, we recommend that the removal logic should be removed from getResolversForIntent() method because it is already handled in ResolverListController.java#filterIneligibleActivities() through ActivityManager.checkComponentPermission() api. As the result of that, the list which will be delivered to PackageManager is not changed. Bug: b/135738126 Test: 1. Install 'JustDial' application via Play store 2. Try below command to launch ResolverActivity adb shell am start –a android.intent.action.VOICE_COMMAND 3. Pick an item on ResolverActivity, then press 'Always' button 4. Repeat the second step again. (you will see ResolverActivity comes again) (cherry picked from commit 5cdfeeaca5516a6d64fa259f9a4ffd2955f8d2ab)
Loading
Please register or sign in to comment