Example usage for android.provider Settings ACTION_PRIVACY_SETTINGS

List of usage examples for android.provider Settings ACTION_PRIVACY_SETTINGS

Introduction

In this page you can find the example usage for android.provider Settings ACTION_PRIVACY_SETTINGS.

Prototype

String ACTION_PRIVACY_SETTINGS

To view the source code for android.provider Settings ACTION_PRIVACY_SETTINGS.

Click Source Link

Document

Activity Action: Show settings to allow configuration of privacy options.

Usage

From source file:com.phonegap.plugins.nativesettings.NativeSettings.java

@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
    PluginResult.Status status = PluginResult.Status.OK;
    Uri packageUri = Uri.parse("package:" + this.cordova.getActivity().getPackageName());
    String result = "";

    //Information on settings can be found here:
    //http://developer.android.com/reference/android/provider/Settings.html

    action = args.getString(0);/*from www  . j  a  va  2 s  .c  o  m*/
    Intent intent = null;

    if (action.equals("accessibility")) {
        intent = new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS);
    } else if (action.equals("account")) {
        intent = new Intent(android.provider.Settings.ACTION_ADD_ACCOUNT);
    } else if (action.equals("airplane_mode")) {
        intent = new Intent(android.provider.Settings.ACTION_AIRPLANE_MODE_SETTINGS);
    } else if (action.equals("apn")) {
        intent = new Intent(android.provider.Settings.ACTION_APN_SETTINGS);
    } else if (action.equals("application_details")) {
        intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, packageUri);
    } else if (action.equals("application_development")) {
        intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
    } else if (action.equals("application")) {
        intent = new Intent(android.provider.Settings.ACTION_APPLICATION_SETTINGS);
    }
    //else if (action.equals("battery_saver")) {
    //    intent = new Intent(android.provider.Settings.ACTION_BATTERY_SAVER_SETTINGS);
    //}
    else if (action.equals("bluetooth")) {
        intent = new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
    } else if (action.equals("captioning")) {
        intent = new Intent(android.provider.Settings.ACTION_CAPTIONING_SETTINGS);
    } else if (action.equals("cast")) {
        intent = new Intent(android.provider.Settings.ACTION_CAST_SETTINGS);
    } else if (action.equals("data_roaming")) {
        intent = new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
    } else if (action.equals("date")) {
        intent = new Intent(android.provider.Settings.ACTION_DATE_SETTINGS);
    } else if (action.equals("about")) {
        intent = new Intent(android.provider.Settings.ACTION_DEVICE_INFO_SETTINGS);
    } else if (action.equals("display")) {
        intent = new Intent(android.provider.Settings.ACTION_DISPLAY_SETTINGS);
    } else if (action.equals("dream")) {
        intent = new Intent(android.provider.Settings.ACTION_DREAM_SETTINGS);
    } else if (action.equals("home")) {
        intent = new Intent(android.provider.Settings.ACTION_HOME_SETTINGS);
    } else if (action.equals("keyboard")) {
        intent = new Intent(android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS);
    } else if (action.equals("keyboard_subtype")) {
        intent = new Intent(android.provider.Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS);
    } else if (action.equals("storage")) {
        intent = new Intent(android.provider.Settings.ACTION_INTERNAL_STORAGE_SETTINGS);
    } else if (action.equals("locale")) {
        intent = new Intent(android.provider.Settings.ACTION_LOCALE_SETTINGS);
    } else if (action.equals("location")) {
        intent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
    } else if (action.equals("manage_all_applications")) {
        intent = new Intent(android.provider.Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS);
    } else if (action.equals("manage_applications")) {
        intent = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
    } else if (action.equals("memory_card")) {
        intent = new Intent(android.provider.Settings.ACTION_MEMORY_CARD_SETTINGS);
    } else if (action.equals("network")) {
        intent = new Intent(android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS);
    } else if (action.equals("nfcsharing")) {
        intent = new Intent(android.provider.Settings.ACTION_NFCSHARING_SETTINGS);
    } else if (action.equals("nfc_payment")) {
        intent = new Intent(android.provider.Settings.ACTION_NFC_PAYMENT_SETTINGS);
    } else if (action.equals("nfc_settings")) {
        intent = new Intent(android.provider.Settings.ACTION_NFC_SETTINGS);
    }
    //else if (action.equals("notification_listner")) {
    //    intent = new Intent(android.provider.Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS);
    //}
    else if (action.equals("print")) {
        intent = new Intent(android.provider.Settings.ACTION_PRINT_SETTINGS);
    } else if (action.equals("privacy")) {
        intent = new Intent(android.provider.Settings.ACTION_PRIVACY_SETTINGS);
    } else if (action.equals("quick_launch")) {
        intent = new Intent(android.provider.Settings.ACTION_QUICK_LAUNCH_SETTINGS);
    } else if (action.equals("search")) {
        intent = new Intent(android.provider.Settings.ACTION_SEARCH_SETTINGS);
    } else if (action.equals("security")) {
        intent = new Intent(android.provider.Settings.ACTION_SECURITY_SETTINGS);
    } else if (action.equals("settings")) {
        intent = new Intent(android.provider.Settings.ACTION_SETTINGS);
    } else if (action.equals("show_regulatory_info")) {
        intent = new Intent(android.provider.Settings.ACTION_SHOW_REGULATORY_INFO);
    } else if (action.equals("sound")) {
        intent = new Intent(android.provider.Settings.ACTION_SOUND_SETTINGS);
    } else if (action.equals("store")) {
        intent = new Intent(Intent.ACTION_VIEW,
                Uri.parse("market://details?id=" + this.cordova.getActivity().getPackageName()));
    } else if (action.equals("sync")) {
        intent = new Intent(android.provider.Settings.ACTION_SYNC_SETTINGS);
    } else if (action.equals("usage")) {
        intent = new Intent(android.provider.Settings.ACTION_USAGE_ACCESS_SETTINGS);
    } else if (action.equals("user_dictionary")) {
        intent = new Intent(android.provider.Settings.ACTION_USER_DICTIONARY_SETTINGS);
    } else if (action.equals("voice_input")) {
        intent = new Intent(android.provider.Settings.ACTION_VOICE_INPUT_SETTINGS);
    } else if (action.equals("wifi_ip")) {
        intent = new Intent(android.provider.Settings.ACTION_WIFI_IP_SETTINGS);
    } else if (action.equals("wifi")) {
        intent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS);
    } else if (action.equals("wireless")) {
        intent = new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS);
    } else {
        status = PluginResult.Status.INVALID_ACTION;
        callbackContext.sendPluginResult(new PluginResult(status, result));
        return false;
    }

    if (args.length() > 1 && args.getBoolean(1)) {
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }
    this.cordova.getActivity().startActivity(intent);

    callbackContext.sendPluginResult(new PluginResult(status, result));
    return true;
}

From source file:ua.mkh.settings.full.MainActivity.java

public void onClick(View v) {
    int id = v.getId();

    if (id == R.id.ButtonWifi) {
        Intent intent = new Intent(this, ActivityWifi.class);
        startActivity(intent);// ww  w .  j av a  2  s. c  o m
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonBluetooth) {
        Intent intent1 = new Intent(this, ActivityBth.class);
        startActivity(intent1);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonSota) {
        Intent intent2 = new Intent(this, ActivitySota.class);
        startActivity(intent2);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonDisturb) {
        Intent intent11 = new Intent(this, ActivityDisturb.class);
        startActivity(intent11);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonOperator) {

        Intent settingsIntent = new Intent(this, ActivityOperator.class);
        startActivity(settingsIntent);
        overridePendingTransition(center_to_left, center_to_left2);

    }

    else if (id == R.id.ButtonZvuki) {
        Intent intent4 = new Intent(this, ActivityZvuki.class);
        startActivity(intent4);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonOboi) {
        Intent intent5 = new Intent(this, ActivityOboi.class);
        //intent5.setFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
        startActivity(intent5);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonOsnova) {
        Intent intent6 = new Intent(this, ActivityOsnova.class);
        intent6.putExtra("verintent", VerIntent);
        startActivity(intent6);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonPasscode) {
        Intent settingsIntent = new Intent(android.provider.Settings.ACTION_SECURITY_SETTINGS);
        startActivity(settingsIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    } else if (id == R.id.ButtonBattery) {
        Intent intent4 = new Intent(this, ActivityBattery.class);
        startActivity(intent4);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonPrivacy) {
        Intent settingsIntent = new Intent(android.provider.Settings.ACTION_PRIVACY_SETTINGS);
        startActivity(settingsIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ToggleButton01) {
        if (tb_am.isChecked())//means this is the request to turn ON AIRPLANE mode
        {
            if (OS > 16) {
                Intent settingsIntent = new Intent(android.provider.Settings.ACTION_AIRPLANE_MODE_SETTINGS);
                startActivity(settingsIntent);
                overridePendingTransition(center_to_left, center_to_left2);
            } else {
                Settings.System.putInt(getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 1);//Turning ON Airplane mode.
                Intent intent10 = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);//creating intent and Specifying action for AIRPLANE mode.
                intent10.putExtra("state", true);////indicate the "state" of airplane mode is changed to ON
                sendBroadcast(intent10);//Broadcasting and Intent
                //
                btn_sota.setTextColor(Color.parseColor("#808080"));
                btn_operator.setTextColor(Color.parseColor("#808080"));
                btn_gps.setTextColor(Color.parseColor("#808080"));
                btn_sota.setClickable(false);
                btn_operator.setClickable(false);
                btn_gps.setClickable(false);
            }
        } else//means this is the request to turn OFF AIRPLANE mode
        {
            if (OS > 16) {
                Intent settingsIntent = new Intent(android.provider.Settings.ACTION_AIRPLANE_MODE_SETTINGS);
                startActivity(settingsIntent);
                overridePendingTransition(center_to_left, center_to_left2);
            } else {
                Settings.System.putInt(getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0);//Turning OFF Airplane mode.
                Intent intent9 = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);//creating intent and Specifying action for AIRPLANE mode.
                intent9.putExtra("state", false);//indicate the "state" of airplane mode is changed to OFF
                sendBroadcast(intent9);//Broadcasting and Intent
                //
                btn_sota.setTextColor(Color.parseColor("#000000"));
                btn_operator.setTextColor(Color.parseColor("#000000"));
                btn_gps.setTextColor(Color.parseColor("#000000"));
                btn_sota.setClickable(true);
                btn_operator.setClickable(true);
                btn_gps.setClickable(true);
            }
        }
    }

    else if (id == R.id.ButtonGeo) {

        Intent intent8 = new Intent(this, ActivityGeo.class);
        startActivity(intent8);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonNotification) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(notifications_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonControl) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(control_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonMail) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(mail_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonNotes) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(notes_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonPhone) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(phone_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonMessages) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(messages_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonSafari) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(safari_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonMusic) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(music_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonCompass) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(compass_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonWeather) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(weather_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonGameCenter) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(gamecenter_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonMaps) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(maps_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.Button02) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(new1_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.Button03) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(new2_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.Button04) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(new3_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.Button05) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(new4_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonCloud) {
        Intent intent10 = new Intent(this, ActivityiCloud.class);
        startActivity(intent10);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonTunes) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(itunes_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.Button06) {
        Intent intent10 = new Intent(this, ActivityVPN.class);
        startActivity(intent10);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonDisplay) {
        Intent intent12 = new Intent(this, ActivityBrightness.class);
        startActivity(intent12);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonVk) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(vk_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonViber) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(viber_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonOk) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(ok_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonSkype) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(skype_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonWhatsapp) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(whatsapp_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonTwitter) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(twitter_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonFacebook) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(facebook_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }

    else if (id == R.id.ButtonInstagram) {
        Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(instagram_app);
        startActivity(LaunchIntent);
        overridePendingTransition(center_to_left, center_to_left2);
    }
}