Fixes sound panel create multiple SoundSettings activity

- Use FLAG_ACTIVITY_NEW_TASK to prevent activity stack contains
many activites

Fixes: 142231489
Test: 1. Press volume button and click in volume settings button
      2. Press Media Volume to open SoundSettings
      3. Repeat 1, Press Call Volume to open SoundSettings
      4. Repeat 1, Press Alarm Volume to open SoundSettings
      5. Press back, should see volume panel
Change-Id: I87cd75fbd43f77446191ad50ed7a002a2202337f
This commit is contained in:
Raff Tsai
2019-12-18 18:30:13 +08:00
parent b2380eaaee
commit a9e7517f2c

View File

@@ -240,6 +240,8 @@ public class SliceBuilderUtils {
searchDestination.putExtra(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, key)
.setAction("com.android.settings.SEARCH_RESULT_TRAMPOLINE")
.setComponent(null);
searchDestination.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
return searchDestination;
}