1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Android SDK 34 (#14892)

This commit is contained in:
rubenwardy 2024-08-01 23:13:13 +01:00 committed by GitHub
parent 26deb26f17
commit d566b0e280
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 30 additions and 13 deletions

View file

@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
package net.minetest.minetest;
import android.annotation.SuppressLint;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
@ -83,13 +84,18 @@ public class MainActivity extends AppCompatActivity {
}
};
@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
IntentFilter filter = new IntentFilter(ACTION_UPDATE);
registerReceiver(myReceiver, filter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(myReceiver, filter, RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(myReceiver, filter);
}
mProgressBar = findViewById(R.id.progressBar);
mTextView = findViewById(R.id.textView);

View file

@ -186,6 +186,7 @@ public class UnzipService extends IntentService {
private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {
Intent intentUpdate = new Intent(ACTION_UPDATE);
intentUpdate.setPackage(getPackageName());
intentUpdate.putExtra(ACTION_PROGRESS, progress);
intentUpdate.putExtra(ACTION_PROGRESS_MESSAGE, message);
if (!isSuccess)