当前位置: 首页>>代码示例>>Java>>正文


Java System类代码示例

本文整理汇总了Java中android.provider.Settings.System的典型用法代码示例。如果您正苦于以下问题:Java System类的具体用法?Java System怎么用?Java System使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


System类属于android.provider.Settings包,在下文中一共展示了System类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: launchNotificationSoundPicker

import android.provider.Settings.System; //导入依赖的package包/类
private void launchNotificationSoundPicker(int code, String currentPowerRingtonePath) {
    final Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);

    intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE,
            getString(R.string.power_notifications_ringtone_title));
    intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,
            RingtoneManager.TYPE_NOTIFICATION);
    intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
            System.DEFAULT_NOTIFICATION_URI);
    if (currentPowerRingtonePath != null &&
            !currentPowerRingtonePath.equals(POWER_NOTIFICATIONS_SILENT_URI)) {
        Uri uri = Uri.parse(currentPowerRingtonePath);
        if (uri != null) {
            intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, uri);
        }
    }
    startActivityForResult(intent, code);
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:19,代码来源:OtherSoundSettings.java

示例2: y

import android.provider.Settings.System; //导入依赖的package包/类
private static Locale y(Context context) {
    Locale locale = null;
    try {
        Configuration configuration = new Configuration();
        configuration.setToDefaults();
        System.getConfiguration(context.getContentResolver(), configuration);
        if (configuration != null) {
            locale = configuration.locale;
        }
    } catch (Exception e) {
        bv.c(a, "fail to read user config locale");
    }
    if (locale == null) {
        return Locale.getDefault();
    }
    return locale;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:bt.java

示例3: getMeizuNaviogationBarHeight

import android.provider.Settings.System; //导入依赖的package包/类
@Nullable
private static int getMeizuNaviogationBarHeight(Context context) {
    int dimensionPixelSize;
    boolean autoHideSmartBar = true;
    boolean z = false;
    boolean isMeiZu = Build.MANUFACTURER.equals("Meizu");
    if (System.getInt(context.getContentResolver(), "mz_smartbar_auto_hide", z) != 1) {
        autoHideSmartBar = z;
    }
    if (isMeiZu && !autoHideSmartBar) {
        try {
            Class c = Class.forName("com.android.internal.R$dimen");
            dimensionPixelSize = context.getResources().getDimensionPixelSize(
                    Integer.parseInt(c.getField("mz_action_button_min_height")
                            .get(c.newInstance()).toString()));
        } catch (Throwable th) {
        }
    }
    return dimensionPixelSize;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:21,代码来源:UIsUtils.java

示例4: A

import android.provider.Settings.System; //导入依赖的package包/类
private static Locale A(Context context) {
    Locale locale = null;
    try {
        Configuration configuration = new Configuration();
        configuration.setToDefaults();
        System.getConfiguration(context.getContentResolver(), configuration);
        if (configuration != null) {
            locale = configuration.locale;
        }
    } catch (Exception e) {
        bv.c(a, "fail to read user config locale");
    }
    if (locale == null) {
        return Locale.getDefault();
    }
    return locale;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:bt.java

示例5: initSeekBar

import android.provider.Settings.System; //导入依赖的package包/类
private void initSeekBar(SeekBar seekBar, Uri defaultUri) {
    seekBar.setMax(mAudioManager.getStreamMaxVolume(mStreamType));
    mOriginalStreamVolume = mAudioManager.getStreamVolume(mStreamType);
    seekBar.setProgress(mOriginalStreamVolume);
    seekBar.setOnSeekBarChangeListener(this);
    // TODO: removed in MM, find different approach
    mContext.getContentResolver().registerContentObserver(
            System.getUriFor("volume_ring"),
            false, mVolumeObserver);
    if (defaultUri == null) {
        if (mStreamType == AudioManager.STREAM_RING) {
            defaultUri = Settings.System.DEFAULT_RINGTONE_URI;
        } else if (mStreamType == AudioManager.STREAM_NOTIFICATION) {
            defaultUri = Settings.System.DEFAULT_NOTIFICATION_URI;
        } else {
            defaultUri = Settings.System.DEFAULT_ALARM_ALERT_URI;
        }
    }
    mRingtone = RingtoneManager.getRingtone(mContext, defaultUri);
    if (mRingtone != null) {
        mRingtone.setStreamType(mStreamType);
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:24,代码来源:VolumePreference.java

示例6: onCreate

import android.provider.Settings.System; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getPreferenceManager().setSharedPreferencesName(LauncherFiles.SHARED_PREFERENCES_KEY);
    addPreferencesFromResource(R.xml.launcher_preferences);

    // Setup allow rotation preference
    Preference rotationPref = findPreference(Utilities.ALLOW_ROTATION_PREFERENCE_KEY);
    if (getResources().getBoolean(R.bool.allow_rotation)) {
        // Launcher supports rotation by default. No need to show this setting.
        getPreferenceScreen().removePreference(rotationPref);
    } else {
        ContentResolver resolver = getActivity().getContentResolver();
        mRotationLockObserver = new SystemDisplayRotationLockObserver(rotationPref, resolver);

        // Register a content observer to listen for system setting changes while
        // this UI is active.
        resolver.registerContentObserver(
                Settings.System.getUriFor(System.ACCELEROMETER_ROTATION),
                false, mRotationLockObserver);

        // Initialize the UI once
        mRotationLockObserver.onChange(true);
        rotationPref.setDefaultValue(Utilities.getAllowRotationDefaultValue(getActivity()));
    }
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:27,代码来源:SettingsActivity.java

示例7: execute

import android.provider.Settings.System; //导入依赖的package包/类
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
    if ("getVolume".equals(action)) {
        triggerEvent(callbackContext, currentVolume(), false);
        return true;
    } else if ("setVolumenChangeCallback".equals(action)) {
        changedEventCallback = callbackContext;

        SettingsContentObserver observer = new SettingsContentObserver(new Handler());
        context.getContentResolver().registerContentObserver(System.CONTENT_URI, true, observer);

        return true;
    }

    return false;
}
 
开发者ID:g-w,项目名称:cordova-volume,代码行数:17,代码来源:Volume.java

示例8: toggleRadio

import android.provider.Settings.System; //导入依赖的package包/类
@SuppressLint("InlinedApi")
public void toggleRadio(){
	/* If you can change the airplane mode, turn on the airplane mode and let the user know */
	if(ChangeAirplaneMode){
		
		System.putLong(getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1);
		long isEnabled = System.getLong(getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, -1);
		Log.v(TAG, "airplane mode now is: "+isEnabled);

		Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
		intent.putExtra("state", false);
		sendBroadcast(intent);
	}
	
	Intent myIntent = new Intent(MainActivity.this, DetectedFemtoActivity.class);
       Bundle b = new Bundle();
       b.putBoolean("ChangeAirplaneMode", ChangeAirplaneMode);
       myIntent.putExtras(b); 
       startActivity(myIntent);
}
 
开发者ID:iSECPartners,项目名称:femtocatcher,代码行数:21,代码来源:MainActivity.java

示例9: getUriFor

import android.provider.Settings.System; //导入依赖的package包/类
private static Uri getUriFor(int type, String setting) {
    switch(type) {
        case TYPE_GLOBAL:
            return Global.getUriFor(setting);
        case TYPE_SYSTEM:
            return System.getUriFor(setting);
    }
    throw new IllegalArgumentException();
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:10,代码来源:SettingPref.java

示例10: putInt

import android.provider.Settings.System; //导入依赖的package包/类
protected static boolean putInt(int type, ContentResolver cr, String setting, int value) {
    switch(type) {
        case TYPE_GLOBAL:
            return Global.putInt(cr, setting, value);
        case TYPE_SYSTEM:
            return System.putInt(cr, setting, value);
    }
    throw new IllegalArgumentException();
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:10,代码来源:SettingPref.java

示例11: getInt

import android.provider.Settings.System; //导入依赖的package包/类
protected static int getInt(int type, ContentResolver cr, String setting, int def) {
    switch(type) {
        case TYPE_GLOBAL:
            return Global.getInt(cr, setting, def);
        case TYPE_SYSTEM:
            return System.getInt(cr, setting, def);
    }
    throw new IllegalArgumentException();
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:10,代码来源:SettingPref.java

示例12: onChange

import android.provider.Settings.System; //导入依赖的package包/类
@Override
public void onChange(boolean selfChange) {
    boolean enabled = Settings.System.getInt(mResolver,
            Settings.System.ACCELEROMETER_ROTATION, 1) == 1;
    mRotationPref.setEnabled(enabled);
    mRotationPref.setSummary(enabled
            ? R.string.allow_rotation_desc : R.string.allow_rotation_blocked_desc);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:9,代码来源:SettingsActivity.java

示例13: getScreenBrightness

import android.provider.Settings.System; //导入依赖的package包/类
private int getScreenBrightness() {
    int screenBrightness = 255;
    try {
        screenBrightness = System.getInt(this.mActivity.getContentResolver(), "screen_brightness");
    } catch (Exception exception) {
        exception.printStackTrace();
    }
    return screenBrightness;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:AlbumGestureController.java

示例14: BasePlayController

import android.provider.Settings.System; //导入依赖的package包/类
public BasePlayController(Context context, PlayActivityCallback playCallback) {
    if (HotFix.PREVENT_VERIFY) {
        System.out.println(VerifyLoad.class);
    }
    this.mLaunchMode = 0;
    this.mLiveBarrageSentCallback = null;
    this.currentB = 0;
    this.mContext = context;
    this.mPlayCallback = playCallback;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:BasePlayController.java

示例15: getScreenBrightness

import android.provider.Settings.System; //导入依赖的package包/类
private int getScreenBrightness() {
    int screenBrightness = 255;
    try {
        screenBrightness = System.getInt(getActivity().getContentResolver(), "screen_brightness");
    } catch (SettingNotFoundException e) {
    }
    return screenBrightness;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:9,代码来源:BasePlayController.java


注:本文中的android.provider.Settings.System类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。