Back to project page Speedometer.
The source code is released under:
Apache License
If you think the Android project Speedometer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* Copyright 2012 Google Inc. *// ww w . ja va 2s . c o m * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.wireless.speed.speedometer; import android.content.Intent; import java.security.InvalidParameterException; /** * A repackaged Intent class that includes Speedometer-specific information. * @author wenjiezeng@google.com (Steve Zeng) * */ public class UpdateIntent extends Intent { // Different types of payloads that this intent can carry: public static final String STRING_PAYLOAD = "STRING_PAYLOAD"; public static final String ERROR_STRING_PAYLOAD = "ERROR_STRING_PAYLOAD"; public static final String PROGRESS_PAYLOAD = "PROGRESS_PAYLOAD"; public static final String STATUS_MSG_PAYLOAD = "STATUS_MSG_PAYLOAD"; public static final String STATS_MSG_PAYLOAD = "STATS_MSG_PAYLOAD"; public static final String TASK_PRIORITY_PAYLOAD = "TASK_PRIORITY_PAYLOAD"; // Different types of actions that this intent can represent: private static final String PACKAGE_PREFIX = UpdateIntent.class.getPackage().getName(); public static final String MSG_ACTION = PACKAGE_PREFIX + ".MSG_ACTION"; public static final String PREFERENCE_ACTION = PACKAGE_PREFIX + ".PREFERENCE_ACTION"; public static final String MEASUREMENT_ACTION = PACKAGE_PREFIX + ".MEASUREMENT_ACTION"; public static final String CHECKIN_ACTION = PACKAGE_PREFIX + ".CHECKIN_ACTION"; public static final String CHECKIN_RETRY_ACTION = PACKAGE_PREFIX + ".CHECKIN_RETRY_ACTION"; public static final String MEASUREMENT_PROGRESS_UPDATE_ACTION = PACKAGE_PREFIX + ".MEASUREMENT_PROGRESS_UPDATE_ACTION"; public static final String SYSTEM_STATUS_UPDATE_ACTION = PACKAGE_PREFIX + ".SYSTEM_STATUS_UPDATE_ACTION"; public static final String SCHEDULER_CONNECTED_ACTION = PACKAGE_PREFIX + ".SCHEDULER_CONNECTED_ACTION"; public static final String SCHEDULE_UPDATE_ACTION = PACKAGE_PREFIX + ".SCHEDULE_UPDATE_ACTION"; /** * Creates an intent of the specified action with an optional message */ protected UpdateIntent(String strMsg, String action) throws InvalidParameterException { super(); if (action == null) { throw new InvalidParameterException("action of UpdateIntent should not be null"); } this.setAction(action); this.putExtra(STRING_PAYLOAD, strMsg); } }