本文整理汇总了Java中com.google.samples.apps.iosched.service.SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS属性的典型用法代码示例。如果您正苦于以下问题:Java SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS属性的具体用法?Java SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS怎么用?Java SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.samples.apps.iosched.service.SessionAlarmService
的用法示例。
在下文中一共展示了SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doUserDataSync
/**
* Checks if there are changes on User's Data to sync with/from remote AppData folder.
*
* @return Whether or not data was changed.
* @throws IOException if there is a problem uploading the data.
*/
private boolean doUserDataSync(String accountName) throws IOException {
if (!isOnline()) {
LOGD(TAG, "Not attempting userdata sync because device is OFFLINE");
return false;
}
LOGD(TAG, "Starting user data sync.");
AbstractUserDataSyncHelper helper = UserDataSyncHelperFactory.buildSyncHelper(
mContext, accountName);
boolean modified = helper.sync();
if (modified) {
// Schedule notifications for the starred sessions.
Intent scheduleIntent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, mContext, SessionAlarmService.class);
mContext.startService(scheduleIntent);
}
return modified;
}
示例2: doUserScheduleSync
/**
* Checks if there are changes on MySchedule to sync with/from remote AppData folder.
*
* @return Whether or not data was changed.
* @throws IOException if there is a problem uploading the data.
*/
private boolean doUserScheduleSync(String accountName) throws IOException {
if (!isOnline()) {
LOGD(TAG, "Not attempting myschedule sync because device is OFFLINE");
return false;
}
LOGD(TAG, "Starting user data (myschedule) sync.");
AbstractUserDataSyncHelper helper = UserDataSyncHelperFactory.buildSyncHelper(
mContext, accountName);
boolean modified = helper.sync();
if (modified) {
// schedule notifications for the starred sessions
Intent scheduleIntent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, mContext, SessionAlarmService.class);
mContext.startService(scheduleIntent);
}
return modified;
}
示例3: onReceive
@Override
public void onReceive(Context context, Intent intent) {
Intent scheduleIntent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, context, SessionAlarmService.class);
context.startService(scheduleIntent);
}
示例4: run
@Override
public void run(Context context, Callback callback) {
Intent intent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, context, SessionAlarmService.class);
context.startService(intent);
}
示例5: onReceive
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (SessionCalendarService.ACTION_UPDATE_ALL_SESSIONS_CALENDAR_COMPLETED.equals(action)
|| Intent.ACTION_BOOT_COMPLETED.equals(action)) {
Intent scheduleIntent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, context, SessionAlarmService.class);
context.startService(scheduleIntent);
}
}
示例6: doUserDataSync
/**
* Checks if there are changes on User's Data to sync with/from remote AppData folder.
*
* @return Whether or not data was changed.
* @throws IOException if there is a problem uploading the data.
*/
private boolean doUserDataSync(SyncResult syncResult) throws IOException {
if (!ConnectivityUtils.isConnected(mContext)) {
LOGD(TAG, "Not attempting userdata sync because device is OFFLINE");
return false;
}
String accountName = AccountUtils.getActiveAccountName(mContext);
if (TextUtils.isEmpty(accountName)) {
LOGD(TAG, "Not attempting userdata sync because user is not signed in");
return false;
}
LOGD(TAG, "Starting user data sync.");
AbstractUserDataSyncHelper helper = UserDataSyncHelperFactory.buildSyncHelper(
mContext, accountName);
boolean modified = helper.sync();
if (modified) {
// Schedule notifications for the starred sessions.
Intent scheduleIntent = new Intent(
SessionAlarmService.ACTION_SCHEDULE_ALL_STARRED_BLOCKS,
null, mContext, SessionAlarmService.class);
mContext.startService(scheduleIntent);
}
syncResult.stats.numIoExceptions += helper.getIoExcpetions();
return modified;
}