Add debug flag for App Settings page
Default no-op, if SETTINGS_ENABLE_SPA is enabled, InstalledAppDetailsTop will navigate to SPA AppSettings instead of AppInfoDashboardFragment. Bug: 236346018 Test: Manual with Settings App Change-Id: I0b8a668df1f8783b860baae1d912157f742baf3f
This commit is contained in:
@@ -17,12 +17,28 @@
|
|||||||
package com.android.settings.applications;
|
package com.android.settings.applications;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.FeatureFlagUtils;
|
||||||
|
|
||||||
import com.android.settings.SettingsActivity;
|
import com.android.settings.SettingsActivity;
|
||||||
import com.android.settings.applications.appinfo.AppInfoDashboardFragment;
|
import com.android.settings.applications.appinfo.AppInfoDashboardFragment;
|
||||||
|
import com.android.settings.spa.SpaActivity;
|
||||||
|
import com.android.settings.spa.app.appsettings.AppSettingsProvider;
|
||||||
|
|
||||||
public class InstalledAppDetailsTop extends SettingsActivity {
|
public class InstalledAppDetailsTop extends SettingsActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedState) {
|
||||||
|
super.onCreate(savedState);
|
||||||
|
if (!FeatureFlagUtils.isEnabled(this, FeatureFlagUtils.SETTINGS_ENABLE_SPA)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String packageName = super.getIntent().getData().getSchemeSpecificPart();
|
||||||
|
SpaActivity.startSpaActivity(
|
||||||
|
this, AppSettingsProvider.INSTANCE.getRoute(packageName, getUserId()));
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Intent getIntent() {
|
public Intent getIntent() {
|
||||||
Intent modIntent = new Intent(super.getIntent());
|
Intent modIntent = new Intent(super.getIntent());
|
||||||
|
@@ -60,6 +60,13 @@ object AppSettingsProvider : SettingsPageProvider {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun navigator(app: ApplicationInfo) = navigator(route = "$name/${app.toRoute()}")
|
fun navigator(app: ApplicationInfo) = navigator(route = "$name/${app.toRoute()}")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the route to the App Settings page.
|
||||||
|
*
|
||||||
|
* Expose route to enable enter from non-SPA pages.
|
||||||
|
*/
|
||||||
|
fun getRoute(packageName: String, userId: Int): String = "$name/$packageName/$userId"
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
Reference in New Issue
Block a user