Skip to content

Commit

Permalink
Settings: Integrate Blissify into Settings
Browse files Browse the repository at this point in the history
- Adapt to Android U Changes
- Keep it below Apps

Change-Id: I30a65c3e17aff251eef6bbf2454203bbed3300ae
Signed-off-by: Jackeagle <[email protected]>
Signed-off-by: Jis G Jacob <[email protected]>
Signed-off-by: Jackeagle <[email protected]>
Signed-off-by: Jis G Jacob <[email protected]>
  • Loading branch information
Jackeagle authored and StudioKeys committed Jun 18, 2024
1 parent 8dd0e70 commit ef74caa
Show file tree
Hide file tree
Showing 11 changed files with 137 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ android_library {
srcs: [
"src/**/*.java",
"src/**/*.kt",
"Blissify/src/**/*.java"
],

aaptflags: ["--extra-packages org.blissroms.blissify"],

exclude_srcs: [
"src/com/android/settings/biometrics/fingerprint2/lib/**/*.kt",
],
Expand All @@ -64,6 +68,7 @@ android_library {
"res",
"res-export", // for external usage
"res-product",
"Blissify/res",
],
static_libs: [
// External dependencies
Expand Down Expand Up @@ -127,6 +132,9 @@ android_library {
"telephony-common",
"ims-common",
],
optimize: {
proguard_flags_files: ["proguard-core.flags"],
},
}

platform_compat_config {
Expand Down
29 changes: 29 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5150,6 +5150,35 @@
</intent-filter>
</receiver>

<!-- Blissify -->
<activity android:name="Settings$BlissifySettingsActivity"
android:label="@string/blissify_settings_title"
android:icon="@drawable/ic_dashboard_blissify"
android:exported="true"
android:taskAffinity="com.android.settings">
<intent-filter android:priority="1">
<action android:name="org.blissroms.blissify.Blissify" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
<category android:name="com.android.settings.SHORTCUT" />
</intent-filter>
<intent-filter android:priority="10">
<action android:name="com.android.settings.action.SETTINGS" />
</intent-filter>
<meta-data android:name="com.android.settings.order"
android:value="-1"/>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="org.blissroms.blissify.Blissify" />
<meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
android:value="true" />
<meta-data android:name="com.android.settings.summary"
android:resource="@string/blissify_settings_summary"/>
</activity>

<!-- This is the longest AndroidManifest.xml ever. -->
</application>
</manifest>
1 change: 1 addition & 0 deletions Blissify
2 changes: 2 additions & 0 deletions proguard-core.flags
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Blissify
-keep class org.blissroms.blissify.**
57 changes: 57 additions & 0 deletions res/drawable/ic_dashboard_blissify.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 The BlissRoms Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector
android:height="24dp"
android:viewportHeight="1000"
android:viewportWidth="1000"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="#00A8EC"
android:pathData="M500,500m-424.4,0a424.4,424.4 0,1 1,848.79 0a424.4,424.4 0,1 1,-848.79 0"
/>
<path
android:fillColor="#EDEDED"
android:pathData="M500,499.33m-396.56,0a396.56,396.56 0,1 1,793.12 0a396.56,396.56 0,1 1,-793.12 0"
/>
<path
android:fillColor="#00A8EC"
android:fillType="nonZero"
android:pathData="M500.98,290.17C509.05,298.83 515.67,308.77 521.55,319.03C539.55,350.43 550.19,385.66 554.98,421.43C555.69,426.78 556.31,432.14 556.87,437.51C557.04,439.14 556.16,440.63 555.49,442.07C547.88,455.63 540.65,469.44 534.87,483.91C525.44,507.52 516.56,531.44 510.71,556.23C505.91,575.25 503.34,594.71 500.49,614.09C500.23,615.74 499.85,617.37 499.43,619C496.63,600.45 493.62,581.91 489.71,563.56C486.21,547.23 481.66,531.15 476.07,515.41C472.13,504.58 467.75,493.92 463.27,483.3C459.7,475.01 456.45,466.57 452.12,458.63C451.02,456.44 449.49,454.26 449.7,451.67C452.31,405.15 462.73,358.56 484.05,316.92C489.02,307.61 494.33,298.39 500.98,290.17Z"
/>
<group>
<clip-path android:pathData="M499.68,290.17l57.21,0l0,328.83l-57.21,0z M 0,0"/>
<path
android:fillColor="#008DC6"
android:fillType="nonZero"
android:pathData="M1000.29,418.81C1023.29,443.49 1042.16,471.81 1058.91,501.06C1110.2,590.53 1140.53,690.93 1154.18,792.86C1156.18,808.1 1157.97,823.37 1159.54,838.67C1160.04,843.34 1157.54,847.57 1155.62,851.67C1133.93,890.32 1113.32,929.67 1096.85,970.91C1070,1038.19 1044.68,1106.36 1028,1177C1014.32,1231.18 1007,1286.65 998.88,1341.87C998.15,1346.58 997.06,1351.23 995.88,1355.87C987.88,1303 979.32,1250.16 968.16,1197.87C958.199,1151.35 945.222,1105.52 929.31,1060.68C918.07,1029.82 905.6,999.42 892.82,969.16C882.66,945.54 873.38,921.48 861.04,898.88C857.91,892.62 853.57,886.4 854.15,879.03C861.59,746.47 891.3,613.71 952.05,495.03C966.21,468.51 981.34,442.23 1000.29,418.81Z"
/>
</group>
<path
android:fillColor="#00A8EC"
android:fillType="nonZero"
android:pathData="M362.74,356.4C368.93,360.62 374.24,365.97 379.55,371.21C391.29,382.62 401.81,395.25 411.4,408.5C436.74,443.11 456.16,481.92 469.55,522.64C481.45,558.26 488.83,595.31 492.58,632.66C494.67,653.79 495.5,675.02 495.65,696.25C495.71,697.96 495.45,699.66 494.88,701.28C490.81,697.86 488.02,693.31 484.79,689.17C474.07,674.97 463.53,660.64 452.66,646.55C441.67,631.98 429.11,618.7 416.66,605.36C409.69,597.94 402.76,590.49 395.56,583.3C389.05,576.01 381.63,569.61 374.43,563.02C371.95,560.6 368.91,558.65 367.11,555.62C365.66,552.21 365.06,548.53 364.06,544.98C357.35,518.16 354.07,490.52 353.49,462.89C352.8,434.99 354.48,407.09 358.5,379.48C359.74,371.76 360.99,364.03 362.74,356.4Z"
/>
<path
android:fillColor="#008DC6"
android:fillType="nonZero"
android:pathData="M627.18,363.55C629.99,361.03 632.77,358.39 636.09,356.53C644.23,396.76 646.99,438.06 644.72,479.03C643.32,502.64 639.88,526.16 633.7,549C632.98,551.44 632.6,554.11 631.03,556.2C629.27,558.94 626.76,561.07 624.31,563.15C616.44,569.77 609.4,577.27 601.85,584.21C591.75,594.36 582.13,604.97 572.45,615.52C562.48,626.57 553.17,638.18 544.02,649.91C533.75,662.94 523.74,676.18 513.56,689.28C510.25,693.27 508.11,698.32 503.75,701.36C502.77,689.66 503.51,677.89 503.82,666.18C506.46,599 520.96,531.78 550.03,470.97C566.99,435.73 588.89,402.72 615.91,374.38C619.49,370.6 623.39,367.12 627.18,363.55Z"
/>
<path android:fillColor="#008DC6" android:fillType="nonZero" android:pathData="M749.65,375.45C752.79,374.02 755.82,372.26 759.16,371.29C760.15,404.68 752.02,437.71 739.45,468.46C736.86,474.93 734.08,481.33 731.38,487.76C730.53,490.66 727.52,491.78 725.12,493.1C712.89,499.01 701.01,505.64 689.56,512.96C673.42,522.98 658.63,534.95 643.28,546.09C645.34,536.68 646.73,527.14 648.29,517.64C651.82,496.31 652.99,474.65 652.86,453.07C652.99,451.44 652.86,449.56 654.05,448.31C657.49,444.28 661.29,440.59 665.03,436.84C683.63,417.97 704.12,400.78 726.87,387.09C734.16,382.64 741.92,379.04 749.65,375.45Z"/>
<path android:fillColor="#00A8EC" android:fillType="nonZero" android:pathData="M239.49,371.47C248.99,374.38 257.8,379.14 266.48,383.91C295.06,400.71 320.31,422.66 342.98,446.73C343.98,447.95 345.38,449.09 345.57,450.76C346.07,456.9 345.49,463.09 345.98,469.24C346.79,481.34 347.04,493.5 348.71,505.52C350.28,519.17 353.62,532.55 355.27,546.16C348.82,541.49 342.77,536.3 336.3,531.67C324.32,522.77 311.98,514.33 299.1,506.8C290.09,501.45 280.68,496.84 271.38,492.06C269.82,491.28 268.18,490.34 267.35,488.73C264.3,482.6 261.74,476.23 259.16,469.89C249.8,446.86 243.24,422.66 240.5,397.97C239.28,389.19 239.34,380.3 239.49,371.47Z"/>
<path android:fillColor="#00A8EC" android:fillType="nonZero" android:pathData="M158.67,468.52C173.73,470.01 188.62,472.94 203.3,476.59C252.65,488.87 298.71,512.8 338.69,544.03C370.76,568.94 400.02,597.39 426.51,628.15C447.62,652.37 466.37,678.51 485.4,704.36C486.35,705.69 487.21,707.06 488.07,708.46C451,706.74 414,702.09 377.84,693.63C348.79,686.86 320.12,677.54 293.84,663.26C275.72,653.66 259.77,640.16 246.81,624.31C242.86,619.67 239.4,614.65 235.74,609.78C210.59,574.98 190,537.09 172.42,497.98C167.95,488.1 163.06,478.42 158.67,468.52Z"/>
<path android:fillColor="#008DC6" android:fillType="nonZero" android:pathData="M835.61,469.14C837.24,468.88 838.89,468.71 840.55,468.63C832.72,485.37 824.67,502.01 816.68,518.68C797.42,559.5 773.82,598.45 744.71,633.03C734.56,645.19 721.07,653.88 707.54,661.81C687.64,673.13 666.09,681.29 644.1,687.56C606.15,698.54 566.88,704.47 527.52,707.37C521.87,707.69 516.24,708.33 510.57,708.16C549.73,651.96 593.85,598.57 646.73,554.68C673.94,532.22 703.62,512.57 735.62,497.57C759.56,486.52 784.75,478.37 810.63,473.31C818.91,471.66 827.28,470.5 835.61,469.14Z"/>
</vector>
18 changes: 18 additions & 0 deletions res/values/bliss_colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014-2019 BlissRoms Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

</resources>
4 changes: 4 additions & 0 deletions res/values/bliss_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@
<!-- Manage applications, package string displayed in app snippet -->
<string name="packagename_text"><xliff:g id="package_name">%1$s</xliff:g></string>

<!-- Blissify -->
<string name="blissify_settings_title">Blissify</string>
<string name="blissify_settings_summary">Blissify your device!</string>

</resources>
9 changes: 9 additions & 0 deletions res/xml/top_level_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@
android:summary="@string/app_and_notification_dashboard_summary"
settings:highlightableMenuKey="@string/menu_key_apps"/>

<Preference
android:fragment="org.blissroms.blissify.Blissify"
android:icon="@drawable/ic_dashboard_blissify"
android:key="top_level_blissify_settings"
android:order="-125"
android:title="@string/blissify_settings_title"
android:summary="@string/blissify_settings_summary"
settings:controller="org.blissroms.blissify.TopLevelBlissifyPreferenceController" />

<com.android.settings.widget.HomepagePreference
android:fragment="com.android.settings.notification.ConfigureNotificationSettings"
android:icon="@drawable/ic_notifications"
Expand Down
1 change: 1 addition & 0 deletions src/com/android/settings/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ public static class PowerUsageSummaryActivity extends SettingsActivity { /* empt
public static class StorageDashboardActivity extends SettingsActivity {}
public static class AccountDashboardActivity extends SettingsActivity {}
public static class SystemDashboardActivity extends SettingsActivity {}
public static class BlissifySettingsActivity extends SettingsActivity {}

/**
* Activity for MediaControlsSettings
Expand Down
4 changes: 4 additions & 0 deletions src/com/android/settings/core/gateway/SettingsGateway.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@
import com.android.settings.wifi.savedaccesspoints2.SavedAccessPointsWifiSettings2;
import com.android.settings.wifi.tether.WifiTetherSettings;

import org.blissroms.blissify.Blissify;

public class SettingsGateway {

/**
Expand Down Expand Up @@ -390,6 +392,7 @@ public class SettingsGateway {
ScreenTimeoutSettings.class.getName(),
ResetNetwork.class.getName(),
VibrationIntensitySettingsFragment.class.getName(),
Blissify.class.getName()
};

public static final String[] SETTINGS_FOR_RESTRICTED = {
Expand Down Expand Up @@ -436,5 +439,6 @@ public class SettingsGateway {
UserBackupSettingsActivity.class.getName(),
Settings.MemtagPageActivity.class.getName(),
Settings.NavigationModeSettingsActivity.class.getName(),
Settings.BlissifySettingsActivity.class.getName(),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
import com.android.settings.system.SystemDashboardFragment;
import com.android.settingslib.drawer.CategoryKey;

import org.blissroms.blissify.Blissify;

import java.util.Map;

/**
Expand Down Expand Up @@ -135,6 +137,8 @@ public class DashboardFragmentRegistry {
CategoryKey.CATEGORY_SPECIAL_APP_ACCESS);
PARENT_TO_CATEGORY_KEY_MAP.put(MoreSecurityPrivacyFragment.class.getName(),
CategoryKey.CATEGORY_MORE_SECURITY_PRIVACY_SETTINGS);
PARENT_TO_CATEGORY_KEY_MAP.put(Blissify.class.getName(),
CategoryKey.CATEGORY_SYSTEM_DEVELOPMENT);

CATEGORY_KEY_TO_PARENT_MAP = new ArrayMap<>(PARENT_TO_CATEGORY_KEY_MAP.size());

Expand Down

0 comments on commit ef74caa

Please sign in to comment.