com.google.ipc.invalidation.ticl.android2.ProtocolIntents.ListenerUpcalls Java Examples

The following examples show how to use com.google.ipc.invalidation.ticl.android2.ProtocolIntents.ListenerUpcalls. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AndroidInvalidationClientImpl.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void invalidate(InvalidationClient client, Invalidation invalidation,
    AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateIntent(
        ProtoWrapperConverter.convertToInvalidationProto(invalidation), ackHandleP));
  } catch (ValidationException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidate", ackHandle);
  }
}
 
Example #2
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void informRegistrationStatus(
    InvalidationClient client, ObjectId objectId, RegistrationState regState) {
  Intent intent = ListenerUpcalls.newRegistrationStatusIntent(
      ProtoConverter.convertToObjectIdProto(objectId),
      regState == RegistrationState.REGISTERED);
  issueIntent(context, intent);
}
 
Example #3
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void invalidateAll(InvalidationClient client, AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateAllIntent(ackHandleP));
  } catch (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateAll", ackHandle);
  }
}
 
Example #4
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void invalidateUnknownVersion(InvalidationClient client, ObjectId objectId,
    AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateUnknownIntent(
        ProtoConverter.convertToObjectIdProto(objectId), ackHandleP));
  } catch (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateUnknownVersion", ackHandle);
  }
}
 
Example #5
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void invalidate(InvalidationClient client, Invalidation invalidation,
    AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateIntent(
        ProtoConverter.convertToInvalidationProto(invalidation), ackHandleP));
  } catch (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidate", ackHandle);
  }
}
 
Example #6
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void informRegistrationStatus(
    InvalidationClient client, ObjectId objectId, RegistrationState regState) {
  Intent intent = ListenerUpcalls.newRegistrationStatusIntent(
      ProtoConverter.convertToObjectIdProto(objectId),
      regState == RegistrationState.REGISTERED);
  issueIntent(context, intent);
}
 
Example #7
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void invalidateAll(InvalidationClient client, AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateAllIntent(ackHandleP));
  } catch (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateAll", ackHandle);
  }
}
 
Example #8
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void invalidateUnknownVersion(InvalidationClient client, ObjectId objectId,
    AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateUnknownIntent(
        ProtoConverter.convertToObjectIdProto(objectId), ackHandleP));
  } catch (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateUnknownVersion", ackHandle);
  }
}
 
Example #9
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void invalidate(InvalidationClient client, Invalidation invalidation,
    AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateIntent(
        ProtoConverter.convertToInvalidationProto(invalidation), ackHandleP));
  } catch (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidate", ackHandle);
  }
}
 
Example #10
Source File: AndroidInvalidationClientImpl.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void informRegistrationStatus(
    InvalidationClient client, ObjectId objectId, RegistrationState regState) {
  Intent intent = ListenerUpcalls.newRegistrationStatusIntent(
      ProtoWrapperConverter.convertToObjectIdProto(objectId),
      regState == RegistrationState.REGISTERED);
  issueIntent(context, intent);
}
 
Example #11
Source File: AndroidInvalidationClientImpl.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void invalidateAll(InvalidationClient client, AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateAllIntent(ackHandleP));
  } catch (ValidationException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateAll", ackHandle);
  }
}
 
Example #12
Source File: AndroidInvalidationClientImpl.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void invalidateUnknownVersion(InvalidationClient client, ObjectId objectId,
    AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateUnknownIntent(
        ProtoWrapperConverter.convertToObjectIdProto(objectId), ackHandleP));
  } catch (ValidationException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateUnknownVersion", ackHandle);
  }
}
 
Example #13
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void ready(InvalidationClient client) {
  issueIntent(context, ListenerUpcalls.newReadyIntent());
}
 
Example #14
Source File: AndroidInvalidationClientImpl.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void informError(InvalidationClient client, ErrorInfo errorInfo) {
  issueIntent(context, ListenerUpcalls.newErrorIntent(errorInfo));
}
 
Example #15
Source File: AndroidInvalidationClientImpl.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void reissueRegistrations(InvalidationClient client, byte[] prefix, int prefixLength) {
  issueIntent(context, ListenerUpcalls.newReissueRegistrationsIntent(prefix, prefixLength));
}
 
Example #16
Source File: AndroidInvalidationClientImpl.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void informRegistrationFailure(InvalidationClient client, ObjectId objectId,
    boolean isTransient, String errorMessage) {
  issueIntent(context, ListenerUpcalls.newRegistrationFailureIntent(
      ProtoWrapperConverter.convertToObjectIdProto(objectId), isTransient, errorMessage));
}
 
Example #17
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void informRegistrationFailure(InvalidationClient client, ObjectId objectId,
    boolean isTransient, String errorMessage) {
  issueIntent(context, ListenerUpcalls.newRegistrationFailureIntent(
      ProtoConverter.convertToObjectIdProto(objectId), isTransient, errorMessage));
}
 
Example #18
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void reissueRegistrations(InvalidationClient client, byte[] prefix, int prefixLength) {
  issueIntent(context, ListenerUpcalls.newReissueRegistrationsIntent(prefix, prefixLength));
}
 
Example #19
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void informError(InvalidationClient client, ErrorInfo errorInfo) {
  issueIntent(context, ListenerUpcalls.newErrorIntent(errorInfo));
}
 
Example #20
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void ready(InvalidationClient client) {
  issueIntent(context, ListenerUpcalls.newReadyIntent());
}
 
Example #21
Source File: AndroidInvalidationClientImpl.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public void ready(InvalidationClient client) {
  issueIntent(context, ListenerUpcalls.newReadyIntent());
}
 
Example #22
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void informRegistrationFailure(InvalidationClient client, ObjectId objectId,
    boolean isTransient, String errorMessage) {
  issueIntent(context, ListenerUpcalls.newRegistrationFailureIntent(
      ProtoConverter.convertToObjectIdProto(objectId), isTransient, errorMessage));
}
 
Example #23
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void reissueRegistrations(InvalidationClient client, byte[] prefix, int prefixLength) {
  issueIntent(context, ListenerUpcalls.newReissueRegistrationsIntent(prefix, prefixLength));
}
 
Example #24
Source File: AndroidInvalidationClientImpl.java    From android-chromium with BSD 2-Clause "Simplified" License 4 votes vote down vote up
@Override
public void informError(InvalidationClient client, ErrorInfo errorInfo) {
  issueIntent(context, ListenerUpcalls.newErrorIntent(errorInfo));
}