当前位置: 首页>>代码示例>>Java>>正文


Java TelephonyManager.DATA_ACTIVITY_NONE属性代码示例

本文整理汇总了Java中android.telephony.TelephonyManager.DATA_ACTIVITY_NONE属性的典型用法代码示例。如果您正苦于以下问题:Java TelephonyManager.DATA_ACTIVITY_NONE属性的具体用法?Java TelephonyManager.DATA_ACTIVITY_NONE怎么用?Java TelephonyManager.DATA_ACTIVITY_NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.telephony.TelephonyManager的用法示例。


在下文中一共展示了TelephonyManager.DATA_ACTIVITY_NONE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onDataActivity

public void onDataActivity(int direction) {
    switch (direction) {
        case TelephonyManager.DATA_ACTIVITY_NONE:
            mDevice.setDataActivityTypeShort("No");
            mDevice.setDataActivityType("None");
            break;
        case TelephonyManager.DATA_ACTIVITY_IN:
            mDevice.setDataActivityTypeShort("In");
            mDevice.setDataActivityType("In");
            break;
        case TelephonyManager.DATA_ACTIVITY_OUT:
            mDevice.setDataActivityTypeShort("Ou");
            mDevice.setDataActivityType("Out");
            break;
        case TelephonyManager.DATA_ACTIVITY_INOUT:
            mDevice.setDataActivityTypeShort("IO");
            mDevice.setDataActivityType("In-Out");
            break;
        case TelephonyManager.DATA_ACTIVITY_DORMANT:
            mDevice.setDataActivityTypeShort("Do");
            mDevice.setDataActivityType("Dormant");
            break;
    }
}
 
开发者ID:5GSD,项目名称:AIMSICDL,代码行数:24,代码来源:CellTracker.java

示例2: getNetworkConnectionStatus

public static boolean getNetworkConnectionStatus(Context context) {
	ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
	if (manager == null) {
		return false;
	}

	NetworkInfo info = manager.getActiveNetworkInfo();
	if (info == null) {
		return false;
	}

	TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
	if (tm == null) {
		return false;
	}

	if ((tm.getDataState() == TelephonyManager.DATA_CONNECTED || tm.getDataState() == TelephonyManager.DATA_ACTIVITY_NONE)
			&& info.isAvailable()) {
		return true;
	} else {
		return false;
	}
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:23,代码来源:NetworkUtil.java

示例3: getNetworkConnectionStatus

public static boolean getNetworkConnectionStatus(Context context) {
    ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    if (manager == null) {
        return false;
    }

    NetworkInfo info = manager.getActiveNetworkInfo();
    if (info == null) {
        return false;
    }

    TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    if (tm == null) {
        return false;
    }

    if ((tm.getDataState() == TelephonyManager.DATA_CONNECTED || tm.getDataState() == TelephonyManager.DATA_ACTIVITY_NONE)
            && info.isAvailable()) {
        return true;
    } else {
        return false;
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:23,代码来源:NetworkUtil.java

示例4: getDataActivity

String getDataActivity(TelephonyManager tm) {
    int direction = tm.getDataActivity();
    mDataActivityTypeShort = "un";
    mDataActivityType = "undef";

    switch (direction) {
        case TelephonyManager.DATA_ACTIVITY_NONE:
            mDataActivityTypeShort = "No";
            mDataActivityType = "None";
            break;
        case TelephonyManager.DATA_ACTIVITY_IN:
            mDataActivityTypeShort = "In";
            mDataActivityType = "In";
            break;
        case TelephonyManager.DATA_ACTIVITY_OUT:
            mDataActivityTypeShort = "Ou";
            mDataActivityType = "Out";
            break;
        case TelephonyManager.DATA_ACTIVITY_INOUT:
            mDataActivityTypeShort = "IO";
            mDataActivityType = "In-Out";
            break;
        case TelephonyManager.DATA_ACTIVITY_DORMANT:
            mDataActivityTypeShort = "Do";
            mDataActivityType = "Dormant";
            break;
    }

    return mDataActivityType;
}
 
开发者ID:5GSD,项目名称:AIMSICDL,代码行数:30,代码来源:Device.java


注:本文中的android.telephony.TelephonyManager.DATA_ACTIVITY_NONE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。