Google shit again.
This commit is contained in:
@ -53,7 +53,7 @@ public class ActivityMainPoi extends ActivityGeneric
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
if(Miscellaneous.googleToBlameForLocation())
|
||||
if(Miscellaneous.googleToBlameForLocation(false))
|
||||
{
|
||||
ActivityMainScreen.openGoogleBlamingWindow();
|
||||
return;
|
||||
|
@ -311,7 +311,7 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
activityMainScreenInstance.tvMainScreenNoteFeaturesFromOtherFlavor.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(Miscellaneous.googleToBlameForLocation())
|
||||
if(Miscellaneous.googleToBlameForLocation(true))
|
||||
{
|
||||
// Intent intent = new Intent(AutomationService.this, ActivityDisplayLongMessage.class);
|
||||
// intent.putExtra("longMessage", getResources().getString(R.string.locationEngineDisabledLong));
|
||||
@ -463,8 +463,8 @@ public class ActivityMainScreen extends ActivityGeneric
|
||||
String message = Miscellaneous.getAnyContext().getResources().getText(R.string.locationEngineDisabledLong).toString();
|
||||
intent.putExtra("messageTitle", Miscellaneous.getAnyContext().getResources().getString(R.string.locationDisabled));
|
||||
intent.putExtra("longMessage", message);
|
||||
intent.putExtra("messageLink", "https://f-droid.org/en/packages/com.jens.automation2/");
|
||||
Miscellaneous.getAnyContext().startActivity(intent);
|
||||
intent.putExtra("messageLink", "https://server47.de/automation/fdroidMigration.html");
|
||||
ActivityMainScreen.getActivityMainScreenInstance().startActivity(intent);
|
||||
}
|
||||
|
||||
static void newsOptIn()
|
||||
|
@ -502,7 +502,7 @@ public class ActivityManageRule extends Activity
|
||||
String[] booleanChoices = null;
|
||||
if(triggerType == Trigger_Enum.pointOfInterest)
|
||||
{
|
||||
if(Miscellaneous.googleToBlameForLocation())
|
||||
if(Miscellaneous.googleToBlameForLocation(false))
|
||||
{
|
||||
ActivityMainScreen.openGoogleBlamingWindow();
|
||||
return;
|
||||
|
@ -231,8 +231,9 @@ public class ActivityPermissions extends Activity
|
||||
{
|
||||
for (String s : getRequiredPermissions(false))
|
||||
{
|
||||
if (!havePermission(s, context))
|
||||
return true;
|
||||
if(!s.equalsIgnoreCase(permissionNameLocationBackground) && !s.equalsIgnoreCase(permissionNameLocationFine) && !s.equalsIgnoreCase(permissionNameLocationCoarse) && Miscellaneous.googleToBlameForLocation(true))
|
||||
if (!havePermission(s, context))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,7 +299,10 @@ public class ActivityPermissions extends Activity
|
||||
{
|
||||
for (String singlePermission : getPermissionsForRule(rule))
|
||||
if (!havePermission(singlePermission, workingContext))
|
||||
addToArrayListUnique(singlePermission, requiredPermissions);
|
||||
{
|
||||
if(!singlePermission.equalsIgnoreCase(permissionNameLocationBackground) && !singlePermission.equalsIgnoreCase(permissionNameLocationFine) && !singlePermission.equalsIgnoreCase(permissionNameLocationCoarse) && Miscellaneous.googleToBlameForLocation(true))
|
||||
addToArrayListUnique(singlePermission, requiredPermissions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -399,7 +399,18 @@ public class AutomationService extends Service implements OnInitListener
|
||||
|
||||
protected void checkForMissingBackgroundLocationPermission()
|
||||
{
|
||||
if(Miscellaneous.googleToBlameForLocation())
|
||||
if(Miscellaneous.googleToBlameForLocation(true))
|
||||
{
|
||||
Intent intent = new Intent(AutomationService.this, ActivityMainTabLayout.class);
|
||||
PendingIntent pi = PendingIntent.getActivity(AutomationService.this, 0, intent, 0);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
|
||||
Miscellaneous.createDismissableNotificationWithDelay(2200, getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
|
||||
else
|
||||
Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
|
||||
}
|
||||
|
||||
/*
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
{
|
||||
if (BuildConfig.FLAVOR.equalsIgnoreCase("googlePlayFlavor"))
|
||||
@ -414,7 +425,7 @@ public class AutomationService extends Service implements OnInitListener
|
||||
Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
public static void startAutomationService(Context context, boolean startAtBoot)
|
||||
|
@ -1187,16 +1187,21 @@ public class Miscellaneous extends Service
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public static boolean googleToBlameForLocation()
|
||||
public static boolean googleToBlameForLocation(boolean checkExistingRules)
|
||||
{
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
{
|
||||
if (BuildConfig.FLAVOR.equalsIgnoreCase("googlePlayFlavor"))
|
||||
{
|
||||
if (Rule.isAnyRuleUsing(Trigger.Trigger_Enum.pointOfInterest))
|
||||
if(checkExistingRules)
|
||||
{
|
||||
return true;
|
||||
if (Rule.isAnyRuleUsing(Trigger.Trigger_Enum.pointOfInterest))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,10 @@ public class ReceiverCoordinator
|
||||
|
||||
// startCellLocationChangedReceiver
|
||||
if(!ConnectivityReceiver.isAirplaneMode(AutomationService.getInstance()) && WifiBroadcastReceiver.mayCellLocationReceiverBeActivated() && (Rule.isAnyRuleUsing(Trigger.Trigger_Enum.pointOfInterest) | Rule.isAnyRuleUsing(Trigger.Trigger_Enum.speed)))
|
||||
CellLocationChangedReceiver.startCellLocationChangedReceiver();
|
||||
{
|
||||
if(!Miscellaneous.googleToBlameForLocation(true))
|
||||
CellLocationChangedReceiver.startCellLocationChangedReceiver();
|
||||
}
|
||||
|
||||
// startBatteryReceiver
|
||||
if(Rule.isAnyRuleUsing(Trigger.Trigger_Enum.charging) | Rule.isAnyRuleUsing(Trigger.Trigger_Enum.usb_host_connection) | Rule.isAnyRuleUsing(Trigger.Trigger_Enum.batteryLevel))
|
||||
|
Reference in New Issue
Block a user