<commit_before>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */
package org.appcelerator.titanium.proxy;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.Log;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiBlob;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.util.TiConvert;

import android.graphics.Bitmap;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;

@Kroll.proxy(propertyAccessors = {
	TiC.PROPERTY_CLASS_NAME,
	TiC.PROPERTY_PACKAGE_NAME,
	TiC.PROPERTY_URL
})
/**
 * This is a proxy representation of the Android Intent type.
 * Refer to <a href="http://developer.android.com/reference/android/content/Intent.html">Android Intent</a>
 * for more details.
 */
public class IntentProxy extends KrollProxy 
{
	private static final String TAG = "TiIntent";

	public static final int TYPE_ACTIVITY = 0;
	public static final int TYPE_SERVICE = 1;
	public static final int TYPE_BROADCAST = 2;

	protected Intent intent;
	protected int type = TYPE_ACTIVITY;

	public IntentProxy()
	{	
	}

	public IntentProxy(Intent intent)
	{
		this.intent = intent;
		ComponentName componentName = intent.getComponent();
		if (componentName != null) {
		    String packageName = componentName.getPackageName();
		    if (packageName != null)
		        setProperty(TiC.PROPERTY_PACKAGE_NAME, packageName);
		    String className = componentName.getClassName();
		    if (className != null)
		        setProperty(TiC.PROPERTY_CLASS_NAME, className);
		}
		// Other properties have dedicated getters.
	}<commit_msg>Revert "[TIMOB-12412] Android: Ti.Android.currentActivity.intent.className and Ti.Android.currentActivity.intent.packageName are always undefined"<commit_after>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */
package org.appcelerator.titanium.proxy;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.Log;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiBlob;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.util.TiConvert;

import android.graphics.Bitmap;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;

@Kroll.proxy(propertyAccessors = {
	TiC.PROPERTY_CLASS_NAME,
	TiC.PROPERTY_PACKAGE_NAME,
	TiC.PROPERTY_URL
})
/**
 * This is a proxy representation of the Android Intent type.
 * Refer to <a href="http://developer.android.com/reference/android/content/Intent.html">Android Intent</a>
 * for more details.
 */
public class IntentProxy extends KrollProxy 
{
	private static final String TAG = "TiIntent";

	public static final int TYPE_ACTIVITY = 0;
	public static final int TYPE_SERVICE = 1;
	public static final int TYPE_BROADCAST = 2;

	protected Intent intent;
	protected int type = TYPE_ACTIVITY;

	public IntentProxy()
	{	
	}

	public IntentProxy(Intent intent)
	{
		this.intent = intent;
	}
{'fraction_non_alphanumeric': 0.09385446130110568, 'fraction_numerical': 0.006942658781177681, 'mean_word_length': 4.929878048780488, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5833720', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1201, 'n_words': 307}