Create version 2 of InstalledAppDetails
- this is the first step for converting InstalledAppDetails into DashboardFragment - add a feature flag to determine whether to show the new installed app detail page. - decouple the fragment from AppInfoBase: extends from SettingsPreferenceFragment directly and copy all codes from AppInfoBase. Bug: 69384089 Test: make RunSettingsRoboTests Change-Id: If1ab5b216620eaba1d6bde20e65e7a602931fd94
This commit is contained in:
@@ -17,21 +17,29 @@
|
||||
package com.android.settings.applications;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
|
||||
public class InstalledAppDetailsTop extends SettingsActivity {
|
||||
|
||||
@Override
|
||||
public Intent getIntent() {
|
||||
Intent modIntent = new Intent(super.getIntent());
|
||||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, InstalledAppDetails.class.getName());
|
||||
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.APP_INFO_V2)) {
|
||||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, AppInfoDashboardFragment.class.getName());
|
||||
} else {
|
||||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, InstalledAppDetails.class.getName());
|
||||
}
|
||||
return modIntent;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isValidFragment(String fragmentName) {
|
||||
if (InstalledAppDetails.class.getName().equals(fragmentName)) return true;
|
||||
return false;
|
||||
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.APP_INFO_V2)) {
|
||||
return AppInfoDashboardFragment.class.getName().equals(fragmentName);
|
||||
}
|
||||
return InstalledAppDetails.class.getName().equals(fragmentName);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user