EMMA Coverage Report (generated Fri Aug 23 16:39:17 PDT 2013)
[all classes][org.chromium.content.common]

COVERAGE SUMMARY FOR SOURCE FILE [DeviceTelephonyInfo.java]

nameclass, %method, %block, %line, %
DeviceTelephonyInfo.java100% (1/1)100% (3/3)100% (21/21)100% (6/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DeviceTelephonyInfo100% (1/1)100% (3/3)100% (21/21)100% (6/6)
DeviceTelephonyInfo (Context): void 100% (1/1)100% (12/12)100% (4/4)
create (Context): DeviceTelephonyInfo 100% (1/1)100% (5/5)100% (1/1)
getNetworkCountryIso (): String 100% (1/1)100% (4/4)100% (1/1)

1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4 
5package org.chromium.content.common;
6 
7import android.content.Context;
8import android.telephony.TelephonyManager;
9 
10import org.chromium.base.CalledByNative;
11 
12/**
13 * This class facilitates access to the current telephony region,
14 * typically only available using the Java SDK.
15 */
16public class DeviceTelephonyInfo {
17 
18  private TelephonyManager mTelManager;
19 
20  private DeviceTelephonyInfo(Context context) {
21      Context appContext = context.getApplicationContext();
22      mTelManager = (TelephonyManager) appContext.getSystemService(Context.TELEPHONY_SERVICE);
23  }
24 
25  /**
26   * @return The ISO country code equivalent of the current MCC.
27   */
28  @CalledByNative
29  public String getNetworkCountryIso() {
30      return mTelManager.getNetworkCountryIso();
31  }
32 
33  /**
34   * Creates DeviceTelephonyInfo for a given Context.
35   * @param context A context to use.
36   * @return DeviceTelephonyInfo associated with a given Context.
37   */
38  @CalledByNative
39  public static DeviceTelephonyInfo create(Context context) {
40      return new DeviceTelephonyInfo(context);
41  }
42}

[all classes][org.chromium.content.common]
EMMA 2.0.5312 (C) Vladimir Roubtsov