Skip to content

Commit

Permalink
targetSdkVersion 35
Browse files Browse the repository at this point in the history
  • Loading branch information
m2049r committed Sep 5, 2024
1 parent d22fdfe commit 059438a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
buildToolsVersion = '34.0.0'
compileSdk 34
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 35
versionCode 4005
versionName "4.0.5 'Sidekick'"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />

<queries>
<intent>
Expand Down Expand Up @@ -103,7 +104,12 @@
android:name=".service.WalletService"
android:description="@string/service_description"
android:exported="false"
android:label="Monero Wallet Service" />
android:foregroundServiceType="specialUse"
android:label="Monero Wallet Service">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="Keeps app in sync with the blockchain" />
</service>

<provider
android:name="androidx.core.content.FileProvider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.m2049r.xmrwallet.service;

import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE;

import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
Expand Down Expand Up @@ -581,7 +583,11 @@ private void startNotfication() {
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.setContentIntent(pendingIntent)
.build();
startForeground(NOTIFICATION_ID, notification);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
startForeground(NOTIFICATION_ID, notification, FOREGROUND_SERVICE_TYPE_SPECIAL_USE);
} else {
startForeground(NOTIFICATION_ID, notification);
}
}

@RequiresApi(Build.VERSION_CODES.O)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import android.content.Intent;
import android.content.IntentFilter;

import androidx.core.content.ContextCompat;

import com.burgstaller.okhttp.AuthenticationCacheInterceptor;
import com.burgstaller.okhttp.CachingAuthenticatorDecorator;
import com.burgstaller.okhttp.digest.CachingAuthenticator;
Expand Down Expand Up @@ -144,7 +146,7 @@ public static void register(OnStatusChangedListener listener) {
.addStatusCallback(me);

// deal with org.torproject.android.intent.action.STATUS = STARTS_DISABLED
me.context.registerReceiver(orbotStatusReceiver, new IntentFilter(OrbotHelper.ACTION_STATUS));
ContextCompat.registerReceiver(me.context, orbotStatusReceiver, new IntentFilter(OrbotHelper.ACTION_STATUS), ContextCompat.RECEIVER_NOT_EXPORTED);

me.startTor();
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/menu/sidekick_connect_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

<item
android:id="@+id/action_help_sidekick"
android:icon="@drawable/ic_help_white_24dp"
android:orderInCategory="300"
android:title="@string/menu_help"
app:showAsAction="ifRoom" />

</menu>

0 comments on commit 059438a

Please sign in to comment.