當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。