Example usage for android.os SystemProperties getInt

List of usage examples for android.os SystemProperties getInt

Introduction

In this page you can find the example usage for android.os SystemProperties getInt.

Prototype

@SystemApi
public static int getInt(@NonNull String key, int def) 

Source Link

Document

Get the value for the given key , and return as an integer.

Usage

From source file:com.android.settings.HWSettings.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    mVoiceCapable = getResources().getBoolean(com.android.internal.R.bool.config_voice_capable);
    if (getIntent().hasExtra(EXTRA_UI_OPTIONS)) {
        getWindow().setUiOptions(getIntent().getIntExtra(EXTRA_UI_OPTIONS, 0));
    }//  w w  w . j  a v a  2  s.co  m

    mAuthenticatorHelper = new AuthenticatorHelper();
    mAuthenticatorHelper.updateAuthDescriptions(this);
    mAuthenticatorHelper.onAccountsUpdated(this, null);

    mDevelopmentPreferences = getSharedPreferences(DevelopmentSettings.PREF_FILE, Context.MODE_PRIVATE);

    getMetaData();
    mInLocalHeaderSwitch = true;
    super.onCreate(savedInstanceState);

    setContentView(R.layout.settings_main);

    mInLocalHeaderSwitch = false;
    /**
    * SPRD:Optimization to erase the animation on click. @{
    */
    ListView list = getListView();
    list.setSelector(R.drawable.list_selector_holo_dark);
    /** @} */
    if (!onIsHidingHeaders() && onIsMultiPane()) {
        highlightHeader(mTopLevelHeaderId);
        // Force the title so that it doesn't get overridden by a direct launch of
        // a specific settings screen.
        setTitle(R.string.settings_label);
    }

    // Retrieve any saved state
    if (savedInstanceState != null) {
        mCurrentHeader = savedInstanceState.getParcelable(SAVE_KEY_CURRENT_HEADER);
        mParentHeader = savedInstanceState.getParcelable(SAVE_KEY_PARENT_HEADER);
        if (HW_SETTINGS) { //wangkaifeng tab settings 
            curTabIndex = savedInstanceState.getInt(SAVE_KEY_CURRENT_TAB);
        }
    }

    // If the current header was saved, switch to it
    if (savedInstanceState != null && mCurrentHeader != null) {
        //switchToHeaderLocal(mCurrentHeader);
        showBreadCrumbs(mCurrentHeader.title, null);
    }

    if (mParentHeader != null) {
        setParentTitle(mParentHeader.title, null, new OnClickListener() {
            @Override
            public void onClick(View v) {
                switchToParent(mParentHeader.fragment);
            }
        });
    }

    // Override up navigation for multi-pane, since we handle it in the fragment breadcrumbs
    if (onIsMultiPane()) {
        getActionBar().setDisplayHomeAsUpEnabled(false);
        getActionBar().setHomeButtonEnabled(false);
    }
    /* SPRD: add for tab style @{ */
    mInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    /* @} */

    /* hw settings {@ */
    if (HW_SETTINGS) { //wangkaifeng tab settings
        createFragments();
        if (this.toString().contains(".HWSettings@")) {
            mActionBar = getActionBar();
            int tabHeight = 80;//(int) getResources().getDimensionPixelSize(R.dimen.universe_ui_tab_height);
            //revo lyq             
            int TYPELCD = SystemProperties.getInt("qemu.sf.lcd_density",
                    SystemProperties.getInt("ro.sf.lcd_density", 240));
            if (TYPELCD == 160) {
                tabHeight = 52;
            }

            mActionBar.setAlternativeTabStyle(false);
            mActionBar.setTabHeight(tabHeight);
            setupGeneral(mActionBar);
            setupAll(mActionBar);
            mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
            mActionBar.setDisplayShowTitleEnabled(false);
            mActionBar.setDisplayShowHomeEnabled(false);
        }
    }
    /* @} */
    //liangbo add 20141231
    if (FeatureOption.PRJ_FEATURE_SHOW_MENU_FOR_DEVOLOPMENT_SETTINGS) {
        getSharedPreferences(DevelopmentSettings.PREF_FILE, Context.MODE_PRIVATE).edit()
                .putBoolean(DevelopmentSettings.PREF_SHOW, true).apply();
    }
}

From source file:com.android.camera.manager.ThumbnailViewManager.java

private boolean isNeedDumpYuv() {
    boolean enable = SystemProperties.getInt("debug.thumbnailFromYuv.enable", 0) == 1 ? true : false;
    Log.d(TAG, "[isNeedDumpYuv] return :" + enable);
    return enable;
}