forked from hex007/freej2me
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
microedition: sensor: Stub everything from the Mobile Sensor API
A few things like SensorManager weren't even present, causing issues in games like EDGE (EDGE Extended doesn't require this API though), now, this doesn't means sensors work, classes are fully stubbed and littered with warning messages on all of its functions.
- Loading branch information
1 parent
6ba7967
commit 2c68b30
Showing
14 changed files
with
356 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor; | ||
|
||
import org.recompile.mobile.Mobile; | ||
|
||
public interface DataAndErrorListener extends DataListener | ||
{ | ||
public void errorReceived(SensorConnection sensor, int errorCode, long timeStamp); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor; | ||
|
||
import org.recompile.mobile.Mobile; | ||
|
||
public final class LimitCondition implements Condition | ||
{ | ||
double limit; | ||
String operator; | ||
|
||
LimitCondition(double limit, String operator) | ||
{ | ||
Mobile.log(Mobile.LOG_WARNING, LimitCondition.class.getPackage().getName() + "." + LimitCondition.class.getSimpleName() + ": " + "Created new LimitCondition."); | ||
this.limit = limit; | ||
this.operator = operator; | ||
} | ||
|
||
public final double getLimit() { return limit; } | ||
|
||
public final String getOperator() { return operator; } | ||
|
||
@Override | ||
public boolean isMet(double value) { return false; } | ||
|
||
@Override | ||
public boolean isMet(Object value) { return false;} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor; | ||
|
||
import org.recompile.mobile.Mobile; | ||
|
||
public final class ObjectCondition implements Condition | ||
{ | ||
private Object limit; | ||
|
||
public ObjectCondition(Object limit) | ||
{ | ||
Mobile.log(Mobile.LOG_WARNING, ObjectCondition.class.getPackage().getName() + "." + ObjectCondition.class.getSimpleName() + ": " + "Created new ObjectCondition."); | ||
this.limit = limit; | ||
} | ||
|
||
public final Object getLimit() { return limit; } | ||
|
||
@Override | ||
public boolean isMet(double value) { return false; } | ||
|
||
@Override | ||
public boolean isMet(Object value) { return false; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor; | ||
|
||
import org.recompile.mobile.Mobile; | ||
|
||
public class RangeCondition implements Condition | ||
{ | ||
private double lowerLimit; | ||
private String lowerOp; | ||
private double upperLimit; | ||
private String upperOp; | ||
|
||
public RangeCondition(double lowerLimit, String lowerOp, double upperLimit, String upperOp) | ||
{ | ||
Mobile.log(Mobile.LOG_WARNING, RangeCondition.class.getPackage().getName() + "." + RangeCondition.class.getSimpleName() + ": " + "Created new RangeCondition."); | ||
this.lowerLimit = lowerLimit; | ||
this.lowerOp = lowerOp; | ||
this.upperLimit = upperLimit; | ||
this.upperOp = upperOp; | ||
} | ||
|
||
public double getLowerLimit() { return lowerLimit; } | ||
|
||
public String getLowerOp() { return lowerOp; } | ||
|
||
public double getUpperLimit() { return upperLimit; } | ||
|
||
public String getUpperOp() { return upperOp; } | ||
|
||
@Override | ||
public boolean isMet(double doubleValue) { return false; } | ||
|
||
@Override | ||
public boolean isMet(Object value) { return false; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor; | ||
|
||
import org.recompile.mobile.Mobile; | ||
|
||
public class SensorManager | ||
{ | ||
|
||
public static void addSensorListener(SensorListener listener, SensorInfo info) | ||
{ | ||
Mobile.log(Mobile.LOG_WARNING, SensorManager.class.getPackage().getName() + "." + SensorManager.class.getSimpleName() + ": " + "addSensorListener(SensorListener, SensorInfo)."); | ||
} | ||
|
||
public static void addSensorListener(SensorListener listener, String quantity) | ||
{ | ||
Mobile.log(Mobile.LOG_WARNING, SensorManager.class.getPackage().getName() + "." + SensorManager.class.getSimpleName() + ": " + "addSensorListener(SensorListener, String)."); | ||
} | ||
|
||
public static SensorInfo[] findSensors(String url) | ||
{ | ||
Mobile.log(Mobile.LOG_WARNING, SensorManager.class.getPackage().getName() + "." + SensorManager.class.getSimpleName() + ": " + "findSensors(String)."); | ||
return new SensorInfo[]{}; | ||
} | ||
|
||
public static SensorInfo[] findSensors(String quantity, String contextType) | ||
{ | ||
Mobile.log(Mobile.LOG_WARNING, SensorManager.class.getPackage().getName() + "." + SensorManager.class.getSimpleName() + ": " + "findSensors(String, String)."); | ||
return new SensorInfo[]{}; | ||
} | ||
|
||
public static void removeSensorListener (SensorListener listener) | ||
{ | ||
Mobile.log(Mobile.LOG_WARNING, SensorManager.class.getPackage().getName() + "." + SensorManager.class.getSimpleName() + ": " + "removeSensorListener(SensorListener)."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor.control; | ||
|
||
public interface Control | ||
{ | ||
public void execute(); | ||
|
||
public String getName(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor.control; | ||
|
||
public interface Controllable | ||
{ | ||
public Control getControl(String name); | ||
|
||
public Control[] getControls(); | ||
} |
27 changes: 27 additions & 0 deletions
27
src/javax/microedition/sensor/control/MeasurementRangeControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor.control; | ||
|
||
import javax.microedition.sensor.ChannelInfo; | ||
import javax.microedition.sensor.MeasurementRange; | ||
|
||
public interface MeasurementRangeControl extends Control | ||
{ | ||
public MeasurementRange getMeasurementRange(ChannelInfo channelInfo); | ||
|
||
public void setMeasurementRange(ChannelInfo channelInfo, MeasurementRange measurementRange); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/javax/microedition/sensor/control/SampleRateControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor.control; | ||
|
||
public interface SampleRateControl extends Control | ||
{ | ||
public float getSampleRate(); | ||
|
||
public float[] getSampleRates(); | ||
|
||
public void setSampleRate(float sampleRate); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
This file is part of FreeJ2ME. | ||
FreeJ2ME is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
FreeJ2ME is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with FreeJ2ME. If not, see http://www.gnu.org/licenses/ | ||
*/ | ||
package javax.microedition.sensor.control; | ||
|
||
public interface StartControl extends Control { } |
Oops, something went wrong.