Skip to content

Commit 4f7e22e

Browse files
committed
ParanoidHub: Update to Hub 5.0
Hub has been rewritten completely from scratch with the goal to introduce a lighter frontend and backend system. The results of the rewrite has reduced code duplication by 50% and created a solid foundation for the UI. The UI states and tasks are all broken up into individual components. A component stores the relevant information for each state and publishes the appropriate state. This on it's own keeps the UI from being in a buggy state for most usage cases. Components and States are instances of a single interface which helps shrink code duplication as well. Change-Id: Ie3f13cb5a58591e2e683c02c10b5ce99db3627c7
1 parent 2ed4783 commit 4f7e22e

File tree

112 files changed

+4246
-6609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+4246
-6609
lines changed

Android.bp

+13-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ android_app {
55
privileged: true,
66
certificate: "platform",
77
system_ext_specific: true,
8-
required: ["privapp_whitelist_co.aospa.hub.xml"],
8+
required: [
9+
"privapp_whitelist_co.aospa.hub.xml",
10+
"default-permissions_co.aospa.hub.xml"
11+
],
912
optimize: {
1013
proguard_flags_files: ["proguard.flags"],
1114
},
@@ -36,3 +39,12 @@ prebuilt_etc {
3639
sub_dir: "permissions",
3740
system_ext_specific: true,
3841
}
42+
43+
prebuilt_etc {
44+
name: "default-permissions_co.aospa.hub.xml",
45+
system_ext_specific: true,
46+
sub_dir: "default-permissions",
47+
src: "default-permissions_co.aospa.hub.xml",
48+
filename_from_src: true,
49+
}
50+

AndroidManifest.xml

+17-42
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
23
package="co.aospa.hub"
3-
coreApp="true"
4-
android:sharedUserId="android.uid.system"
5-
android:versionCode="3"
6-
android:versionName="3.0">
7-
8-
<original-package android:name="co.aospa.hub" />
4+
android:versionCode="5"
5+
android:versionName="5.0">
96

107
<uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" />
118
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
12-
<uses-permission android:name="android.permission.READ_DREAM_STATE" />
139
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
1410
<uses-permission android:name="android.permission.INTERNET" />
1511
<uses-permission android:name="android.permission.REBOOT" />
@@ -19,59 +15,38 @@
1915
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
2016
<uses-permission android:name="android.permission.WAKE_LOCK" />
2117
<uses-permission android:name="android.permission.START_ACTIVITIES_FROM_BACKGROUND" />
22-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
18+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
2319

2420
<application
25-
android:allowBackup="false"
21+
android:allowBackup="true"
2622
android:icon="@mipmap/ic_launcher"
27-
android:label="@string/hub_name"
23+
android:label="@string/app_name"
2824
android:requestLegacyExternalStorage="true"
29-
android:supportsRtl="true"
30-
android:theme="@style/Theme.Hub">
31-
25+
android:roundIcon="@mipmap/ic_launcher_round"
26+
android:supportsRtl="true">
3227
<activity
33-
android:name=".HubActivity"
34-
android:label="@string/hub_display_name"
35-
android:theme="@style/Theme.Hub.NoActionBar"
36-
android:excludeFromRecents="true"
28+
android:name=".ui.activities.HubActivity"
29+
android:theme="@style/SudThemeGlifV4"
30+
android:enabled="true"
3731
android:exported="true"
38-
android:launchMode="singleTop">
32+
android:screenOrientation="portrait">
3933
<intent-filter android:priority="1">
4034
<action android:name="android.settings.SYSTEM_UPDATE_SETTINGS" />
4135
<category android:name="android.intent.category.DEFAULT" />
42-
<category android:name="android.intent.category.LAUNCHER" />
4336
</intent-filter>
37+
4438
<intent-filter>
4539
<action android:name="android.intent.action.MAIN" />
4640
<category android:name="com.android.settings.SHORTCUT" />
4741
<category android:name="android.intent.category.DEFAULT" />
4842
</intent-filter>
4943
</activity>
50-
51-
<activity
52-
android:name=".HubPreferencesActivity"
53-
android:label="@string/hub_display_name"
54-
android:theme="@android:style/Theme.DeviceDefault.Settings"
55-
android:autoRemoveFromRecents="true"
56-
android:exported="true">
57-
<intent-filter>
58-
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
59-
<category android:name="android.intent.category.DEFAULT" />
60-
</intent-filter>
61-
</activity>
62-
63-
<service android:name=".service.UpdateService" />
64-
65-
<receiver android:name=".receiver.UpdateReceiver" android:exported="false">
66-
<intent-filter>
67-
<action android:name="android.intent.action.BOOT_COMPLETED" />
68-
</intent-filter>
69-
</receiver>
70-
71-
<receiver android:name=".receiver.UpdateCheckReceiver" android:exported="true">
44+
<service android:name=".UpdateStateService" />
45+
<receiver android:name=".UpdateReceiver" android:exported="true">
7246
<intent-filter>
73-
<action android:name="android.intent.action.BOOT_COMPLETED" />
47+
<action android:name="android.intent.action.BOOT_COMPLETED"/>
7448
</intent-filter>
7549
</receiver>
7650
</application>
51+
7752
</manifest>
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- Copyright (c) 2018 The LineageOS Project
3-
2+
<!--
3+
Copyright (C) 2022 Paranoid Android
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
7+
http://www.apache.org/licenses/LICENSE-2.0
108
Unless required by applicable law or agreed to in writing, software
119
distributed under the License is distributed on an "AS IS" BASIS,
1210
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1311
See the License for the specific language governing permissions and
1412
limitations under the License.
1513
-->
16-
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
17-
<background android:drawable="@color/ic_background"/>
18-
<foreground android:drawable="@drawable/ic_foreground"/>
19-
</adaptive-icon>
20-
14+
<permissions>
15+
<exception package="co.aospa.hub">
16+
<!-- Notifications -->
17+
<permission name="android.permission.POST_NOTIFICATIONS" fixed="false"/>
18+
</exception>
19+
</permissions>

res/color/button_ripple_color_selector.xml

-19
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_checked="true" android:state_pressed="true" />
4+
<item android:alpha="0.12" android:color="?attr/colorOnSecondary" android:state_checked="true" android:state_focused="true" />
5+
<item android:alpha="0.08" android:color="?attr/colorOnSecondary" android:state_checked="true" android:state_hovered="true" />
6+
<item android:alpha="0.16" android:color="?attr/colorOnSecondary" android:state_checked="true" />
7+
</selector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportWidth="108"
6+
android:viewportHeight="108">
7+
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
8+
<aapt:attr name="android:fillColor">
9+
<gradient
10+
android:endX="85.84757"
11+
android:endY="92.4963"
12+
android:startX="42.9492"
13+
android:startY="49.59793"
14+
android:type="linear">
15+
<item
16+
android:color="#44000000"
17+
android:offset="0.0" />
18+
<item
19+
android:color="#00000000"
20+
android:offset="1.0" />
21+
</gradient>
22+
</aapt:attr>
23+
</path>
24+
<path
25+
android:fillColor="#FFFFFF"
26+
android:fillType="nonZero"
27+
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
28+
android:strokeWidth="1"
29+
android:strokeColor="#00000000" />
30+
</vector>

res/drawable/header_changelog.xml

-7
This file was deleted.

res/drawable/header_changelog_dark.xml

-7
This file was deleted.

res/drawable/header_system_update.xml

-10
This file was deleted.

res/drawable/header_system_update_dark.xml

-10
This file was deleted.

res/drawable/circle_progress_indicator_m3_animator.xml res/drawable/ic_circular_progress_animator.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<!-- Asset for 4 color indeterminate progress bar, which is a ring with 4 shades of blue -->
2020
<animated-vector xmlns:aapt="http://schemas.android.com/aapt"
2121
xmlns:android="http://schemas.android.com/apk/res/android"
22-
android:drawable="@drawable/circle_progress_indicator_m3">
22+
android:drawable="@drawable/ic_circular_progress">
2323
<target android:name="blue1_path">
2424
<aapt:attr name="android:animation">
2525
<objectAnimator android:duration="1983" android:propertyName="trimPathStart"

res/drawable/ic_foreground.xml

-13
This file was deleted.

res/drawable/ic_info_outline_grey600_24dp.xml

-5
This file was deleted.

0 commit comments

Comments
 (0)