Settings: Initial Evolution X rebrand
Co-authored-by: AnierinB <anierin@evolution-x.org> Co-authored-by: Jackeagle <jackeagle102@gmail.com> Co-authored-by: Pranav Vashi <neobuddy89@gmail.com> Co-authored-by: ganeshi4u <ganeshvarmai4u@gmail.com> Signed-off-by: AnierinB <anierin@evolution-x.org>
This commit is contained in:
@@ -495,6 +495,7 @@ public class Settings extends SettingsActivity {
|
||||
public static class BugReportHandlerPickerActivity extends SettingsActivity { /* empty */ }
|
||||
|
||||
// Top level categories for new IA
|
||||
public static class EvolutionSettingsActivity extends SettingsActivity {}
|
||||
public static class NetworkDashboardActivity extends SettingsActivity {}
|
||||
public static class ConnectedDeviceDashboardActivity extends SettingsActivity {}
|
||||
public static class PowerUsageSummaryActivity extends SettingsActivity { /* empty */ }
|
||||
|
||||
@@ -227,7 +227,7 @@ public class ActivityEmbeddingRulesController {
|
||||
addActivityFilter(activityFilters, SettingsHomepageActivity.class);
|
||||
addActivityFilter(activityFilters, Settings.class);
|
||||
|
||||
final Intent intent = new Intent(mContext, Settings.NetworkDashboardActivity.class);
|
||||
final Intent intent = new Intent(mContext, Settings.EvolutionSettingsActivity.class);
|
||||
intent.putExtra(SettingsActivity.EXTRA_IS_SECOND_LAYER_PAGE, true);
|
||||
SplitAttributes attributes = new SplitAttributes.Builder()
|
||||
.setSplitType(SplitAttributes.SplitType.ratio(
|
||||
|
||||
@@ -217,6 +217,8 @@ import com.android.settings.wifi.p2p.WifiP2pSettings;
|
||||
import com.android.settings.wifi.savedaccesspoints2.SavedAccessPointsWifiSettings2;
|
||||
import com.android.settings.wifi.tether.WifiTetherSettings;
|
||||
|
||||
import org.evolution.settings.EvolutionSettings;
|
||||
|
||||
public class SettingsGateway {
|
||||
|
||||
/**
|
||||
@@ -361,6 +363,7 @@ public class SettingsGateway {
|
||||
AutomaticStorageManagerSettings.class.getName(),
|
||||
StorageDashboardFragment.class.getName(),
|
||||
SystemDashboardFragment.class.getName(),
|
||||
EvolutionSettings.class.getName(),
|
||||
NetworkDashboardFragment.class.getName(),
|
||||
ConnectedDeviceDashboardFragment.class.getName(),
|
||||
UsbDetailsFragment.class.getName(),
|
||||
@@ -426,6 +429,7 @@ public class SettingsGateway {
|
||||
|
||||
public static final String[] SETTINGS_FOR_RESTRICTED = {
|
||||
// Home page
|
||||
Settings.EvolutionSettingsActivity.class.getName(),
|
||||
Settings.NetworkDashboardActivity.class.getName(),
|
||||
Settings.ConnectedDeviceDashboardActivity.class.getName(),
|
||||
Settings.AppDashboardActivity.class.getName(),
|
||||
|
||||
@@ -80,20 +80,22 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
||||
private static final long TIMEOUT_MILLIS = 50L;
|
||||
|
||||
private static final List<String> ACCOUNT_INJECTED_KEYS = Arrays.asList(
|
||||
"top_level_google"
|
||||
);
|
||||
|
||||
private static final List<String> SYSTEM_INFO_INJECTED_KEYS = Arrays.asList(
|
||||
"dashboard_tile_pref_com.google.android.gms.backup.component.BackupOrRestoreSettingsActivity"
|
||||
);
|
||||
|
||||
private static final List<String> SECURITY_PRIVACY_INJECTED_KEYS = Arrays.asList(
|
||||
"top_level_wellbeing",
|
||||
"top_level_google"
|
||||
"top_level_wellbeing"
|
||||
);
|
||||
|
||||
private static final ArrayMap<String, Integer> KEY_ORDER = new ArrayMap<>();
|
||||
static {
|
||||
// We have "Passwords, passkeys & accounts with order "-10" above
|
||||
KEY_ORDER.put("top_level_wellbeing", -5);
|
||||
KEY_ORDER.put("top_level_google", 0);
|
||||
// We have "Safety & emergency with order "10" below
|
||||
// We have "Storage" with order "-50" above
|
||||
KEY_ORDER.put("dashboard_tile_pref_com.google.android.gms.backup.component.BackupOrRestoreSettingsActivity", -45);
|
||||
// We have "Battery" with order "-30" below
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -649,6 +651,8 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment
|
||||
group = screen.findPreference(tile.getGroupKey());
|
||||
} else if (ACCOUNT_INJECTED_KEYS.contains(key)) {
|
||||
group = screen.findPreference("top_level_account_category");
|
||||
} else if (SYSTEM_INFO_INJECTED_KEYS.contains(key)) {
|
||||
group = screen.findPreference("top_level_system_info_category");
|
||||
} else if (SECURITY_PRIVACY_INJECTED_KEYS.contains(key)) {
|
||||
group = screen.findPreference("top_level_security_privacy_category");
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ import com.android.settings.supervision.SupervisionDashboardFragment;
|
||||
import com.android.settings.system.SystemDashboardFragment;
|
||||
import com.android.settingslib.drawer.CategoryKey;
|
||||
|
||||
import org.evolution.settings.EvolutionSettings;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -74,8 +76,10 @@ public class DashboardFragmentRegistry {
|
||||
PARENT_TO_CATEGORY_KEY_MAP = new ArrayMap<>();
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(TopLevelSettings.class.getName(),
|
||||
CategoryKey.CATEGORY_HOMEPAGE);
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(
|
||||
NetworkDashboardFragment.class.getName(), CategoryKey.CATEGORY_NETWORK);
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(EvolutionSettings.class.getName(),
|
||||
CategoryKey.CATEGORY_EVOLVER);
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(NetworkDashboardFragment.class.getName(),
|
||||
CategoryKey.CATEGORY_NETWORK);
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(ConnectedDeviceDashboardFragment.class.getName(),
|
||||
CategoryKey.CATEGORY_CONNECT);
|
||||
PARENT_TO_CATEGORY_KEY_MAP.put(AdvancedConnectedDeviceDashboardFragment.class.getName(),
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.android.settings.deviceinfo.firmwareversion;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
public class EvolutionXBuildMaintainerPreferenceController extends BasePreferenceController {
|
||||
|
||||
private static final String TAG = "EvolutionXBuildMaintainerCtrl";
|
||||
|
||||
private String mDeviceMaintainer;
|
||||
|
||||
public EvolutionXBuildMaintainerPreferenceController(Context context, String key) {
|
||||
super(context, key);
|
||||
mDeviceMaintainer = mContext.getResources().getString(R.string.build_maintainer_summary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
if (mDeviceMaintainer.equalsIgnoreCase("UNKNOWN")) {
|
||||
return UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
return mDeviceMaintainer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 The Evolution X Project
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.android.settings.deviceinfo.firmwareversion;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.SystemProperties;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
public class EvolutionXLogoPreferenceController extends BasePreferenceController {
|
||||
|
||||
private static final Uri INTENT_URI_DATA = Uri.parse("https://evolution-x.org/");
|
||||
private static final String TAG = "EvolutionXLogoPreferenceCtrl";
|
||||
|
||||
private final PackageManager mPackageManager;
|
||||
|
||||
public EvolutionXLogoPreferenceController(Context context, String preferenceKey) {
|
||||
super(context, preferenceKey);
|
||||
mPackageManager = mContext.getPackageManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(INTENT_URI_DATA);
|
||||
if (mPackageManager.queryIntentActivities(intent, 0).isEmpty()) {
|
||||
// Don't send out the intent to stop crash
|
||||
Log.w(TAG, "queryIntentActivities() returns empty");
|
||||
return true;
|
||||
}
|
||||
|
||||
mContext.startActivity(intent);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -41,11 +41,11 @@ public class LineageVersionDetailPreferenceController extends BasePreferenceCont
|
||||
private static final int DELAY_TIMER_MILLIS = 500;
|
||||
private static final int ACTIVITY_TRIGGER_COUNT = 3;
|
||||
|
||||
private static final String KEY_LINEAGE_VERSION_PROP = "ro.lineage.version";
|
||||
private static final String KEY_LINEAGE_VERSION_PROP = "ro.modversion";
|
||||
|
||||
private static final String PLATLOGO_PACKAGE_NAME = "org.lineageos.lineageparts";
|
||||
private static final String PLATLOGO_PACKAGE_NAME = "org.evolution.easteregg";
|
||||
private static final String PLATLOGO_ACTIVITY_CLASS =
|
||||
PLATLOGO_PACKAGE_NAME + ".logo.PlatLogoActivity";
|
||||
PLATLOGO_PACKAGE_NAME + ".EasterEgg";
|
||||
|
||||
private final UserManager mUserManager;
|
||||
private final long[] mHits = new long[ACTIVITY_TRIGGER_COUNT];
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.android.settings.core.BasePreferenceController;
|
||||
|
||||
public class LineageLicensePreferenceController extends BasePreferenceController {
|
||||
|
||||
private static final String PROPERTY_LINEAGE_LICENSE_URL = "ro.lineagelegal.url";
|
||||
private static final String PROPERTY_LINEAGE_LICENSE_URL = "ro.evolutionlegal.url";
|
||||
|
||||
public LineageLicensePreferenceController(Context context, String key) {
|
||||
super(context, key);
|
||||
|
||||
@@ -106,7 +106,7 @@ public class SettingsHomepageActivity extends FragmentActivity implements
|
||||
@VisibleForTesting
|
||||
static final String EXTRA_INITIAL_REFERRER = "initial_referrer";
|
||||
|
||||
static final int DEFAULT_HIGHLIGHT_MENU_KEY = R.string.menu_key_network;
|
||||
static final int DEFAULT_HIGHLIGHT_MENU_KEY = R.string.menu_key_evolver;
|
||||
private static final long HOMEPAGE_LOADING_TIMEOUT_MS = 300;
|
||||
|
||||
private TopLevelSettings mMainFragment;
|
||||
|
||||
@@ -140,7 +140,7 @@ public class CreateShortcutPreferenceController extends BasePreferenceController
|
||||
intent = new Intent();
|
||||
}
|
||||
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
|
||||
Intent.ShortcutIconResource.fromContext(mContext, R.drawable.ic_launcher_settings))
|
||||
Intent.ShortcutIconResource.fromContext(mContext, R.mipmap.ic_launcher_settings))
|
||||
.putExtra(Intent.EXTRA_SHORTCUT_INTENT, info.getIntent())
|
||||
.putExtra(Intent.EXTRA_SHORTCUT_NAME, info.getShortLabel());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user