<commit_before>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2014 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 ti.modules.titanium.android.notificationmanager;

import java.util.Date;

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.TiC;
import org.appcelerator.titanium.TiContext;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiUIHelper;

import ti.modules.titanium.android.AndroidModule;
import ti.modules.titanium.android.PendingIntentProxy;
import ti.modules.titanium.android.RemoteViewsProxy;
import android.app.Notification;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationCompat.Builder;

@SuppressWarnings("deprecation")
@Kroll.proxy(creatableInModule=AndroidModule.class, propertyAccessors = {
	TiC.PROPERTY_CONTENT_TEXT,
	TiC.PROPERTY_CONTENT_TITLE
})
public class NotificationProxy extends KrollProxy 
{
	private static final String TAG = "TiNotification";

	protected Builder notificationBuilder;
	private int flags, ledARGB, ledOnMS, ledOffMS;
	private Uri sound;
	private int audioStreamType;
	
	public NotificationProxy() 
	{
		super();
		notificationBuilder =  new NotificationCompat.Builder(TiApplication.getAppCurrentActivity())
        .setSmallIcon(android.R.drawable.stat_sys_warning)
        .setWhen(System.currentTimeMillis());
		
		//set up default values
		flags = Notification.FLAG_AUTO_CANCEL;<commit_msg>[TIMOB-18098] Android: Fix for Notification causing error when application is backed out<commit_after>/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2014 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 ti.modules.titanium.android.notificationmanager;

import java.util.Date;

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.TiC;
import org.appcelerator.titanium.TiContext;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiUIHelper;

import ti.modules.titanium.android.AndroidModule;
import ti.modules.titanium.android.PendingIntentProxy;
import ti.modules.titanium.android.RemoteViewsProxy;
import android.app.Notification;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationCompat.Builder;

@SuppressWarnings("deprecation")
@Kroll.proxy(creatableInModule=AndroidModule.class, propertyAccessors = {
	TiC.PROPERTY_CONTENT_TEXT,
	TiC.PROPERTY_CONTENT_TITLE
})
public class NotificationProxy extends KrollProxy 
{
	private static final String TAG = "TiNotification";

	protected Builder notificationBuilder;
	private int flags, ledARGB, ledOnMS, ledOffMS;
	private Uri sound;
	private int audioStreamType;
	
	public NotificationProxy() 
	{
		super();
		notificationBuilder =  new NotificationCompat.Builder(TiApplication.getInstance().getApplicationContext())
        .setSmallIcon(android.R.drawable.stat_sys_warning)
        .setWhen(System.currentTimeMillis());
		
		//set up default values
		flags = Notification.FLAG_AUTO_CANCEL;
{'fraction_non_alphanumeric': 0.08864190837625373, 'fraction_numerical': 0.006776904310111141, 'mean_word_length': 5.93609022556391, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2898750', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1111, 'n_words': 236}