Forum added to contact options

This commit is contained in:
2025-10-19 23:32:34 +02:00
parent 7972a335c3
commit a6e10d09c3
17 changed files with 2060 additions and 2042 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,7 @@ import android.content.res.Resources;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.MotionEvent;
@@ -46,7 +47,7 @@ public class ActivityMainScreen extends ActivityGeneric
ToggleButton toggleService, tbLockSound;
Button bShowHelp, bPrivacy, bAddSoundLockTIme, bDonate, bControlCenter;
TextView tvActivePoi, tvClosestPoi, tvLastRule, tvLastProfile, tvMainScreenNotePermissions, tvMainScreenNoteFeaturesFromOtherFlavor, tvMainScreenNoteLocationImpossibleBlameGoogle, tvMainScreenNoteNews, tvLockSoundDuration;
TextView tvActivePoi, tvClosestPoi, tvLastRule, tvLastProfile, tvMainScreenNotePermissions, tvMainScreenNoteFeaturesFromOtherFlavor, tvMainScreenNoteLocationImpossibleBlameGoogle, tvMainScreenNoteNews, tvLockSoundDuration, tvContactNotice;
ListView lvRuleHistory;
ArrayAdapter<Rule> ruleHistoryListViewAdapter;
@@ -83,10 +84,14 @@ public class ActivityMainScreen extends ActivityGeneric
tbLockSound = (ToggleButton) findViewById(R.id.tbLockSound);
toggleService = (ToggleButton) findViewById(R.id.tbArmMastListener);
bDonate = (Button)findViewById(R.id.bDonate);
tvContactNotice = (TextView) findViewById(R.id.tvContactNotice);
if(!BuildConfig.FLAVOR.equalsIgnoreCase(AutomationService.flavor_name_googleplay))
bDonate.setVisibility(View.VISIBLE);
// Make links clickable
tvContactNotice.setMovementMethod(LinkMovementMethod.getInstance());
toggleService.setChecked(AutomationService.isMyServiceRunning(this));
toggleService.setOnCheckedChangeListener(new OnCheckedChangeListener()
{

View File

@@ -157,6 +157,15 @@ public class AutomationService extends Service implements OnInitListener
ActivityPermissions.requestSpecificPermission(Manifest.permission.FOREGROUND_SERVICE);
return false;
}
else
{
if(Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 34 && !ActivityPermissions.havePermission(Manifest.permission.FOREGROUND_SERVICE_SPECIAL_USE, context))
{
Toast.makeText(context, context.getResources().getString(R.string.permissionForegroundServiceTypeSpecialUseRequired), Toast.LENGTH_LONG).show();
Miscellaneous.logEvent("e", "Permission", "Don't have permission FOREGROUND_SERVICE_SPECIAL_USE. Will request it now.", 4);
return false;
}
}
}
if (
@@ -510,6 +519,7 @@ public class AutomationService extends Service implements OnInitListener
{
Intent myServiceIntent = new Intent(context, AutomationService.class);
myServiceIntent.putExtra("startAtBoot", startAtBoot);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
context.startForegroundService(myServiceIntent);
else
@@ -661,9 +671,9 @@ public class AutomationService extends Service implements OnInitListener
myNotification.flags |= Notification.FLAG_NO_CLEAR;
// notificationManager.notify(notificationId, myNotification);
if(Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 34)
instance.startForeground(notificationId, myNotification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE);
else
// if(Miscellaneous.getTargetSDK(Miscellaneous.getAnyContext()) >= 34)
// instance.startForeground(notificationId, myNotification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE);
// else
instance.startForeground(notificationId, myNotification);
}
}