Projects >> SalesforceMobileSDK-Android >>20c847e0ffb206b85c7bfa62e043ff3739b66c59

Chunk
Conflicting content
	/**
	 * Current version of this SDK.
	 */
<<<<<<< HEAD
    public static final String SDK_VERSION = "1.3.unstable";
=======
    public static final String SDK_VERSION = "1.2.2";
>>>>>>> 6333f7e97efba6c33cda3fd24663421b814ad046

    /*
     * Last phone version
Solution content
/*
 * Copyright (c) 2011, salesforce.com, inc.
 * All rights reserved.
 * Redistribution and use of this software in source and binary forms, with or
 * without modification, are permitted provided that the following conditions
 * are met:
 * - Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 * - Neither the name of salesforce.com, inc. nor the names of its contributors
 * may be used to endorse or promote products derived from this software without
 * specific prior written permission of salesforce.com, inc.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package com.salesforce.androidsdk.app;

import info.guardianproject.database.sqlcipher.SQLiteDatabase;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.os.Build;
import android.util.Log;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;

import com.salesforce.androidsdk.auth.HttpAccess;
import com.salesforce.androidsdk.rest.ClientManager;
import com.salesforce.androidsdk.security.Encryptor;
import com.salesforce.androidsdk.security.PasscodeManager;
import com.salesforce.androidsdk.security.PasscodeManager.HashConfig;
import com.salesforce.androidsdk.store.DBOpenHelper;
import com.salesforce.androidsdk.store.SmartStore;
import com.salesforce.androidsdk.ui.LoginActivity;
import com.salesforce.androidsdk.ui.SalesforceR;
import com.salesforce.androidsdk.util.EventsObservable;
import com.salesforce.androidsdk.util.EventsObservable.EventType;

/**
 * Super class for all force applications.
 * You should extend this class or make sure to initialize HttpAccess in your application's onCreate method.
 */
public abstract class ForceApp extends Application {

    /**
     * Current version of this SDK.
     */
    public static final String SDK_VERSION = "1.3.unstable";

    /*
     * Last phone version
File
ForceApp.java
Developer's decision
Manual
Kind of conflict
Attribute
Chunk
Conflicting content
            conMgr = null;
        }
        else {
<<<<<<< HEAD
            // Keep reference to app
            this.app = app;

            // Registering receiver to handle network changes
            app.registerReceiver(this, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));

            // Getting connectivity manager and current network type
            conMgr = (ConnectivityManager) app.getSystemService(Context.CONNECTIVITY_SERVICE);
            if (conMgr != null) {
                final NetworkInfo netInfo = conMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
                if (netInfo != null) {
                    currentNetworkSubType = netInfo.getSubtype();
                }
            }
        }
    }

    /**
     * Build the AndroidHttpClient.
     * @return A configured instance of AndroidHttpClient.
     */
    private AndroidHttpClient getHttpClient() {
        return AndroidHttpClient.newInstance(userAgent, app);
    }

    /**
     * Detects network changes and resets the network when needed.
     *
     * Note: The intent info is only for this particular change, meaning it will get sent when the phone detects changes in the wireless
     * state even though the user is actually using wifi.  In other words, don't use it; look for the current real state using the
     * manager service.
     * @param context The context of the request.
     * @param intent Not used.
=======
			// Keep reference to app
			this.app = app;
	        
	        // Registering receiver to handle network changes
	        app.registerReceiver(this, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
	        
	        // Getting connectivity manager and current network type 
	        conMgr = (ConnectivityManager) app.getSystemService(Context.CONNECTIVITY_SERVICE);
		if (conMgr != null) {
			final NetworkInfo netInfo = conMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
			if (netInfo != null) {
				currentNetworkSubType = netInfo.getSubtype();
			}
		}        
	}
	}
	
	/**
	 * Build the AndroidHttpClient.
	 * @return A configured instance of AndroidHttpClient.
	 */
	private AndroidHttpClient getHttpClient() {
		return AndroidHttpClient.newInstance(userAgent, app);
	}
	
	/**
	 * Detects network changes and resets the network when needed.
	 * 
	 * Note: The intent info is only for this particular change, meaning it will get sent when the phone detects changes in the wireless
	 * state even though the user is actually using wifi.  In other words, don't use it; look for the current real state using the
	 * manager service.
	 * @param context The context of the request.
	 * @param intent Not used.
>>>>>>> 6333f7e97efba6c33cda3fd24663421b814ad046
     */
    @Override
    public void onReceive(Context context, Intent intent) {
Solution content
            conMgr = null;
        }
        else {

            // Keep reference to app
            this.app = app;

            // Registering receiver to handle network changes
            app.registerReceiver(this, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));

            // Getting connectivity manager and current network type
            conMgr = (ConnectivityManager) app.getSystemService(Context.CONNECTIVITY_SERVICE);
            if (conMgr != null) {
                final NetworkInfo netInfo = conMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
                if (netInfo != null) {
                    currentNetworkSubType = netInfo.getSubtype();
                }
            }
        }
    }

    /**
     * Build the AndroidHttpClient.
     * @return A configured instance of AndroidHttpClient.
     */
    private AndroidHttpClient getHttpClient() {
        return AndroidHttpClient.newInstance(userAgent, app);
    }

    /**
     * Detects network changes and resets the network when needed.
     *
     * Note: The intent info is only for this particular change, meaning it will get sent when the phone detects changes in the wireless
     * state even though the user is actually using wifi.  In other words, don't use it; look for the current real state using the
     * manager service.
     * @param context The context of the request.
     * @param intent Not used.
>>>>>>> .merge_file_LJHOqE
     */
    @Override
    public void onReceive(Context context, Intent intent) {
File
HttpAccess.java
Developer's decision
Manual
Kind of conflict
Attribute
Cast expression
Comment
If statement
Method declaration
Method invocation