root / mobile / src / main / java / org / wannatrak / mobile / controller / cellid / NokiaS60CellIDInfoProvider.java @ 37

View | Annotate | Download

1
/*
2
 * Copyright 2009 Andrey Khalzov, and individual contributors as indicated by the @author tag.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing,
11
 * software distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and limitations under the License.
14
 */
15
16
package org.wannatrak.mobile.controller.cellid;
17
18
import org.wannatrak.mobile.model.Cell;
19
20
/**
21
 * Created 14.10.2009 22:34:47
22
 *
23
 * @author Andrey Khalzov
24
 */
25
public class NokiaS60CellIDInfoProvider implements CellIDInfoProvider {
26
27
    public boolean doesWorkForPlatform() {
28
        return getCellID() != null;
29
    }
30
31
    public Cell getCell() {
32
        return new Cell(getCellID(), getMobileCountryCode(), getMobileNetworkCode(), getLocationAreaCode());
33
    }
34
35
    public String getCellID() {
36
        return System.getProperty("com.nokia.mid.cellid");
37
    }
38
39
    public String getMobileCountryCode() {
40
        return System.getProperty("com.nokia.mid.networkid");
41
    }
42
43
    public String getMobileNetworkCode() {
44
        return System.getProperty("com.nokia.mid.networkid");
45
    }
46
47
    public String getLocationAreaCode() {
48
        return "0";
49
    }
50
}