Android Context Check hasAsymmericMasterSecret(Context context)

Here you can find the source of hasAsymmericMasterSecret(Context context)

Description

has Asymmeric Master Secret

License

Open Source License

Declaration

public static boolean hasAsymmericMasterSecret(Context context) 

Method Source Code

//package com.java2s;
/** /*from w  w w.  j  a  va2 s  .  co  m*/
 * Copyright (C) 2011 Whisper Systems
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import android.content.Context;
import android.content.SharedPreferences;

public class Main {
    public static final String PREFERENCES_NAME = "SecureSMS-Preferences";
    public static final String ASYMMETRIC_LOCAL_PUBLIC = "asymmetric_master_secret_public";

    public static boolean hasAsymmericMasterSecret(Context context) {
        SharedPreferences settings = context.getSharedPreferences(
                PREFERENCES_NAME, 0);
        return settings.contains(ASYMMETRIC_LOCAL_PUBLIC);
    }
}

Related

  1. hasConnection(Context c)
  2. hasInternetConnection(Context context)
  3. hasInternetConnectivity(Context applicationContext)
  4. hasNotificationPermission(Context context)