Update pref fragment for "see all" in app & notification

Instead of launching intent, now to launches all app list as a
subsetting. This is more consistent with the other setting pages and
fixes a task affinity issue.

Change-Id: I0464a2b8f46d46f06bcf297c0f876ae12a7c490b
Fixes: 74205806
Test: robotests
This commit is contained in:
Fan Zhang
2018-03-05 14:22:46 -08:00
parent 22a39c2b93
commit 0ced370427
2 changed files with 13 additions and 16 deletions

View File

@@ -32,19 +32,14 @@
<Preference <Preference
android:title="@string/applications_settings" android:title="@string/applications_settings"
android:key="all_app_info" android:key="all_app_info"
android:order="20"> android:fragment="com.android.settings.applications.manageapplications.ManageApplications"
<intent android:order="20" />
android:action="android.intent.action.MAIN"
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.Settings$ManageApplicationsActivity">
</intent>
</Preference>
</PreferenceCategory> </PreferenceCategory>
<!-- Empty category to draw divider --> <!-- Empty category to draw divider -->
<PreferenceCategory <PreferenceCategory
android:key="all_app_info_divider" android:key="all_app_info_divider"
android:order="-190"/> android:order="-190" />
<!-- Notifications (appears before manage_perms), default apps (appears after) --> <!-- Notifications (appears before manage_perms), default apps (appears after) -->
<PreferenceCategory <PreferenceCategory

View File

@@ -96,9 +96,7 @@ import com.android.settings.applications.appinfo.AppNotificationPreferenceContro
import com.android.settings.applications.appinfo.DrawOverlayDetails; import com.android.settings.applications.appinfo.DrawOverlayDetails;
import com.android.settings.applications.appinfo.ExternalSourcesDetails; import com.android.settings.applications.appinfo.ExternalSourcesDetails;
import com.android.settings.applications.appinfo.WriteSettingsDetails; import com.android.settings.applications.appinfo.WriteSettingsDetails;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.InstrumentedPreferenceFragment;
import com.android.settings.core.SubSettingLauncher; import com.android.settings.core.SubSettingLauncher;
import com.android.settings.dashboard.SummaryLoader; import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.fuelgauge.HighPowerDetail; import com.android.settings.fuelgauge.HighPowerDetail;
@@ -132,7 +130,7 @@ import java.util.Set;
* can be launched through Settings or via the ACTION_MANAGE_PACKAGE_STORAGE * can be launched through Settings or via the ACTION_MANAGE_PACKAGE_STORAGE
* intent. * intent.
*/ */
public class ManageApplications extends InstrumentedPreferenceFragment public class ManageApplications extends InstrumentedFragment
implements View.OnClickListener, OnItemSelectedListener { implements View.OnClickListener, OnItemSelectedListener {
static final String TAG = "ManageApplications"; static final String TAG = "ManageApplications";
@@ -286,6 +284,9 @@ public class ManageApplications extends InstrumentedPreferenceFragment
mListType = LIST_TYPE_WIFI_ACCESS; mListType = LIST_TYPE_WIFI_ACCESS;
screenTitle = R.string.change_wifi_state_title; screenTitle = R.string.change_wifi_state_title;
} else { } else {
if (screenTitle == -1) {
screenTitle = R.string.application_info_label;
}
mListType = LIST_TYPE_MAIN; mListType = LIST_TYPE_MAIN;
} }
final AppFilterRegistry appFilterRegistry = AppFilterRegistry.getInstance(); final AppFilterRegistry appFilterRegistry = AppFilterRegistry.getInstance();
@@ -551,14 +552,15 @@ public class ManageApplications extends InstrumentedPreferenceFragment
startAppInfoFragment(DirectoryAccessDetails.class, R.string.directory_access); startAppInfoFragment(DirectoryAccessDetails.class, R.string.directory_access);
break; break;
case LIST_TYPE_WIFI_ACCESS: case LIST_TYPE_WIFI_ACCESS:
startAppInfoFragment(ChangeWifiStateDetails.class, R.string.change_wifi_state_title); startAppInfoFragment(ChangeWifiStateDetails.class,
R.string.change_wifi_state_title);
break; break;
// TODO: Figure out if there is a way where we can spin up the profile's settings // TODO: Figure out if there is a way where we can spin up the profile's settings
// process ahead of time, to avoid a long load of data when user clicks on a managed // process ahead of time, to avoid a long load of data when user clicks on a managed
// app. Maybe when they load the list of apps that contains managed profile apps. // app. Maybe when they load the list of apps that contains managed profile apps.
default: default:
startAppInfoFragment( startAppInfoFragment(
AppInfoDashboardFragment.class, R.string.application_info_label); AppInfoDashboardFragment.class, R.string.application_info_label);
break; break;
} }
} }
@@ -1234,8 +1236,8 @@ public class ManageApplications extends InstrumentedPreferenceFragment
case LIST_TYPE_NOTIFICATION: case LIST_TYPE_NOTIFICATION:
if (entry.extraInfo != null) { if (entry.extraInfo != null) {
holder.setSummary( holder.setSummary(
AppNotificationPreferenceController.getNotificationSummary( AppNotificationPreferenceController.getNotificationSummary(
(AppRow) entry.extraInfo, mContext)); (AppRow) entry.extraInfo, mContext));
} else { } else {
holder.setSummary(null); holder.setSummary(null);
} }