Gets the current registration id for application on GCM service.
<p>
If result is empty, the registration has failed.

@return registration id, or empty string if the registration is not
complete.
772007
public static String getRegistrationId(Context context) {
        final SharedPreferences prefs = getGCMPreferences(context);
        String registrationId = prefs.getString(PROPERTY_REG_ID, "");
        // check if app was updated; if so, it must clear registration id to
        // avoid a race condition if GCM sends a message
        int oldVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
        int newVersion = getAppVersion(context);
        if (oldVersion != Integer.MIN_VALUE && oldVersion != newVersion) {
            Log.v(TAG, "App version changed from " + oldVersion + " to " +
                    newVersion + "; resetting registration id");
            clearRegistrationId(context);
            registrationId = "";
        }
        return registrationId;
    }
810973
@Override
    public String getId() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "getId");
        if (id == null)
        {
            // Set id to the class name
            id = this.getClass().getName();
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "getId", new Object[] { id });
        return id;
    }
527598
protected Integer getUserId() {
        Integer userId = ThreadContext.getContext(UserWebConstant.CTX_USERID);
        if (userId != null) {
            return userId;
        }
        return null;
    }
923315
private String GCMGetFreshToken(final String senderID) {
        getConfigLogger().verbose(getAccountId(), "GcmManager: Requesting a GCM token for Sender ID - " + senderID);
        String token = null;
        try {
            token = InstanceID.getInstance(context)
                    .getToken(senderID, GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
            getConfigLogger().info(getAccountId(), "GCM token : " + token);
        } catch (Throwable t) {
            getConfigLogger().verbose(getAccountId(), "GcmManager: Error requesting GCM token", t);
        }
        return token;
    }
1073593
public Integer getRegistryID(BaseMessage internalMessageReply)
    {
        Integer intRegistryID = null;
        Object objRegistryID = null;
        if (internalMessageReply.getMessageHeader() instanceof TrxMessageHeader)    // Always
            objRegistryID = ((TrxMessageHeader)internalMessageReply.getMessageHeader()).getMessageHeaderMap().get(TrxMessageHeader.REGISTRY_ID);
        if (objRegistryID == null)
            objRegistryID = internalMessageReply.get(TrxMessageHeader.REGISTRY_ID);
        if (objRegistryID instanceof Integer)
            intRegistryID = (Integer)objRegistryID;
        else if (objRegistryID instanceof String)
        {
            try {
                intRegistryID = new Integer(Integer.parseInt((String)objRegistryID));
            } catch (NumberFormatException ex)  {
                intRegistryID = null;
            }
        }
        return intRegistryID;
    }
18540
@SuppressWarnings("WeakerAccess")
  public String getInstanceId() {
    AppProfileName fullName =
        Verify.verifyNotNull(AppProfileName.parse(proto.getName()), "Name can never be null");

    //noinspection ConstantConditions
    return fullName.getInstance();
  }
1148059
public String getId()
  {
    String returnValue = _targetStream.getID();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getId", returnValue);
    return returnValue;
  }
124163
public UUID getMessageId() {
        final ByteBuffer wrap = ByteBuffer.wrap(messageIdBytes);
        return new UUID(wrap.asLongBuffer().get(0), wrap.asLongBuffer().get(1));
    }
457098
public String getId() {

    String id = this.argument.id();
    if ((id == null) || (id.length() == 0)) {
      id = this.argument.name();
    }
    return id;
  }
199947
public final String getBusId()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getBusId");
      SibTr.exit(tc, "getBusId", iBusId);
    }

    return iBusId;
  }
688505
public String getMessageId() {
        return (data != null && data.payload != null) ? data.payload.messageId : null;
    }
452854
public String getServicePid()
    {
        String servicePid = context.getProperty(BundleConstants.SERVICE_PID);
        if (servicePid != null)
            return servicePid;
        servicePid = this.getServiceClassName();
        if (servicePid == null)
            servicePid = this.getClass().getName();
        return ClassFinderActivator.getPackageName(servicePid, false);
    }
899158
public String getId()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getId");

    String id = consumerDispatcher.getSubscriptionUuid().toString();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())             
      SibTr.exit(tc, "getId", id);
    return id;
  }
412619
public String getId()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getId");
      SibTr.exit(tc, "getId", Long.toString(_messageID));
    }
    return ""+_messageID;
  }
243222
public long getId()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getId");
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getId", ""+messageProcessorId);
      return messageProcessorId;
   }
42628
protected static void getRegistrationId(OrtcClient ortcClient){
		if (checkPlayServices(ortcClient)) {
            gcm = GoogleCloudMessaging.getInstance(ortcClient.appContext);

            if (ortcClient.registrationId.isEmpty()){
                String regid = getRegistrationId(ortcClient.appContext);
                ortcClient.registrationId = regid;
                if (regid.isEmpty()) {
                    registerInBackground(ortcClient);
                }
            }

        } else {
        	ortcClient.raiseOrtcEvent(EventEnum.OnException, ortcClient, new OrtcGcmException("No valid Google Play Services APK found."));
        }
	}
640540
private synchronized int getNewClientID() {
        if ((clientIDGenerator + 1) >= Integer.MAX_VALUE) {
            //if we can't find a reusable ID within the first 100 slots, then fail.
            //Revisit: I don't want to loop through all 2+ billion entries to find that they are all taken, as this
            //could be seem as a DoS, but maybe some better heuristics for finding an empty ID? not sure if we will ever be
            //in this situation...
            final int limit = Integer.MIN_VALUE + 100;
            for (int i = Integer.MIN_VALUE; i < limit; i++) {
                if (inboxes.get(i) == null) {
                    return i;
                }
            }

            //Emit the warning
            Tr.warning(tc, "jmx.connector.server.rest.notification.limit.warning");

            throw ErrorHelper.createRESTHandlerJsonException(new RuntimeException("The server has reached its limit of new client notifications."),
                                                             JSONConverter.getConverter(),
                                                             APIConstants.STATUS_SERVICE_UNAVAILABLE);
        }

        return clientIDGenerator++;
    }