修复部分警告信息

This commit is contained in:
灌糖包子 2026-05-19 00:37:31 +08:00
parent 0b0f21da2f
commit f0c5050896
Signed by untrusted user: sookie
GPG Key ID: 0599BECB75C1E68D
2 changed files with 8 additions and 14 deletions

View File

@ -73,7 +73,6 @@ public final class MainActivity extends Activity {
private EditText feishuSecretEdit; private EditText feishuSecretEdit;
private EditText pollingIntervalEdit; private EditText pollingIntervalEdit;
private AlertDialog debugInfoDialog; private AlertDialog debugInfoDialog;
private View debugInfoView;
private long lastInboxSmsId = -1L; private long lastInboxSmsId = -1L;
private String googlePlayTextValue = ""; private String googlePlayTextValue = "";
private String keepAliveTextValue = ""; private String keepAliveTextValue = "";
@ -189,7 +188,7 @@ public final class MainActivity extends Activity {
private void showDebugInfoDialog() { private void showDebugInfoDialog() {
if (debugInfoDialog == null) { if (debugInfoDialog == null) {
debugInfoView = LayoutInflater.from(this).inflate(R.layout.dialog_debug_info, null); View debugInfoView = LayoutInflater.from(this).inflate(R.layout.dialog_debug_info, null);
googlePlayText = debugInfoView.findViewById(R.id.google_play_text); googlePlayText = debugInfoView.findViewById(R.id.google_play_text);
keepAliveText = debugInfoView.findViewById(R.id.keep_alive_text); keepAliveText = debugInfoView.findViewById(R.id.keep_alive_text);
databaseHeartbeatText = debugInfoView.findViewById(R.id.database_heartbeat_text); databaseHeartbeatText = debugInfoView.findViewById(R.id.database_heartbeat_text);
@ -503,13 +502,11 @@ public final class MainActivity extends Activity {
} }
private String buildLatestSmsTestMarkdown(SmsInboxReader.InboxResult inboxResult) { private String buildLatestSmsTestMarkdown(SmsInboxReader.InboxResult inboxResult) {
StringBuilder builder = new StringBuilder(); return "**SmsReceive 最近短信测试推送**" + '\n' +
builder.append("**SmsReceive 最近短信测试推送**").append('\n'); "时间:" + formatTime(inboxResult.dateMillis) + '\n' +
builder.append("时间:").append(formatTime(inboxResult.dateMillis)).append('\n'); "发送方:" + maskSender(inboxResult.sender) + '\n' +
builder.append("发送方:").append(maskSender(inboxResult.sender)).append('\n'); "短信ID" + inboxResult.id + '\n' +
builder.append("短信ID").append(inboxResult.id).append('\n'); "正文:" + emptyAsDash(inboxResult.body);
builder.append("正文:").append(emptyAsDash(inboxResult.body));
return builder.toString();
} }
private boolean hasReceiveSmsPermission() { private boolean hasReceiveSmsPermission() {
@ -693,9 +690,6 @@ public final class MainActivity extends Activity {
} }
private boolean isIgnoringBatteryOptimizations() { private boolean isIgnoringBatteryOptimizations() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return true;
}
PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
return powerManager != null && powerManager.isIgnoringBatteryOptimizations(getPackageName()); return powerManager != null && powerManager.isIgnoringBatteryOptimizations(getPackageName());
} }

View File

@ -18,12 +18,12 @@ allprojects {
} }
ext { ext {
minSdkVersion = 21 minSdkVersion = 23
compileSdkVersion = 30 compileSdkVersion = 30
targetSdkVersion = 30 targetSdkVersion = 30
buildToolsVersion = '30.0.3' buildToolsVersion = '30.0.3'
} }
task clean(type: Delete) { tasks.register('clean', Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }