Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11a5c2ad authored by Chaohui Wang's avatar Chaohui Wang
Browse files

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
parent 4caebd37
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -17,12 +17,28 @@
package com.android.settings.applications;

import android.content.Intent;
import android.os.Bundle;
import android.util.FeatureFlagUtils;

import com.android.settings.SettingsActivity;
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 {

    @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
    public Intent getIntent() {
        Intent modIntent = new Intent(super.getIntent());
+7 −0
Original line number Diff line number Diff line
@@ -60,6 +60,13 @@ object AppSettingsProvider : SettingsPageProvider {

    @Composable
    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