Java Code Examples for android.content.Intent.getBundleExtra()

The following are Jave code examples for showing how to use getBundleExtra() of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AndroidBackendlessChat   File: AppLinkData.java   View Source Code Vote up 8 votes
private static AppLinkData createFromAlApplinkData(Intent intent) {
    Bundle applinks = intent.getBundleExtra(BUNDLE_AL_APPLINK_DATA_KEY);
    if (applinks == null) {
        return null;
    }

    AppLinkData appLinkData = new AppLinkData();
    appLinkData.targetUri = intent.getData();
    if (appLinkData.targetUri == null) {
        String targetUriString = applinks.getString(METHOD_ARGS_TARGET_URL_KEY);
        if (targetUriString != null) {
            appLinkData.targetUri = Uri.parse(targetUriString);
        }
    }
    appLinkData.argumentBundle = applinks;
    appLinkData.arguments = null;
    Bundle refererData = applinks.getBundle(ARGUMENTS_REFERER_DATA_KEY);
    if (refererData != null) {
        appLinkData.ref = refererData.getString(REFERER_DATA_REF_KEY);
    }

    return appLinkData;
}
 
Example 2
Project: buildAPKsSamples   File: GetRestrictionsReceiver.java   View Source Code Vote up 7 votes
@Override
public void onReceive(final Context context, Intent intent) {
    final PendingResult result = goAsync();

    // If app restriction settings are already created, they will be included in the Bundle
    // as key/value pairs.
    final Bundle existingRestrictions =
            intent.getBundleExtra(Intent.EXTRA_RESTRICTIONS_BUNDLE);
    Log.i(TAG, "existingRestrictions = " + existingRestrictions);

    new Thread() {
        public void run() {
            createRestrictions(context, result, existingRestrictions);
        }
    }.start();
}
 
Example 3
Project: VirtualHook   File: AppInstrumentation.java   View Source Code Vote up 7 votes
@Override
public void callActivityOnResume(Activity activity) {
    VirtualCore.get().getComponentDelegate().beforeActivityResume(activity);
    VActivityManager.get().onActivityResumed(activity);
    super.callActivityOnResume(activity);
    VirtualCore.get().getComponentDelegate().afterActivityResume(activity);
    Intent intent = activity.getIntent();
    if (intent != null) {
        Bundle bundle = intent.getBundleExtra("_VA_|_sender_");
        if (bundle != null) {
            IBinder callbackToken = BundleCompat.getBinder(bundle, "_VA_|_ui_callback_");
            IUiCallback callback = IUiCallback.Stub.asInterface(callbackToken);
            if (callback != null) {
                try {
                    callback.onAppOpened(VClientImpl.get().getCurrentPackage(), VUserHandle.myUserId());
                } catch (RemoteException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
 
Example 4
Project: letv   File: FloatingWindowPlayerService.java   View Source Code Vote up 7 votes
public int onStartCommand(Intent intent, int flags, int startId) {
    LogInfo.log(TAG, "onStartCommand");
    if (intent == null) {
        stopSelf();
        return -1;
    }
    if (!(this.mWindowManager == null || this.mFloatingWindowPlayerView == null)) {
        this.mFloatingWindowPlayerController.onFinish();
        this.mWindowManager.removeView(this.mFloatingWindowPlayerView);
        this.mFloatingWindowPlayerView = null;
    }
    this.mOldNetworkState = NetworkUtils.getNetworkType();
    Bundle bundle = intent.getBundleExtra(LetvConstant.Intent.Bundle.PLAY);
    this.mVideoParams = parseVideoParams(bundle);
    this.mFloatingWindowPlayerView = new FloatingWindowPlayerView(this);
    this.mFloatingWindowPlayerView.setVideoParams(this.mVideoParams);
    this.mFloatingWindowPlayerView.setWindowManager(this.mWindowManager);
    LogInfo.log(TAG, "Service中设置FloatingWindowPlayerController");
    this.mFloatingWindowPlayerView.load();
    this.mFloatingWindowPlayerController = this.mFloatingWindowPlayerView.getFloatingWindowPlayerController();
    this.mFloatingWindowPlayerController.setBundle(bundle);
    registerBroadcastReceiver();
    return 3;
}
 
Example 5
Project: android-mobile-engage-sdk   File: MobileEngageInternal.java   View Source Code Vote up 6 votes
String getMessageId(Intent intent) {
    String sid = null;
    Bundle payload = intent.getBundleExtra("payload");
    if (payload != null) {
        String customData = payload.getString("u");
        try {
            sid = new JSONObject(customData).getString("sid");
        } catch (JSONException e) {
        }
    }
    return sid;
}
 
Example 6
Project: SmartMath   File: ScriptEditorActivity.java   View Source Code Vote up 6 votes
@Override 
public void onActivityResult(int requestCode, int resultCode, Intent data) {     
	super.onActivityResult(requestCode, resultCode, data); 
	int nMode = MFPFileManagerActivity.START_FILE_MANAGER_BY_ITSELF;
	switch(requestCode) { 
		case (SCRIPT_FILE_MANAGER_ACTIVITY) : { 
			if (resultCode == Activity.RESULT_OK) {
				Bundle bundle = data.getBundleExtra("android.intent.extra.SelectedFile");
				if (bundle != null && bundle.getString("SelectedFilePath") != null) {
					mstrSelectedFilePath = bundle.getString("SelectedFilePath");
					nMode = bundle.getInt("FileManagerOpenMode");
				}
			} else 	{
				return;	// do nothing
			}
			break;
		} 
	}
	if (nMode == MFPFileManagerActivity.START_FILE_MANAGER_TO_OPEN_BY_SCRIPT_EDITOR)	{
		if (mstrSelectedFilePath.equals("") == false)	{
			openFile(mstrSelectedFilePath);
		}			
	} else if (nMode == MFPFileManagerActivity.START_FILE_MANAGER_TO_SAVE_BY_SCRIPT_EDITOR)	{
		if (mstrSelectedFilePath.equals("") == false)	{
			saveFile(mstrSelectedFilePath);
		}			
	}
	if (mstrNextTask.equals("openNewFile"))	{
		openNewFile();
		mstrNextTask = "";
	} else if (mstrNextTask.equals("finish"))	{
		finish();
		// need not to set mstrNextTask = "";
	}
}
 
Example 7
Project: kognitivo   File: NativeProtocol.java   View Source Code Vote up 6 votes
public static UUID getCallIdFromIntent(Intent intent) {
    if (intent == null) {
        return null;
    }
    int version = getProtocolVersionFromIntent(intent);
    String callIdString = null;
    if (isVersionCompatibleWithBucketedIntent(version)) {
        Bundle bridgeArgs = intent.getBundleExtra(EXTRA_PROTOCOL_BRIDGE_ARGS);
        if (bridgeArgs != null) {
            callIdString = bridgeArgs.getString(BRIDGE_ARG_ACTION_ID_STRING);
        }
    } else {
        callIdString = intent.getStringExtra(EXTRA_PROTOCOL_CALL_ID);
    }

    UUID callId = null;
    if (callIdString != null) {
        try {
            callId = UUID.fromString(callIdString);
        } catch (IllegalArgumentException exception) {
        }
    }
    return callId;
}
 
Example 8
Project: OSchina_resources_android   File: SimpleBackActivity.java   View Source Code Vote up 6 votes
protected void initFromIntent(int pageValue, Intent data) {
    if (data == null) {
        throw new RuntimeException("you must provide a page info to display");
    }
    SimpleBackPage page = SimpleBackPage.getPageByValue(pageValue);
    if (page == null) {
        throw new IllegalArgumentException("can not find page by value:" + pageValue);
    }

    setActionBarTitle(page.getTitle());

    try {
        Fragment fragment = (Fragment) page.getClz().newInstance();

        Bundle args = data.getBundleExtra(BUNDLE_KEY_ARGS);
        if (args != null) {
            fragment.setArguments(args);
        }

        FragmentTransaction trans = getSupportFragmentManager()
                .beginTransaction();
        trans.replace(R.id.container, fragment, TAG);
        trans.commitAllowingStateLoss();

        mFragment = new WeakReference<>(fragment);
    } catch (Exception e) {
        e.printStackTrace();
        throw new IllegalArgumentException(
                "generate fragment error. by value:" + pageValue);
    }
}
 
Example 9
Project: smartkey   File: IntentValueGetter.java   View Source Code Vote up 6 votes
/**
 * Get a value from an intent by a giving class and key.
 * @param intent
 *  the source intent
 * @param key
 *  the key of the value
 * @param clz
 *  the class of the value
 * @return
 *  the value from the source intent
 */
public static Object getValue(Intent intent, String key, Class<?> clz) {
    Object value = null;
    // Cause it is not an easy job to handle inheritance in apt, it is a lot easier to put the code in the Android environment.
    if(Bundle.class.isAssignableFrom(clz)) {
        // bundle implements parcelable, so it should place before parcelable.
        value = intent.getBundleExtra(key);
    } else if(Parcelable.class.isAssignableFrom(clz)) {
        value = intent.getParcelableExtra(key);
    } else if(Parcelable[].class.isAssignableFrom(clz)) {
        value = intent.getParcelableArrayExtra(key);
    } else if(boolean[].class.isAssignableFrom(clz)) {
        value = intent.getBooleanArrayExtra(key);
    } else if(byte[].class.isAssignableFrom(clz)) {
        value = intent.getByteArrayExtra(key);
    } else if(short[].class.isAssignableFrom(clz)) {
        value = intent.getShortArrayExtra(key);
    } else if(char[].class.isAssignableFrom(clz)) {
        value = intent.getCharArrayExtra(key);
    } else if(int[].class.isAssignableFrom(clz)) {
        value = intent.getIntArrayExtra(key);
    } else if(long[].class.isAssignableFrom(clz)) {
        value = intent.getLongArrayExtra(key);
    } else if(float[].class.isAssignableFrom(clz)) {
        value = intent.getFloatArrayExtra(key);
    } else if(double[].class.isAssignableFrom(clz)) {
        value = intent.getDoubleArrayExtra(key);
    } else if(String[].class.isAssignableFrom(clz)) {
        value = intent.getStringArrayExtra(key);
    } else if(CharSequence[].class.isAssignableFrom(clz)) {
        value = intent.getCharSequenceArrayExtra(key);
    } else if(Serializable.class.isAssignableFrom(clz)) {
        // some of the above are assignable for serializable, so serializable should be in the last place.
        value = intent.getSerializableExtra(key);
    } else {
        throw new RuntimeException(clz + " is not compatible with intent (key=" + key + ")");
    }

    return value;
}
 
Example 10
Project: react-native-leancloud-sdk   File: RNPushNotificationModule.java   View Source Code Vote up 6 votes
public void onNewIntent(Intent intent) {
    if (intent.hasExtra("notification")) {//用户点击通知栏消息
        Bundle bundle = intent.getBundleExtra("notification");
        bundle.putBoolean("foreground", false);
        intent.putExtra("notification", bundle);
        mJsDelivery.notifyNotification(bundle);
    }
}
 
Example 11
Project: easybundler   File: EasyBundler.java   View Source Code Vote up 6 votes
/**
 * Retrieve an object that was packed into an {@link Intent} via
 * {@link #putExtra(Intent, Object)}.
 * @param intent the {@link Intent} to unpack.
 * @param clazz the {@link Class} of the object to deserialize from the {@link Intent}.
 * @return an object of type {@code T}, or {@code null} if no object was found.
 */
public static <T> T fromIntent(Intent intent, Class<T> clazz) {
    String key = getClassKey(clazz);
    Bundle bundle = intent.getBundleExtra(key);
    if (bundle == null) {
        return null;
    }

    return fromBundle(bundle, clazz);
}
 
Example 12
Project: FastAndroid   File: BaseCallActivity.java   View Source Code Vote up 6 votes
@Override
protected void onStart() {
    super.onStart();
    Intent intent = getIntent();
    Bundle bundle = intent.getBundleExtra("floatbox");
    if (shouldRestoreFloat && bundle != null) {
        onRestoreFloatBox(bundle);
    }
}
 
Example 13
Project: letv   File: BasePlayLiveFlow.java   View Source Code Vote up 6 votes
public void initBaseData() {
    Intent intent = ((Activity) this.mContext).getIntent();
    if (intent != null) {
        boolean z;
        this.mFrom = intent.getIntExtra("from", 0);
        if (intent.getSerializableExtra(PlayConstant.VIDEO_TYPE) == VideoType.Panorama) {
            z = true;
        } else {
            z = false;
        }
        this.mIsPanoramaVideo = z;
        this.mChannelName = intent.getStringExtra(PlayConstant.LIVE_CHANNEL_NAME);
        this.mChannelNum = intent.getStringExtra(PlayConstant.LIVE_CHANNEL_LUNBO_NUMBER);
        this.mCode = intent.getStringExtra("code");
        this.mProgramName = intent.getStringExtra(PlayConstant.LIVE_PROGRAM_NAME);
        this.mChannelId = intent.getStringExtra(PlayConstant.LIVE_CHANNEL_ID);
        this.mSignal = intent.getStringExtra(PlayConstant.LIVE_CHANNEL_SIGNAL);
        LogInfo.log("clf", "initBaseData....mChannelId=" + this.mChannelId);
        this.mPushLiveId = intent.getStringExtra(PlayConstant.LIVE_LAUNCH_ID);
        this.mUniqueId = intent.getStringExtra(PlayConstant.LIVE_ID);
        LogInfo.log("clf", "....mUniqueId=" + this.mUniqueId + ",mPushLiveId=" + this.mPushLiveId);
        Bundle payBundle = intent.getBundleExtra(PlayConstant.BUNDLE_KEY_YC_PARAM);
        if (payBundle != null) {
            this.mIsPay = payBundle.getBoolean(PlayConstant.LIVE_IS_PAY, false);
            this.mScreenings = payBundle.getString(PlayConstant.LIVE_SCREENINGS);
            this.mHomeImgUrl = payBundle.getString(PlayConstant.LIVE_HOME_ICON);
            this.mGuestImgUrl = payBundle.getString(PlayConstant.LIVE_GUEST_ICON);
            this.mPlayTime = payBundle.getString("play_time");
        } else {
            this.mIsPay = intent.getBooleanExtra(PlayConstant.LIVE_IS_PAY, false);
            this.mScreenings = intent.getStringExtra(PlayConstant.LIVE_SCREENINGS);
            this.mHomeImgUrl = intent.getStringExtra(PlayConstant.LIVE_HOME_ICON);
            this.mGuestImgUrl = intent.getStringExtra(PlayConstant.LIVE_GUEST_ICON);
            this.mPlayTime = intent.getStringExtra("play_time");
        }
        this.mOldNetState = NetworkUtils.getNetworkType();
    }
}
 
Example 14
Project: JobSchedulerCompat   File: GcmSchedulerTest.java   View Source Code Vote up 5 votes
private void assertIntentMatchesJobInfo(Intent intent, JobInfo job) {
    assertEquals(GcmScheduler.ACTION_SCHEDULE, intent.getAction());
    assertEquals(GcmScheduler.PACKAGE_GMS, intent.getPackage());
    assertEquals(GcmScheduler.SCHEDULER_ACTION_SCHEDULE_TASK,
                 intent.getStringExtra(GcmScheduler.BUNDLE_PARAM_SCHEDULER_ACTION));
    assertThat(intent.getParcelableExtra(GcmScheduler.BUNDLE_PARAM_TOKEN), instanceOf(PendingIntent.class));

    assertEquals(job.getId(), (int) Integer.valueOf(intent.getStringExtra(GcmScheduler.PARAM_TAG)));
    assertEquals(GcmJobService.class.getName(), intent.getStringExtra(GcmScheduler.PARAM_SERVICE));
    assertTrue(intent.getBooleanExtra(GcmScheduler.PARAM_UPDATE_CURRENT, false));
    assertEquals(job.isPersisted(), intent.getBooleanExtra(GcmScheduler.PARAM_PERSISTED, false));

    if (job.hasEarlyConstraint() || job.hasLateConstraint()) {
        assertEquals(GcmScheduler.TRIGGER_TYPE_EXECUTION_WINDOW,
                     intent.getIntExtra(GcmScheduler.PARAM_TRIGGER_TYPE, -1));
        if (job.isPeriodic()) {
            assertEquals(TimeUnit.MILLISECONDS.toSeconds(job.getIntervalMillis()),
                         intent.getLongExtra(GcmScheduler.PARAM_TRIGGER_WINDOW_PERIOD, -1L));
            assertEquals(TimeUnit.MILLISECONDS.toSeconds(job.getIntervalMillis()),
                         intent.getLongExtra(GcmScheduler.PARAM_TRIGGER_WINDOW_FLEX, -1L));
        } else {
            assertEquals(TimeUnit.MILLISECONDS.toSeconds(job.getMinLatencyMillis()),
                         intent.getLongExtra(GcmScheduler.PARAM_TRIGGER_WINDOW_START, -1L));
            if (job.hasLateConstraint()) {
                assertEquals(TimeUnit.MILLISECONDS.toSeconds(job.getMaxExecutionDelayMillis()),
                             intent.getLongExtra(GcmScheduler.PARAM_TRIGGER_WINDOW_END, -1L));
            } else {
                assertEquals(TimeUnit.DAYS.toSeconds(7),
                             intent.getLongExtra(GcmScheduler.PARAM_TRIGGER_WINDOW_END, -1L));
            }
        }
    } else if (job.getTriggerContentUris() != null) {
        JobInfo.TriggerContentUri[] triggerContentUris = job.getTriggerContentUris();
        int size = triggerContentUris.length;
        Uri[] uriArray = new Uri[size];
        int[] flagsArray = new int[size];
        for (int i = 0; i < size; i++) {
            JobInfo.TriggerContentUri triggerContentUri = triggerContentUris[i];
            uriArray[i] = triggerContentUri.getUri();
            flagsArray[i] = triggerContentUri.getFlags();
        }
        assertEquals(GcmScheduler.TRIGGER_TYPE_CONTENT_URI,
                     intent.getIntExtra(GcmScheduler.PARAM_TRIGGER_TYPE, -1));
        assertArrayEquals(uriArray, intent.getParcelableArrayExtra(GcmScheduler.PARAM_CONTENT_URI_ARRAY));
        assertArrayEquals(flagsArray, intent.getIntArrayExtra(GcmScheduler.PARAM_CONTENT_URI_FLAGS_ARRAY));
    } else {
        assertEquals(GcmScheduler.TRIGGER_TYPE_IMMEDIATE,
                     intent.getIntExtra(GcmScheduler.PARAM_TRIGGER_TYPE, -1));
        assertEquals(0L, intent.getLongExtra(GcmScheduler.PARAM_TRIGGER_WINDOW_START, -1L));
        assertEquals(1L, intent.getLongExtra(GcmScheduler.PARAM_TRIGGER_WINDOW_END, -1L));
    }

    assertEquals(job.isRequireCharging(), intent.getBooleanExtra(PARAM_REQUIRES_CHARGING, false));
    int requiredNetwork = GcmScheduler.NETWORK_STATE_ANY;
    switch (job.getNetworkType()) {
        case JobInfo.NETWORK_TYPE_ANY:
            requiredNetwork = GcmScheduler.NETWORK_STATE_CONNECTED;
            break;

        case JobInfo.NETWORK_TYPE_UNMETERED:
            requiredNetwork = GcmScheduler.NETWORK_STATE_UNMETERED;
            break;

        default:
            requiredNetwork = GcmScheduler.NETWORK_STATE_ANY;
            break;
    }
    assertEquals(requiredNetwork, intent.getIntExtra(GcmScheduler.PARAM_REQUIRED_NETWORK, -1));

    Bundle retryStrategy = intent.getBundleExtra(GcmScheduler.PARAM_RETRY_STRATEGY);
    int backoffPolicy = job.getBackoffPolicy() == JobInfo.BACKOFF_POLICY_LINEAR
                        ? GcmScheduler.RETRY_POLICY_LINEAR : GcmScheduler.RETRY_POLICY_EXPONENTIAL;
    assertEquals(backoffPolicy, retryStrategy.getInt(GcmScheduler.PARAM_RETRY_STRATEGY_POLICY, -1));
    assertEquals(TimeUnit.MILLISECONDS.toSeconds(job.getInitialBackoffMillis()),
                 retryStrategy.getInt(GcmScheduler.PARAM_RETRY_STRATEGY_INITIAL_BACKOFF_SEC, -1));
    assertEquals(TimeUnit.HOURS.toSeconds(5),
                 retryStrategy.getInt(GcmScheduler.PARAM_RETRY_STRATEGY_MAXIMUM_BACKOFF_SEC, -1));

    assertEquals(job.getExtras().toMap(10),
                 new PersistableBundle(intent.getBundleExtra(GcmScheduler.PARAM_EXTRAS)).toMap(10));
}
 
Example 15
Project: KernelAdiutor-Mod   File: Tasker.java   View Source Code Vote up 5 votes
@Override
public void onReceive(Context context, Intent intent) {
    if (!ACTION_FIRE_SETTING.equals(intent.getAction())) {
        return;
    }

    final Bundle bundle = intent.getBundleExtra(EXTRA_BUNDLE);
    if (isBundleValid(bundle)) {
        String commands = bundle.getString(BUNDLE_EXTRA_STRING_MESSAGE);
        if (commands != null) {
            String[] cs = commands.split(DIVIDER);
            Log.i(TAG + ": " + getClass().getSimpleName(), "Applying " + cs[0]);
            if (Prefs.getBoolean("showtaskertoast", true, context)) {
                Utils.toast(context.getString(R.string.applying_profile, cs[0]), context, Toast.LENGTH_LONG);
            }

            if (cs.length > 1) {
                RootUtils.SU su = new RootUtils.SU();
                for (int i = 1; i < cs.length; i++) {
                    if (cs[i].isEmpty()) {
                        continue;
                    }
                    synchronized (this) {
                        CPUFreq.ApplyCpu applyCpu;
                        if (cs[i].startsWith("#") && (applyCpu =
                                new CPUFreq.ApplyCpu(cs[i].substring(1))).toString() != null) {
                            for (String applyCpuCommand : ApplyOnBoot.getApplyCpu(applyCpu, su)) {
                                Log.i(TAG + ": " + getClass().getSimpleName(), "Run: " + applyCpuCommand);
                                su.runCommand(applyCpuCommand);
                            }
                        } else {
                            Log.i(TAG + ": " + getClass().getSimpleName(), "Run: " + cs[i]);
                            su.runCommand(cs[i]);
                        }
                    }
                }
                su.close();
            }
        }
    }
}
 
Example 16
Project: CustomAndroidOneSheeld   File: QueryReceiver.java   View Source Code Vote up 5 votes
@Override
public void onReceive(final Context context, final Intent intent) {
    OneSheeldApplication app = (OneSheeldApplication) context
            .getApplicationContext();
    if (!com.twofortyfouram.locale.Intent.ACTION_QUERY_CONDITION
            .equals(intent.getAction())
            || !app.isConnectedToBluetooth()) {
        if (Constants.IS_LOGGABLE) {
            Log.e(Constants.LOG_TAG,
                    String.format(
                            Locale.US,
                            "Received unexpected Intent action %s", intent.getAction())); //$NON-NLS-1$
        }
        return;
    }

    BundleScrubber.scrub(intent);

    final Bundle bundle = intent
            .getBundleExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE);
    BundleScrubber.scrub(bundle);

    if (PluginBundleManager.isConditionBundleValid(bundle)) {
        try {
            boolean conditionState = bundle
                    .getBoolean(PluginBundleManager.CONDITION_BUNDLE_EXTRA_OUTPUT);
            final int selectedPin = bundle
                    .getInt(PluginBundleManager.CONDITION_BUNDLE_EXTRA_PIN_NUMBER);
            boolean digitalReadStatus = false;
            if (app.isConnectedToBluetooth())
                digitalReadStatus = app.getConnectedDevice().digitalRead(selectedPin);
            if (digitalReadStatus == conditionState
                    && digitalReadStatus != app.taskerPinsStatus
                    .get(selectedPin)) {
                setResultCode(com.twofortyfouram.locale.Intent.RESULT_CONDITION_SATISFIED);
                app.taskerPinsStatus.put(selectedPin, digitalReadStatus);
            } else {
                setResultCode(com.twofortyfouram.locale.Intent.RESULT_CONDITION_UNSATISFIED);
            }
        }catch (IncorrectPinException ignored){
            CrashlyticsUtils.logException(ignored);
        }
    }
}
 
Example 17
Project: androidBackFlow   File: BackFlowIntent.java   View Source Code Vote up 5 votes
static Bundle getExtra(Intent data) {
    return data.getBundleExtra(BACK_FLOW_EXTRA);
}
 
Example 18
Project: letv   File: NativeProtocol.java   View Source Code Vote up 5 votes
public static Bundle getMethodArgumentsFromIntent(Intent intent) {
    if (isVersionCompatibleWithBucketedIntent(getProtocolVersionFromIntent(intent))) {
        return intent.getBundleExtra(EXTRA_PROTOCOL_METHOD_ARGS);
    }
    return intent.getExtras();
}
 
Example 19
Project: letv   File: AppLinks.java   View Source Code Vote up 5 votes
public static Bundle getAppLinkData(Intent intent) {
    return intent.getBundleExtra(KEY_NAME_APPLINK_DATA);
}
 
Example 20
Project: DroidIPC   File: ServiceManagerImpl.java   View Source Code Vote up 4 votes
static ServiceManagerImpl createClientServiceManager(Context context,Intent intent) {
	
	log("createClientServiceManager");
	
	Bundle binders = intent.getBundleExtra(ServiceContext.EXTRA_BUNDLE);
	IBinder remoteServiceManager = binders.getBinder(ServiceContext.EXTRA_BUNDLE_BINDER);
	
	int cmd = intent.getIntExtra(ServiceContext.EXTRA_COMMAND, ServiceContext.CMD_CREATE_CLIENT_SERVICE_MANAGER);
	
	log("createClientServiceManager cmd = " + cmd);
	
	ServiceManagerImpl serviceManager = ServiceManagerImpl.createLocalServiceManager(context, remoteServiceManager);
	
	return serviceManager;
}