Cleanup codes
Signed-off-by: cjybyjk <cjybyjk@gmail.com>
diff --git a/app/src/main/java/org/exthmui/game/qs/DNDTile.java b/app/src/main/java/org/exthmui/game/qs/DNDTile.java
index 6cf3597..8172c66 100644
--- a/app/src/main/java/org/exthmui/game/qs/DNDTile.java
+++ b/app/src/main/java/org/exthmui/game/qs/DNDTile.java
@@ -17,11 +17,6 @@
package org.exthmui.game.qs;
import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-
-import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import org.exthmui.game.R;
import org.exthmui.game.misc.Constants;
diff --git a/app/src/main/java/org/exthmui/game/receiver/GamingBroadcastReceiver.java b/app/src/main/java/org/exthmui/game/receiver/GamingBroadcastReceiver.java
index 4d1fa18..05c0aff 100644
--- a/app/src/main/java/org/exthmui/game/receiver/GamingBroadcastReceiver.java
+++ b/app/src/main/java/org/exthmui/game/receiver/GamingBroadcastReceiver.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.content.Intent;
import android.os.UserHandle;
-import android.util.Log;
import org.exthmui.game.misc.Constants;
import org.exthmui.game.services.GamingService;
diff --git a/app/src/main/java/org/exthmui/game/services/DanmakuService.java b/app/src/main/java/org/exthmui/game/services/DanmakuService.java
index 906776c..f317f53 100644
--- a/app/src/main/java/org/exthmui/game/services/DanmakuService.java
+++ b/app/src/main/java/org/exthmui/game/services/DanmakuService.java
@@ -35,6 +35,8 @@
public class DanmakuService extends NotificationListenerService {
+ private static final String TAG = "DanmakuService";
+
private Map<String, String> mLastNotificationMap = new HashMap<>();
private int filterThreshold = 3;
diff --git a/app/src/main/java/org/exthmui/game/services/GamingService.java b/app/src/main/java/org/exthmui/game/services/GamingService.java
index 28aac46..6265df0 100644
--- a/app/src/main/java/org/exthmui/game/services/GamingService.java
+++ b/app/src/main/java/org/exthmui/game/services/GamingService.java
@@ -34,9 +34,6 @@
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;
-import android.telecom.TelecomManager;
-import android.telephony.PhoneStateListener;
-import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
@@ -57,6 +54,8 @@
public class GamingService extends Service {
+ private static final String TAG = "GamingService";
+
private static final int NOTIFICATION_ID = 1;
private Intent mOverlayServiceIntent;
@@ -120,7 +119,7 @@
try {
mLineageHardware = LineageHardwareManager.getInstance(this);
} catch (Error e) {
- e.printStackTrace();
+ Log.e(TAG, "get LineageHardwareManager failed!", e);
}
registerReceiver(mGamingModeOffReceiver, new IntentFilter(Constants.Broadcasts.SYS_BROADCAST_GAMING_MODE_OFF));
@@ -233,7 +232,7 @@
try {
mStatusBarService.setBlockedGesturalNavigation(disable);
} catch (RemoteException e) {
- e.printStackTrace();
+ Log.e(TAG, "Failed to disable/enable gesture!", e);
}
}
diff --git a/app/src/main/java/org/exthmui/game/services/OverlayService.java b/app/src/main/java/org/exthmui/game/services/OverlayService.java
index 8e5f570..29ef046 100644
--- a/app/src/main/java/org/exthmui/game/services/OverlayService.java
+++ b/app/src/main/java/org/exthmui/game/services/OverlayService.java
@@ -43,8 +43,8 @@
import org.exthmui.game.R;
import org.exthmui.game.misc.Constants;
import org.exthmui.game.ui.GamingPerformanceView;
-import org.exthmui.game.ui.QuickStartAppView;
import org.exthmui.game.ui.QuickSettingsView;
+import org.exthmui.game.ui.QuickStartAppView;
import top.littlefogcat.danmakulib.danmaku.Danmaku;
import top.littlefogcat.danmakulib.danmaku.DanmakuManager;
@@ -52,6 +52,8 @@
public class OverlayService extends Service {
+ private static final String TAG = "OverlayService";
+
private View mGamingFloatingButton;
private LinearLayout mGamingOverlayView;
private ScrollView mGamingMenu;
diff --git a/app/src/main/java/org/exthmui/game/ui/GamingPerformanceView.java b/app/src/main/java/org/exthmui/game/ui/GamingPerformanceView.java
index 8050f26..d45fe6e 100644
--- a/app/src/main/java/org/exthmui/game/ui/GamingPerformanceView.java
+++ b/app/src/main/java/org/exthmui/game/ui/GamingPerformanceView.java
@@ -21,7 +21,6 @@
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
-import android.widget.RadioGroup;
import android.widget.SeekBar;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
diff --git a/app/src/main/java/org/exthmui/game/ui/QuickStartAppView.java b/app/src/main/java/org/exthmui/game/ui/QuickStartAppView.java
index 8439485..c669078 100644
--- a/app/src/main/java/org/exthmui/game/ui/QuickStartAppView.java
+++ b/app/src/main/java/org/exthmui/game/ui/QuickStartAppView.java
@@ -27,9 +27,9 @@
import android.os.Bundle;
import android.os.RemoteException;
import android.os.UserHandle;
-import android.util.ArrayMap;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
+import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
@@ -45,6 +45,8 @@
public class QuickStartAppView extends LinearLayout implements View.OnClickListener {
+ private static final String TAG = "QuickStartAppView";
+
private Context mContext;
private PackageManager mPackageManager;
private ActivityManager mActivityManager;
@@ -121,7 +123,7 @@
}
}
} catch (RemoteException e) {
- e.printStackTrace();
+ Log.e(TAG, "", e);
}
Intent startAppIntent = mPackageManager.getLaunchIntentForPackage(packageName);
diff --git a/app/src/main/java/top/littlefogcat/danmakulib/danmaku/CachedDanmakuViewPool.java b/app/src/main/java/top/littlefogcat/danmakulib/danmaku/CachedDanmakuViewPool.java
index dff116f..3685d6f 100644
--- a/app/src/main/java/top/littlefogcat/danmakulib/danmaku/CachedDanmakuViewPool.java
+++ b/app/src/main/java/top/littlefogcat/danmakulib/danmaku/CachedDanmakuViewPool.java
@@ -1,7 +1,5 @@
package top.littlefogcat.danmakulib.danmaku;
-import android.util.Log;
-
import java.util.LinkedList;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
diff --git a/app/src/main/java/top/littlefogcat/danmakulib/danmaku/DanmakuManager.java b/app/src/main/java/top/littlefogcat/danmakulib/danmaku/DanmakuManager.java
index b5c67af..24fad2c 100644
--- a/app/src/main/java/top/littlefogcat/danmakulib/danmaku/DanmakuManager.java
+++ b/app/src/main/java/top/littlefogcat/danmakulib/danmaku/DanmakuManager.java
@@ -6,8 +6,6 @@
import android.view.ViewGroup;
import android.widget.FrameLayout;
-import org.exthmui.game.misc.Constants;
-
import java.lang.ref.WeakReference;
import top.littlefogcat.danmakulib.utils.EasyL;
diff --git a/app/src/main/res/layout/gaming_qs_view.xml b/app/src/main/res/layout/gaming_qs_view.xml
index c2e2b33..60b1e29 100644
--- a/app/src/main/res/layout/gaming_qs_view.xml
+++ b/app/src/main/res/layout/gaming_qs_view.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
diff --git a/app/src/main/res/layout/music_control_layout.xml b/app/src/main/res/layout/music_control_layout.xml
index 63ed79d..2a955f6 100644
--- a/app/src/main/res/layout/music_control_layout.xml
+++ b/app/src/main/res/layout/music_control_layout.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
diff --git a/app/src/main/res/layout/time_battery_layout.xml b/app/src/main/res/layout/time_battery_layout.xml
index e9b0f99..fcb8a0d 100644
--- a/app/src/main/res/layout/time_battery_layout.xml
+++ b/app/src/main/res/layout/time_battery_layout.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal" >
+ android:orientation="horizontal">
<TextView
android:id="@+id/current_time"