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


Java BuildConfig.DEBUG属性代码示例

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


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

示例1: getScheduleData

public ArrayList<ScheduleItem> getScheduleData(long start, long end) {
    // get sessions in my schedule and blocks, starting anytime in the conference day
    ArrayList<ScheduleItem> mutableItems = new ArrayList<ScheduleItem>();
    ArrayList<ScheduleItem> immutableItems = new ArrayList<ScheduleItem>();
    addBlocks(start, end, mutableItems, immutableItems);
    addSessions(start, end, mutableItems, immutableItems);

    ArrayList<ScheduleItem> result = ScheduleItemHelper.processItems(mutableItems, immutableItems);
    if (BuildConfig.DEBUG || Log.isLoggable(TAG, Log.DEBUG)) {
        ScheduleItem previous = null;
        for (ScheduleItem item: result) {
            if ((item.flags & ScheduleItem.FLAG_CONFLICTS_WITH_PREVIOUS) != 0) {
                Log.d(TAG, "Schedule Item conflicts with previous. item="+item+" previous="+previous);
            }
            previous = item;
        }
    }

    setSessionCounters(result, start, end);
    return result;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:21,代码来源:ScheduleHelper.java

示例2: initializeAnalyticsTracker

/**
 * Initialize the analytics tracker in use by the application. This should only be called
 * once, when the TOS is signed. The {@code applicationContext} parameter MUST be the
 * application context or an object leak could occur.
 */
private static synchronized void initializeAnalyticsTracker(Context applicationContext) {
    sAppContext = applicationContext;
    if (mTracker == null) {
        int useProfile;
        if (BuildConfig.DEBUG) {
            LOGD(TAG, "Analytics manager using DEBUG ANALYTICS PROFILE.");
            useProfile = R.xml.analytics_debug;
        } else {
            useProfile = R.xml.analytics_release;
        }

        try {
            mTracker = GoogleAnalytics.getInstance(applicationContext).newTracker(useProfile);
        } catch (Exception e) {
            // If anything goes wrong, force an opt-out of tracking. It's better to accidentally
            // protect privacy than accidentally collect data.
            setAnalyticsEnabled(false);
        }
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:25,代码来源:AnalyticsHelper.java

示例3: isSessionOngoing_OngoingSession_ReturnsTrue

@Test
public void isSessionOngoing_OngoingSession_ReturnsTrue() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session in progress
        initMockCursorWithOngoingSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session is ongoing
        assertThat(spyModel.isSessionOngoing(), is(true));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例4: isSessionOngoing_SessionNotStarted_ReturnsFalse

@Test
public void isSessionOngoing_SessionNotStarted_ReturnsFalse() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session in future
        initMockCursorWithNotStartedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session is not ongoing
        assertThat(spyModel.isSessionOngoing(), is(false));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例5: isSessionOngoing_SessionEnded_ReturnsFalse

@Test
public void isSessionOngoing_SessionEnded_ReturnsFalse() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session that has ended
        initMockCursorWithEndedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session is not ongoing
        assertThat(spyModel.isSessionOngoing(), is(false));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例6: hasSessionStarted_OnGoingSession_ReturnsTrue

@Test
public void hasSessionStarted_OnGoingSession_ReturnsTrue() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session in progress
        initMockCursorWithOngoingSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session has started
        assertThat(spyModel.hasSessionStarted(), is(true));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例7: hasSessionStarted_SessionNotStarted_ReturnsFalse

@Test
public void hasSessionStarted_SessionNotStarted_ReturnsFalse() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session in future
        initMockCursorWithNotStartedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session has not started
        assertThat(spyModel.hasSessionStarted(), is(false));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例8: hasSessionStarted_SessionEnded_ReturnsTrue

@Test
public void hasSessionStarted_SessionEnded_ReturnsTrue() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session that has ended
        initMockCursorWithEndedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session has started
        assertThat(spyModel.hasSessionStarted(), is(true));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例9: hasSessionEnded_SessionNotStarted_ReturnsFalse

@Test
public void hasSessionEnded_SessionNotStarted_ReturnsFalse() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session in progress
        initMockCursorWithNotStartedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session has not ended
        assertThat(spyModel.hasSessionEnded(), is(false));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例10: hasSessionEnded_OngoingSession_ReturnsFalse

@Test
public void hasSessionEnded_OngoingSession_ReturnsFalse() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session in progress
        initMockCursorWithOngoingSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session has not ended
        assertThat(spyModel.hasSessionEnded(), is(false));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例11: hasSessionEnded_SessionEnded_ReturnsTrue

@Test
public void hasSessionEnded_SessionEnded_ReturnsTrue() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session that has ended
        initMockCursorWithEndedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session has ended
        assertThat(spyModel.hasSessionEnded(), is(true));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例12: minutesSinceSessionStarted_SessionNotStarted_ReturnsCorrectMinutes

@Test
public void minutesSinceSessionStarted_SessionNotStarted_ReturnsCorrectMinutes() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session not started
        initMockCursorWithNotStartedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session is ongoing
        assertThat(spyModel.minutesSinceSessionStarted(), is(0l));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例13: isSessionReadyForFeedback_SessionEnded_ReturnsTrue

@Test
public void isSessionReadyForFeedback_SessionEnded_ReturnsTrue() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session that has ended
        initMockCursorWithEndedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session is ongoing
        assertThat(spyModel.isSessionReadyForFeedback(), is(true));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例14: minutesUntilSessionStarts_SessionNotStarted_ReturnsCorrectMinutes

@Test
public void minutesUntilSessionStarts_SessionNotStarted_ReturnsCorrectMinutes() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session starting in 1 hour
        initMockCursorWithNotStartedSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session is ongoing
        assertThat(spyModel.minutesUntilSessionStarts(), is(60l));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java

示例15: minutesUntilSessionStarts_SessionStarted_ReturnsCorrectMinutes

@Test
public void minutesUntilSessionStarts_SessionStarted_ReturnsCorrectMinutes() {
    // Only possible to mock current time in debug build
    if (BuildConfig.DEBUG) {
        // Given a mock cursor for a session in progress
        initMockCursorWithOngoingSession(mMockCursor);
        SessionDetailModel spyModel = setSpyModelForSessionLoading();

        // When session is loaded
        spyModel.readDataFromCursor(mMockCursor,
                SessionDetailModel.SessionDetailQueryEnum.SESSIONS);

        // Then session is ongoing
        assertThat(spyModel.minutesUntilSessionStarts(), is(0l));
    }
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:16,代码来源:SessionDetailModelTest.java


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