Skip to content

Commit

Permalink
SubstratumService: Refactor & cleanup according to AOSP conventions
Browse files Browse the repository at this point in the history
Change-Id: I588ae0c6ea89d05c824b94c7560d1f8a69423b48
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
Signed-off-by: VenkatVishalV <venkatvishal124@gmail.com>
KreAch3R authored and VenkatVishalV committed Nov 10, 2018
1 parent 005ac3b commit 78f5ec4
Showing 7 changed files with 18 additions and 50 deletions.
13 changes: 3 additions & 10 deletions data/etc/Android.mk
Original file line number Diff line number Diff line change
@@ -48,18 +48,11 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/sysconfig
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)

########################
include $(CLEAR_VARS)
LOCAL_MODULE := projekt.substratum.theme.xml
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := substratum_theme.xml
LOCAL_MODULE := substratum-theme-feature.xml
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/sysconfig
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(BUILD_PREBUILT)
23 changes: 0 additions & 23 deletions data/etc/projekt.substratum.theme.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -15,11 +15,11 @@
limitations under the License.
-->

<permissions>
<config>
<!-- Limitation permission to block out themes from being visible on stock
AOSP, or non-OMS devices. -->

<!-- This is an alias for projekt.substratum.theme -->
<feature name="projekt.substratum.theme" />

</permissions>
</config>
Original file line number Diff line number Diff line change
@@ -22,13 +22,11 @@ LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_REQUIRED_MODULES := \
projekt.substratum.theme.xml \
substratum_theme.xml
substratum-theme-feature.xml

LOCAL_PACKAGE_NAME := SubstratumService
LOCAL_PACKAGE_NAME := SubstratumHelperService
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true

include $(BUILD_PACKAGE)

include $(BUILD_PACKAGE)
Original file line number Diff line number Diff line change
@@ -19,26 +19,26 @@


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.substratum.service"
package="projekt.substratum.helper"
android:sharedUserId="android.uid.system"
android:versionCode="2"
android:versionName="two" >

<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
<uses-permission android:name="android.permission.CHANGE_OVERLAY_PACKAGES"/>

<uses-feature name="projekt.substratum.theme" required="true"/>

<application
android:allowBackup="false"
android:label="Substratum Service">
android:label="Substratum Helper Service">

<service android:name="android.substratum.service.SubstratumHelperService"
<service android:name="projekt.substratum.helper.SubstratumHelperService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.substratum.service.SubstratumHelperService" />
<action android:name="projekt.substratum.helper.SubstratumHelperService" />
</intent-filter>
</service>

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.substratum.service;
package projekt.substratum.helper;

import android.app.Service;
import android.content.Intent;
@@ -30,7 +30,7 @@
import java.io.File;

public class SubstratumHelperService extends Service {
private static final String TAG = "SubstratumService";
private static final String TAG = "SubstratumHelperService";

private final File EXTERNAL_CACHE_DIR =
new File(Environment.getExternalStorageDirectory(), ".substratum");
Original file line number Diff line number Diff line change
@@ -211,8 +211,8 @@ public void onSwitchUser(final int newUserId) {

private void waitForHelperConnection() {
if (mHelperService == null) {
Intent intent = new Intent("android.substratum.service.SubstratumHelperService");
intent.setPackage("android.substratum.service");
Intent intent = new Intent("projekt.substratum.helper.SubstratumHelperService");
intent.setPackage("projekt.substratum.helper");
mContext.bindServiceAsUser(intent, mHelperConnection,
Context.BIND_AUTO_CREATE, UserHandle.SYSTEM);
}

0 comments on commit 78f5ec4

Please sign in to comment.