Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3dbb6027 authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Java 6 compat

parent 4adcd7db
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

buildscript {
    repositories {
        mavenCentral()
@@ -22,11 +21,15 @@ buildscript {
        classpath 'com.android.tools.build:gradle:1.0.0'
    }
}

apply plugin: 'com.android.library'
apply from: 'gradle-mvn-push.gradle'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.0"
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
    }
}

dependencies {
}
 No newline at end of file
+4 −4
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ import java.util.Set;
public class CellBackendHelper extends AbstractBackendHelper {
    private final Listener listener;
    private final TelephonyManager telephonyManager;
    private final Set<Cell> cells = new HashSet<>();
    private final Set<Cell> cells = new HashSet<Cell>();
    private PhoneStateListener phoneStateListener;
    private boolean supportsCellInfoChanged = true;

@@ -238,12 +238,12 @@ public class CellBackendHelper extends AbstractBackendHelper {
                try {
                    Field mncField = identity.getClass().getDeclaredField("mMnc");
                    mncField.setAccessible(true);
                    int mnc = (int) mncField.get(identity);
                    int mnc = (Integer) mncField.get(identity);
                    if (mnc >= 25 && mnc <= 1005) {
                        mnc = (mnc - 15) / 10;
                        mncField.setInt(identity, mnc);
                    }
                } catch (NoSuchFieldException | IllegalAccessException ignored) {
                } catch (Exception ignored) {
                }
            }
        }
@@ -294,7 +294,7 @@ public class CellBackendHelper extends AbstractBackendHelper {

    public synchronized Set<Cell> getCells() {
        currentDataUsed = true;
        return new HashSet<>(cells);
        return new HashSet<Cell>(cells);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import java.util.Set;
public abstract class HelperLocationBackendService extends LocationBackendService {

    private boolean opened;
    private Set<AbstractBackendHelper> helpers = new HashSet<>();
    private Set<AbstractBackendHelper> helpers = new HashSet<AbstractBackendHelper>();

    public synchronized void addHelper(AbstractBackendHelper helper) {
        helpers.add(helper);
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public class WiFiBackendHelper extends AbstractBackendHelper {

    private final Listener listener;
    private final WifiManager wifiManager;
    private final Set<WiFi> wiFis = new HashSet<>();
    private final Set<WiFi> wiFis = new HashSet<WiFi>();
    private final BroadcastReceiver wifiBroadcastReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
@@ -150,7 +150,7 @@ public class WiFiBackendHelper extends AbstractBackendHelper {
     */
    public synchronized Set<WiFi> getWiFis() {
        currentDataUsed = true;
        return new HashSet<>(wiFis);
        return new HashSet<WiFi>(wiFis);
    }

    /**