OSDN Git Service

Fix settings back button return to previous launched page
authorSunny Shao <sunnyshao@google.com>
Tue, 18 Jun 2019 05:32:05 +0000 (13:32 +0800)
committerRaff Tsai <rafftsai@google.com>
Tue, 18 Jun 2019 06:00:46 +0000 (06:00 +0000)
QuickSetting use FLAG_ACTIVITY_NEW_TASK flag to launch setting page. It shares the same
taskid with Settings. That's why user press BACK key will return the previous settings
page. Now add the new taskAffinity in Settings homepage to fix this problem.

Fixes: 135018024
Test: manual & robotest
Change-Id: Ic73645e9afe5415691f0696c5ae33a9eacda6d50

AndroidManifest.xml

index 4b070a6..07dd1dd 100644 (file)
         <activity android:name=".homepage.SettingsHomepageActivity"
                   android:label="@string/settings_label_launcher"
                   android:theme="@style/Theme.Settings.Home"
+                  android:taskAffinity="com.android.settings.root"
                   android:launchMode="singleTask">
             <intent-filter android:priority="1">
                 <action android:name="android.settings.SETTINGS" />
         <!-- Alias for launcher activity only, as this belongs to each profile. -->
         <activity-alias android:name="Settings"
                 android:label="@string/settings_label_launcher"
+                android:taskAffinity="com.android.settings.root"
                 android:launchMode="singleTask"
                 android:targetActivity=".homepage.SettingsHomepageActivity">
             <intent-filter>