startActivity package name fix

This commit is contained in:
2025-12-17 23:22:14 +01:00
parent 63264fcf9b
commit 91fdef99c3
6 changed files with 41 additions and 39 deletions

View File

@@ -1117,7 +1117,9 @@ public class Actions
if (!packageName.equals(dummyPackageString))
{
externalApplicationIntent.setPackage(packageName);
if(!packageName.isEmpty())
externalApplicationIntent.setPackage(packageName);
if (!StringUtils.isEmpty(className))
externalApplicationIntent.setClassName(packageName, className);
}
@@ -1138,8 +1140,8 @@ public class Actions
{
if (Miscellaneous.isNumeric(startupType))
externalApplicationIntent = packParametersIntoIntent(externalApplicationIntent, params, 4);
else
externalApplicationIntent = packParametersIntoIntent(externalApplicationIntent, params, 3);
// else
// externalApplicationIntent = packParametersIntoIntent(externalApplicationIntent, params, 3);
}
if (startupType.equals(ActivityManageActionStartActivity.startByActivityString))
@@ -1227,7 +1229,6 @@ public class Actions
{
Miscellaneous.logEvent("i", "StartOtherApp", "Adding parameter of type " + singleParam[0] + " with value " + singleParam[2] + " as standard data parameter.", 3);
intent.setData(Uri.parse(Miscellaneous.replaceVariablesInText(singleParam[2], context)));
}
else
{

View File

@@ -128,9 +128,9 @@ public class ActivityMainScreen extends ActivityGeneric
@Override
public void onClick(View v)
{
String privacyPolicyUrl = "https://server47.de/donate";
String donationUrl = "https://server47.de/donate";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(privacyPolicyUrl));
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(donationUrl));
startActivity(browserIntent);
}
});

View File

@@ -363,10 +363,10 @@ public class CellLocationChangedReceiver extends PhoneStateListener
// Miscellaneous.logEvent("i", "cellReceiver", "Not starting cellLocationListener because we have no data connection.", 4);
}
else
Miscellaneous.logEvent("w", "cellReceiver", "Wanted to activate CellLocationChangedReceiver, but Wifi-Receiver says not to.", 4);
Miscellaneous.logEvent("w", "cellReceiver", "Wanted to activate CellLocationChangedReceiver, but Wifi-Receiver says not to.", 5);
}
else
Miscellaneous.logEvent("i", "cellReceiver", "Not starting cellLocationListener because Airplane mode is active or SIM_STATE is not ready.", 4);
Miscellaneous.logEvent("i", "cellReceiver", "Not starting cellLocationListener because Airplane mode is active or SIM_STATE is not ready.", 5);
}
}
catch(Exception ex)

View File

@@ -64,36 +64,36 @@ public class SensorActivity implements SensorEventListener
{
}
public void onSensorChanged(SensorEvent event)
{
// Device has been moved
public void onSensorChanged(SensorEvent event)
{
// Device has been moved
float x = event.values[0];
float y = event.values[1];
float z = event.values[2];
float x = event.values[0];
float y = event.values[1];
float z = event.values[2];
if(mInitialized)
{
deltaX = Math.abs(lastX-x);
deltaY = Math.abs(lastY-y);
deltaZ = Math.abs(lastZ-z);
//Wenn das jetzt einen gewissen Grenzwert übersteigt, müßten wir den CellListener wieder aktivieren
if(deltaX > Settings.accelerometerMovementThreshold | deltaY > Settings.accelerometerMovementThreshold | deltaZ > Settings.accelerometerMovementThreshold)
{
String text = "Device has been moved. " + String.valueOf(deltaX)+" / "+String.valueOf(deltaY)+" / "+String.valueOf(deltaZ);
Miscellaneous.logEvent("i", "Accelerometer", text, 5);
CellLocationChangedReceiver.resetFollowUpdate();
CellLocationChangedReceiver.startCellLocationChangedReceiver();
if(mInitialized)
{
deltaX = Math.abs(lastX-x);
deltaY = Math.abs(lastY-y);
deltaZ = Math.abs(lastZ-z);
// If that exceeds a certain delta we need to start CellLocationListener again
if(deltaX > Settings.accelerometerMovementThreshold | deltaY > Settings.accelerometerMovementThreshold | deltaZ > Settings.accelerometerMovementThreshold)
{
String text = "Device has been moved. " + String.valueOf(deltaX)+" / "+String.valueOf(deltaY)+" / "+String.valueOf(deltaZ);
Miscellaneous.logEvent("i", "Accelerometer", text, 5);
CellLocationChangedReceiver.resetFollowUpdate();
CellLocationChangedReceiver.startCellLocationChangedReceiver();
}
}
else
{
lastX = x;
lastY = y;
lastZ = z;
mInitialized = true;
}
}
}
else
{
lastX = x;
lastY = y;
lastZ = z;
mInitialized = true;
}
}
protected static void startAccelerometerReceiver()
{

View File

@@ -34,11 +34,11 @@ public class DeviceOrientationListener implements SensorEventListener, Automatio
static int sensorValueCounter = 0;
// Gravity rotational data
float gravity[];
float[] gravity;
// Magnetic rotational data
float magnetic[]; //for magnetic rotational data
float accels[] = new float[3];
float mags[] = new float[3];
float[] magnetic; //for magnetic rotational data
float[] accels = new float[3];
float[] mags = new float[3];
float[] values = new float[3];
boolean hasMagneticSensor=false;