diff --git a/app/src/main/java/com/thelittlefireman/appkillermanager_exemple/MainActivity.java b/app/src/main/java/com/thelittlefireman/appkillermanager_exemple/MainActivity.java
index 1bfa2d2..40522c1 100644
--- a/app/src/main/java/com/thelittlefireman/appkillermanager_exemple/MainActivity.java
+++ b/app/src/main/java/com/thelittlefireman/appkillermanager_exemple/MainActivity.java
@@ -7,11 +7,8 @@
import android.widget.Button;
import android.widget.TextView;
-import androidx.appcompat.widget.AppCompatCheckBox;
-
import com.thelittlefireman.appkillermanager.AppKillerManager;
import com.thelittlefireman.appkillermanager.exceptions.NoActionFoundException;
-import com.thelittlefireman.appkillermanager.ui.DialogKillerManagerBuilder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -25,7 +22,6 @@ public class MainActivity extends Activity {
Button powerSavingManagerButton;
Button autoStartManagerButton;
Button notificationManagerButton;
- AppCompatCheckBox mAppCompatCheckBoxByDialog;
AppKillerManager.Action currentAction = null;
@@ -50,7 +46,6 @@ protected void log(int priority, @Nullable String tag, @NotNull String message,
powerSavingManagerButton = findViewById(R.id.powerSavingManagerButton);
autoStartManagerButton = findViewById(R.id.autoStartManagerButton);
notificationManagerButton = findViewById(R.id.notificationManagerButton);
- mAppCompatCheckBoxByDialog = findViewById(R.id.idByDialog);
//ButterKnife.bind(this);
@@ -58,14 +53,10 @@ protected void log(int priority, @Nullable String tag, @NotNull String message,
@Override
public void onClick(View v) {
currentAction = AppKillerManager.Action.ACTION_POWER_SAVING;
- if (mAppCompatCheckBoxByDialog.isChecked()) {
- startDialog(currentAction);
- } else {
- try {
- AppKillerManager.doActionPowerSaving(MainActivity.this);
- } catch (NoActionFoundException e) {
- Timber.e(e);
- }
+ try {
+ AppKillerManager.doActionPowerSaving(MainActivity.this);
+ } catch (NoActionFoundException e) {
+ Timber.e(e);
}
}
});
@@ -73,14 +64,10 @@ public void onClick(View v) {
@Override
public void onClick(View v) {
currentAction = AppKillerManager.Action.ACTION_AUTO_START;
- if (mAppCompatCheckBoxByDialog.isChecked()) {
- startDialog(currentAction);
- } else {
- try {
- AppKillerManager.doActionAutoStart(MainActivity.this);
- } catch (NoActionFoundException e) {
- Timber.e(e);
- }
+ try {
+ AppKillerManager.doActionAutoStart(MainActivity.this);
+ } catch (NoActionFoundException e) {
+ Timber.e(e);
}
}
});
@@ -88,14 +75,10 @@ public void onClick(View v) {
@Override
public void onClick(View v) {
currentAction = AppKillerManager.Action.ACTION_NOTIFICATIONS;
- if (mAppCompatCheckBoxByDialog.isChecked()) {
- startDialog(currentAction);
- } else {
- try {
- AppKillerManager.doActionNotification(MainActivity.this);
- } catch (NoActionFoundException e) {
- Timber.e(e);
- }
+ try {
+ AppKillerManager.doActionNotification(MainActivity.this);
+ } catch (NoActionFoundException e) {
+ Timber.e(e);
}
}
});
@@ -107,19 +90,6 @@ public void onClick(View v) {
}
- public void startDialog(AppKillerManager.Action action) {
-
- try {
- new DialogKillerManagerBuilder(this).setAction(action).show();
-
- } catch (DialogKillerManagerBuilder.UnAvailableActionException e) {
- Timber.e(e);
- } catch (DialogKillerManagerBuilder.UnSupportedDeviceException e) {
- Timber.e(e);
- }
-
- }
-
@Override
public void onResume() {
diff --git a/app/src/main/res/layout/activity_instructions.xml b/app/src/main/res/layout/activity_instructions.xml
deleted file mode 100644
index 7a79701..0000000
--- a/app/src/main/res/layout/activity_instructions.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 47d861f..e42e3fb 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -57,25 +57,6 @@
app:layout_constraintVertical_bias="0.0"
tools:layout_editor_absoluteX="0dp" />
-
-
diff --git a/appkillermanager/build.gradle b/appkillermanager/build.gradle
index 5e3ee61..65fd0ad 100644
--- a/appkillermanager/build.gradle
+++ b/appkillermanager/build.gradle
@@ -31,18 +31,8 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-
implementation 'com.jakewharton.timber:timber:4.7.1'
- implementation 'androidx.annotation:annotation:1.1.0'
-
implementation "androidx.core:core-ktx:1.2.0"
- implementation 'androidx.appcompat:appcompat:1.1.0'
- implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
- implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
-
- testImplementation 'junit:junit:4.13'
- androidTestImplementation 'androidx.test.ext:junit:1.1.1'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
dependencyUpdates.resolutionStrategy {
diff --git a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Asus.kt b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Asus.kt
index 3dd4f14..1f49834 100644
--- a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Asus.kt
+++ b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Asus.kt
@@ -29,12 +29,6 @@ class Asus : Device {
override val manufacturer: Manufacturer
get() = Manufacturer.ASUS
- override val helpImageAutoStart: Int
- get() = R.drawable.asus_autostart
-
- override val helpImageNotification: Int
- get() = R.drawable.asus_notification
-
override fun isActionPowerSavingAvailable(context: Context): Boolean {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val pm = context.getSystemService(Context.POWER_SERVICE) as PowerManager
diff --git a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Device.kt b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Device.kt
index 68feea1..3a1fb49 100644
--- a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Device.kt
+++ b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Device.kt
@@ -2,7 +2,6 @@ package com.thelittlefireman.appkillermanager.devices
import android.content.Context
import android.content.Intent
-import androidx.annotation.DrawableRes
import com.thelittlefireman.appkillermanager.utils.Manufacturer
interface Device {
@@ -11,18 +10,6 @@ interface Device {
val manufacturer: Manufacturer
- @get:DrawableRes
- val helpImagePowerSaving: Int
- get() = 0
-
- @get:DrawableRes
- val helpImageAutoStart: Int
- get() = 0
-
- @get:DrawableRes
- val helpImageNotification: Int
- get() = 0
-
fun isActionPowerSavingAvailable(context: Context): Boolean = false
fun isActionAutoStartAvailable(context: Context): Boolean = false
diff --git a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Huawei.kt b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Huawei.kt
index 99d831c..e229c49 100644
--- a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Huawei.kt
+++ b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Huawei.kt
@@ -5,7 +5,6 @@ import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
-import com.thelittlefireman.appkillermanager.R
import com.thelittlefireman.appkillermanager.utils.ActionsUtils
import com.thelittlefireman.appkillermanager.utils.Manufacturer
import com.thelittlefireman.appkillermanager.utils.SystemUtils.getEmuiRomName
@@ -40,9 +39,6 @@ class Huawei : Device {
override val manufacturer: Manufacturer
get() = Manufacturer.HUAWEI
- override val helpImagePowerSaving: Int
- get() = R.drawable.huawei_powersaving
-
override fun isActionPowerSavingAvailable(context: Context) = true
override fun isActionNotificationAvailable(context: Context) = true
diff --git a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Samsung.kt b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Samsung.kt
index e5f70b6..797f8ef 100644
--- a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Samsung.kt
+++ b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/devices/Samsung.kt
@@ -30,9 +30,6 @@ class Samsung : Device {
private const val SAMSUNG_SYSTEMMANAGER_AUTOSTART_PACKAGE_V1_ACTIVITY = "com.samsung.memorymanager.RamActivity"
}
- override val helpImagePowerSaving: Int
- get() = R.drawable.samsung
-
override val isThatRom: Boolean
get() = Build.BRAND.equals(manufacturer.toString(), ignoreCase = true) ||
Build.MANUFACTURER.equals(manufacturer.toString(), ignoreCase = true) ||
diff --git a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/ui/DialogKillerManagerBuilder.java b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/ui/DialogKillerManagerBuilder.java
deleted file mode 100644
index 8e088b3..0000000
--- a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/ui/DialogKillerManagerBuilder.java
+++ /dev/null
@@ -1,302 +0,0 @@
-package com.thelittlefireman.appkillermanager.ui;
-
-import android.content.Context;
-import android.view.View;
-import android.widget.CheckBox;
-import android.widget.CompoundButton;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.annotation.DrawableRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.StringRes;
-
-import com.afollestad.materialdialogs.DialogAction;
-import com.afollestad.materialdialogs.MaterialDialog;
-import com.thelittlefireman.appkillermanager.R;
-import com.thelittlefireman.appkillermanager.AppKillerManager;
-import com.thelittlefireman.appkillermanager.exceptions.NoActionFoundException;
-import com.thelittlefireman.appkillermanager.utils.KillerManagerUtils;
-
-import timber.log.Timber;
-
-public class DialogKillerManagerBuilder {
- private Context mContext;
-
- /*private Activity mActivity;
- private Integer returnCode;*/
-
- private MaterialDialog materialDialog;
- private MaterialDialog.Builder builder;
- private OnNoActionFoundException onNoActionFoundException;
- private UnAvailableActionException unAvailableActionException;
- private UnSupportedDeviceException onUnSupportedDevice;
- private AppKillerManager.Action mAction;
- private boolean enableDontShowAgain = true;
- private String titleMessage;
- private String contentMessage;
- @DrawableRes
- private int iconRes;
-
- /*public DialogKillerManagerBuilder(Activity activity, Integer returnCode) {
- this();
- this.mActivity = activity;
- this.returnCode = returnCode;
- }*/
- @StringRes
- private int titleResMessage, contentResMessage;
-
- private DialogKillerManagerBuilder() {
- contentResMessage = -1;
- titleResMessage = -1;
- iconRes = -1;
- }
-
- public DialogKillerManagerBuilder(Context context) {
- this();
- mContext = context;
- }
-
- public DialogKillerManagerBuilder setAction(AppKillerManager.Action action) {
- mAction = action;
- return this;
- }
-
- public DialogKillerManagerBuilder setIconRes(@NonNull @DrawableRes Integer iconRes) {
- this.iconRes = iconRes;
- return this;
- }
-
- public DialogKillerManagerBuilder setTitleMessage(@NonNull String titleMessage) {
- this.titleMessage = titleMessage;
- return this;
- }
-
- /*public DialogKillerManagerBuilder setContext(Context context) {
- mContext = context;
- return this;
- }
-
- public void setActivity(Activity mActivity, @NonNull Integer returnCode) {
- this.mActivity = mActivity;
- this.returnCode = returnCode;
- }*/
-
- public DialogKillerManagerBuilder setContentMessage(@NonNull String contentMessage) {
- this.contentMessage = contentMessage;
- return this;
- }
-
- public DialogKillerManagerBuilder setTitleMessage(@StringRes @NonNull Integer titleResMessage) {
- this.titleResMessage = titleResMessage;
- return this;
- }
-
- public DialogKillerManagerBuilder setContentMessage(@StringRes @NonNull Integer contentResMessage) {
- this.contentResMessage = contentResMessage;
- return this;
- }
-
- public DialogKillerManagerBuilder setOnNoActionFoundException(OnNoActionFoundException onNoActionFoundException) {
- this.onNoActionFoundException = onNoActionFoundException;
- return this;
- }
-
- public DialogKillerManagerBuilder setUnAvailableActionException(UnAvailableActionException unAvailableActionException) {
- this.unAvailableActionException = unAvailableActionException;
- return this;
- }
-
- public DialogKillerManagerBuilder setOnUnSupportedDevice(UnSupportedDeviceException onUnSupportedDevice) {
- this.onUnSupportedDevice = onUnSupportedDevice;
- return this;
- }
-
- public void build() throws NullPointerException {
- //MaterialDialog materialDialog;
- if (mContext == null) {
- throw new NullPointerException("Context && mActivity can't be null at the same time");
- }
- if (mAction == null) {
- throw new NullPointerException("Action can't be null");
- }
-
- builder = new MaterialDialog.Builder(mContext);
-
-
- builder.positiveText(R.string.dialog_button)
- .customView(R.layout.md_dialog_custom_view, false)
- .onPositive(new MaterialDialog.SingleButtonCallback() {
- @Override
- public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
- try {
- if (mAction == AppKillerManager.Action.ACTION_AUTO_START) {
- if (mContext != null) {
- AppKillerManager.doActionAutoStart(mContext);
- }
- } else if (mAction == AppKillerManager.Action.ACTION_NOTIFICATIONS) {
- if (mContext != null) {
- AppKillerManager.doActionNotification(mContext);
- }
- } else if (mAction == AppKillerManager.Action.ACTION_POWER_SAVING) {
- if (mContext != null) {
- AppKillerManager.doActionPowerSaving(mContext);
- }
- }
- } catch (NoActionFoundException e) {
- if (onNoActionFoundException != null) {
- onNoActionFoundException.onNoActionFound(e);
- } else {
- dialog.dismiss();
- }
- Timber.e(e);
- }
- }
- })
- .negativeText(android.R.string.cancel);
-
- if (iconRes != -1) {
- builder.iconRes(iconRes);
- } else {
- builder.iconRes(android.R.drawable.ic_dialog_alert);
- }
-
- if (titleResMessage != -1) {
- builder.title(titleResMessage);
- } else if (titleMessage != null && !titleMessage.isEmpty()) {
- builder.title(titleMessage);
- } else {
- if (mContext != null) {
- builder.title(mContext.getString(R.string.dialog_title_notification, AppKillerManager.getDevice().getManufacturer().toString()));
- }
- }
-
- if (this.enableDontShowAgain) {
- if (mContext != null) {
- builder.checkBoxPromptRes(R.string.dialog_do_not_show_again, false,
- new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- KillerManagerUtils.setDontShowAgain(mContext, mAction, isChecked);
- }
- });
- }
- }
- }
-
- private boolean isActionAvailable() {
- if (mContext != null) {
- return AppKillerManager.isActionAvailable(mContext, mAction);
- }
- return false;
- }
-
- private boolean isDontShowAgain() {
- if (mContext != null) {
- return KillerManagerUtils.isDontShowAgain(mContext, mAction);
- }
- return false;
- }
-
- public DialogKillerManagerBuilder setDontShowAgain(boolean enable) {
- this.enableDontShowAgain = enable;
- return this;
- }
-
- public void show() throws NullPointerException, UnAvailableActionException, UnSupportedDeviceException {
- build();
- if (!AppKillerManager.isDeviceSupported()) {
- Timber.tag(this.getClass().getName()).i("Device not in the list no need to show the dialog");
- throw new UnSupportedDeviceException();
- }
- if (!isActionAvailable()) {
- Timber.tag(this.getClass().getName()).i("This action is not available for this device no need to show the dialog");
- throw new UnAvailableActionException("This action is not available for this device no need to show the dialog");
- }
-
- if (!(enableDontShowAgain && isDontShowAgain())) {
- materialDialog = builder.show();
- // init custom view
- if (materialDialog.getCustomView() != null) {
- initView(materialDialog.getCustomView());
- }
- }
- }
-
- private void initView(View view) {
- TextView contentTextView = view.findViewById(R.id.md_content);
- CheckBox doNotShowAgainCheckBox = view.findViewById(R.id.md_promptCheckbox);
- ImageView helpImageView = view.findViewById(R.id.md_imageView);
-
- if (contentResMessage != -1) {
- contentTextView.setText(contentResMessage);
- } else if (contentMessage != null && !contentMessage.isEmpty()) {
- contentTextView.setText(contentMessage);
- } else {
- //TODO CUSTOM MESSAGE FOR SPECIFITQUE ACTIONS AND SPECIFIC DEVICE
- if (mContext != null) {
- contentTextView.setText(String.format(mContext.getString(R.string.dialog_huawei_notification),
- mContext.getString(
- R.string.app_name)));
- }
- }
-
- if (this.enableDontShowAgain) {
- doNotShowAgainCheckBox.setVisibility(View.VISIBLE);
- doNotShowAgainCheckBox.setText(R.string.dialog_do_not_show_again);
- if (mContext != null) {
- doNotShowAgainCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- KillerManagerUtils.setDontShowAgain(mContext, mAction, isChecked);
- }
- });
- }
- }
-
- //TODO add other specific images
- int helpImageRes = 0;
- switch (mAction) {
- case ACTION_AUTO_START:
- helpImageRes = AppKillerManager.getDevice().getHelpImageAutoStart();
- break;
- case ACTION_POWER_SAVING:
- helpImageRes = AppKillerManager.getDevice().getHelpImagePowerSaving();
- break;
- case ACTION_NOTIFICATIONS:
- helpImageRes = AppKillerManager.getDevice().getHelpImageNotification();
- break;
- }
-
- if (helpImageRes != 0) {
- helpImageView.setImageResource(helpImageRes);
- }
- }
-
- public MaterialDialog getMaterialDialog() {
- return materialDialog;
- }
-
- public MaterialDialog.Builder getBuilder() {
- return builder;
- }
-
- public interface OnNoActionFoundException {
- void onNoActionFound(NoActionFoundException e);
-
- void onNoActionFound();
- }
-
- public static class UnAvailableActionException extends Exception {
- UnAvailableActionException() {
- }
-
- UnAvailableActionException(String message) {
- super(message);
- }
- }
-
- public static class UnSupportedDeviceException extends Exception {
-
- }
-}
\ No newline at end of file
diff --git a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/utils/ActionsUtils.java b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/utils/ActionsUtils.java
deleted file mode 100644
index 80d0303..0000000
--- a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/utils/ActionsUtils.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package com.thelittlefireman.appkillermanager.utils;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-
-import androidx.annotation.NonNull;
-
-import java.util.List;
-
-public class ActionsUtils {
-
- public static Intent createIntent() {
- Intent intent = new Intent();
- intent.addCategory(Intent.CATEGORY_DEFAULT);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- return intent;
- }
-
- public static String getExtrasDebugInformations(Intent intent) {
- StringBuilder stringBuilder = new StringBuilder();
- if (intent != null) {
- stringBuilder.append("intent actions").append(intent.getAction());
- stringBuilder.append("intent conponent");
- ComponentName componentName = intent.getComponent();
- if (componentName != null) {
- stringBuilder.append("ComponentName package:").append(componentName.getPackageName());
- stringBuilder.append("ComponentName class:").append(componentName.getClassName());
- } else {
- stringBuilder.append("ComponentName is null");
- }
- } else {
- stringBuilder.append("intent is null");
- }
- return stringBuilder.toString();
- }
-
- public static boolean isIntentAvailable(@NonNull Context ctx, @NonNull String actionIntent) {
- return isIntentAvailable(ctx, ActionsUtils.createIntent().setAction(actionIntent));
- }
-
- public static boolean isIntentAvailable(@NonNull Context ctx, @NonNull ComponentName componentName) {
- return isIntentAvailable(ctx, ActionsUtils.createIntent().setComponent(componentName));
- }
-
- public static boolean isIntentAvailable(@NonNull Context ctx, @NonNull Intent intent) {
- if (ctx != null && intent != null) {
- final PackageManager mgr = ctx.getPackageManager();
- List list =
- mgr.queryIntentActivities(intent,
- PackageManager.MATCH_DEFAULT_ONLY);
- return list != null && list.size() > 0;
- } else {
- return false;
- }
- }
-}
diff --git a/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/utils/ActionsUtils.kt b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/utils/ActionsUtils.kt
new file mode 100644
index 0000000..06b227c
--- /dev/null
+++ b/appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/utils/ActionsUtils.kt
@@ -0,0 +1,52 @@
+package com.thelittlefireman.appkillermanager.utils
+
+import android.content.ComponentName
+import android.content.Context
+import android.content.Intent
+import android.content.pm.PackageManager
+
+object ActionsUtils {
+ fun createIntent(): Intent {
+ val intent = Intent()
+ intent.addCategory(Intent.CATEGORY_DEFAULT)
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ return intent
+ }
+
+ fun getExtrasDebugInformations(intent: Intent?): String {
+ val stringBuilder = StringBuilder()
+ if (intent != null) {
+ stringBuilder.append("intent actions").append(intent.action)
+ stringBuilder.append("intent conponent")
+ val componentName = intent.component
+ if (componentName != null) {
+ stringBuilder.append("ComponentName package:").append(componentName.packageName)
+ stringBuilder.append("ComponentName class:").append(componentName.className)
+ } else {
+ stringBuilder.append("ComponentName is null")
+ }
+ } else {
+ stringBuilder.append("intent is null")
+ }
+ return stringBuilder.toString()
+ }
+
+ fun isIntentAvailable(ctx: Context, actionIntent: String): Boolean {
+ return isIntentAvailable(ctx, createIntent().setAction(actionIntent))
+ }
+
+ fun isIntentAvailable(ctx: Context, componentName: ComponentName): Boolean {
+ return isIntentAvailable(ctx, createIntent().setComponent(componentName))
+ }
+
+ fun isIntentAvailable(ctx: Context?, intent: Intent?): Boolean {
+ return if (ctx != null && intent != null) {
+ val mgr = ctx.packageManager
+ val list = mgr.queryIntentActivities(intent,
+ PackageManager.MATCH_DEFAULT_ONLY)
+ list != null && list.size > 0
+ } else {
+ false
+ }
+ }
+}
diff --git a/appkillermanager/src/main/res/drawable/asus_autostart.png b/appkillermanager/src/main/res/drawable/asus_autostart.png
deleted file mode 100644
index adee3a6..0000000
Binary files a/appkillermanager/src/main/res/drawable/asus_autostart.png and /dev/null differ
diff --git a/appkillermanager/src/main/res/drawable/asus_notification.png b/appkillermanager/src/main/res/drawable/asus_notification.png
deleted file mode 100644
index 8fed9fe..0000000
Binary files a/appkillermanager/src/main/res/drawable/asus_notification.png and /dev/null differ
diff --git a/appkillermanager/src/main/res/drawable/huawei_powersaving.png b/appkillermanager/src/main/res/drawable/huawei_powersaving.png
deleted file mode 100644
index 553fe37..0000000
Binary files a/appkillermanager/src/main/res/drawable/huawei_powersaving.png and /dev/null differ
diff --git a/appkillermanager/src/main/res/drawable/samsung.png b/appkillermanager/src/main/res/drawable/samsung.png
deleted file mode 100644
index 608ebff..0000000
Binary files a/appkillermanager/src/main/res/drawable/samsung.png and /dev/null differ
diff --git a/appkillermanager/src/main/res/layout/md_dialog_custom_view.xml b/appkillermanager/src/main/res/layout/md_dialog_custom_view.xml
deleted file mode 100644
index 8723d15..0000000
--- a/appkillermanager/src/main/res/layout/md_dialog_custom_view.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file