本文整理汇总了Java中android.os.SystemProperties类的典型用法代码示例。如果您正苦于以下问题:Java SystemProperties类的具体用法?Java SystemProperties怎么用?Java SystemProperties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SystemProperties类属于android.os包,在下文中一共展示了SystemProperties类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: openMiuiPermissionActivity
import android.os.SystemProperties; //导入依赖的package包/类
/**
* 打开MIUI权限管理界面(MIUI v5, v6)
* @param context
*/
public static void openMiuiPermissionActivity(Context context) {
Intent intent = new Intent("miui.intent.action.APP_PERM_EDITOR");
String rom = SystemProperties.get("ro.miui.ui.version.name", "unkonw");
if ("V5".equals(rom)) {
openAppDetailActivity(context, context.getPackageName());
} else if ("V6".equals(rom)) {
intent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.AppPermissionsEditorActivity");
intent.putExtra("extra_pkgname", context.getPackageName());
}
if (isIntentAvailable(context, intent)) {
if (context instanceof Activity) {
Activity a = (Activity) context;
a.startActivityForResult(intent, 2);
}
} else {
}
}
开发者ID:androidertc,项目名称:iLocker,代码行数:25,代码来源:MIUIHelper.java
示例2: getProductName
import android.os.SystemProperties; //导入依赖的package包/类
public static String getProductName() {
if (!TextUtils.isEmpty(sProductName)) {
return sProductName;
}
try {
sProductName = SystemProperties.get(PROPERTY_PRODUCT_NAME, "");
if (TextUtils.isEmpty(sProductName)) {
sProductName = SystemProperties.get("persist.product.letv.name", "");
}
} catch (Exception e) {
} catch (Error e2) {
}
if (TextUtils.isEmpty(sProductName)) {
if (Build.MODEL.toUpperCase().contains(Build.BRAND.toUpperCase())) {
sProductName = Build.MODEL;
} else {
sProductName = Build.BRAND + " " + Build.MODEL;
}
} else if (isLetv()) {
sProductName = "LETV " + sProductName;
}
sProductName = sProductName.toUpperCase();
return sProductName;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:25,代码来源:ProductUtils.java
示例3: stopAdbIfNeededSync
import android.os.SystemProperties; //导入依赖的package包/类
private void stopAdbIfNeededSync() {
if ("1".equals(SystemProperties.get("service.adb.brevent.close", ""))) {
boolean connected = checkPort();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
SimpleSu.su("pbd=`pidof brevent_daemon`; " +
"pbs=`pidof brevent_server`; " +
"pin=`pidof installd`; " +
"echo $pbd > /acct/uid_0/pid_$pin/tasks; " +
"echo $pbd > /acct/uid_0/pid_$pin/cgroup.procs; " +
"echo $pbs > /acct/uid_0/pid_$pin/tasks; " +
"echo $pbs > /acct/uid_0/pid_$pin/cgroup.procs");
}
String command = needStop ? "setprop ctl.stop adbd" : "setprop ctl.restart adbd";
SimpleSu.su("setprop service.adb.tcp.port -1; " +
"setprop service.adb.brevent.close 0; " + command);
BreventIntentService.sleep(1);
if (connected && !checkPort()) {
setRootAdb(false);
}
}
}
开发者ID:brevent,项目名称:Brevent,代码行数:22,代码来源:BreventApplication.java
示例4: onClick
import android.os.SystemProperties; //导入依赖的package包/类
@Override
public void onClick(View v) {
boolean isChecked = !v.isSelected();
switch (v.getId()) {
case R.id.poweron_recording_switch:
SystemProperties.set(Settings.KEY_POWERON_RECORD, isChecked ? "1" : "0");
break;
case R.id.watermark_switch:
mRecServ.setWatermarkEnable(isChecked);
Settings.set(Settings.KEY_WATERMARK_ENABLE, isChecked ? 1 : 0);
break;
case R.id.flip_switcher:
break;
}
v.setSelected(isChecked);
}
开发者ID:rockcarry,项目名称:CameraDVR,代码行数:17,代码来源:SettingsDialog.java
示例5: onDestroy
import android.os.SystemProperties; //导入依赖的package包/类
@Override
public void onDestroy() {
Log.d(TAG, "onDestroy");
// unbind record service
unbindService(mRecServiceConn);
// stop record service
Intent i = new Intent(CameraActivity.this, RecordService.class);
stopService(i);
// remove all messages
mHandler.removeMessages(0);
SystemProperties.set("sys.dvr.run.state", "0");
super.onDestroy();
}
开发者ID:rockcarry,项目名称:CameraDVR,代码行数:19,代码来源:CameraActivity.java
示例6: onResume
import android.os.SystemProperties; //导入依赖的package包/类
@Override
public void onResume() {
super.onResume();
updateButtonsState();
updateImpactLockView();
if (mRecServ != null) {
mRecServ.onResume();
}
showUIControls(true );
showUIControls(false);
SystemProperties.set("sys.dvr.run.state", "3");
}
开发者ID:rockcarry,项目名称:CameraDVR,代码行数:17,代码来源:CameraActivity.java
示例7: publishFirmwareBuildDate
import android.os.SystemProperties; //导入依赖的package包/类
private void publishFirmwareBuildDate() {
String buildDate;
JSONObject result = new JSONObject();
buildDate = SystemProperties.get(BUILD_DATE_UTC_PROPERTY);
try {
result.put("buildDate", buildDate);
CommonUtils.sendBroadcast(context, Constants.Operation.GET_FIRMWARE_BUILD_DATE, Constants.Code.SUCCESS, Constants.Status.SUCCESSFUL,
result.toString());
} catch (JSONException e) {
String error = "Failed to create JSON object when publishing OTA progress.";
Log.e(TAG, error, e);
CommonUtils.sendBroadcast(context, Constants.Operation.GET_FIRMWARE_BUILD_DATE, Constants.Code.FAILURE, Constants.Status.INTERNAL_ERROR,
String.valueOf(DEFAULT_STATE_INFO_CODE));
}
}
开发者ID:wso2-attic,项目名称:product-emm,代码行数:17,代码来源:EMMSystemService.java
示例8: compareLocalVersionToServer
import android.os.SystemProperties; //导入依赖的package包/类
/**
* Compares device firmware version with the latest upgrade file from the server.
*
* @return - Returns true if the firmware needs to be upgraded.
*/
public boolean compareLocalVersionToServer(BuildPropParser parser) {
if (parser == null) {
Log.d(TAG, "compareLocalVersion Without fetch remote prop list.");
return false;
}
Long buildTime = Long.parseLong(SystemProperties.get(BUILD_DATE_UTC_PROPERTY));
String buildTimeUTC = parser.getProp(BUILD_DATE_UTC_PROPERTY);
Long remoteBuildUTC;
if ((buildTimeUTC != null) && (!(buildTimeUTC.equals("null")))) {
remoteBuildUTC = Long.parseLong(buildTimeUTC);
} else {
remoteBuildUTC = Long.MIN_VALUE;
Log.e(TAG, "UTC date not found in config file, config may be corrupted or missing");
}
Log.d(TAG, "Local Version:" + Build.VERSION.INCREMENTAL + " Server Version:" + parser.getNumRelease());
boolean upgrade = remoteBuildUTC > buildTime;
Log.d(TAG, "Remote build time : " + remoteBuildUTC + " Local build time : " + buildTime);
return upgrade;
}
开发者ID:wso2-attic,项目名称:product-emm,代码行数:27,代码来源:OTAServerManager.java
示例9: createBaseContextForActivity
import android.os.SystemProperties; //导入依赖的package包/类
private Context createBaseContextForActivity(ActivityClientRecord r,
final Activity activity) {
ContextImpl appContext = new ContextImpl();
appContext.init(r.packageInfo, r.token, this);
appContext.setOuterContext(activity);
// For debugging purposes, if the activity's package name contains the value of
// the "debug.use-second-display" system property as a substring, then show
// its content on a secondary display if there is one.
Context baseContext = appContext;
String pkgName = SystemProperties.get("debug.second-display.pkg");
if (pkgName != null && !pkgName.isEmpty()
&& r.packageInfo.mPackageName.contains(pkgName)) {
DisplayManagerGlobal dm = DisplayManagerGlobal.getInstance();
for (int displayId : dm.getDisplayIds()) {
if (displayId != Display.DEFAULT_DISPLAY) {
Display display = dm.getRealDisplay(displayId, r.token);
baseContext = appContext.createDisplayContext(display);
break;
}
}
}
return baseContext;
}
开发者ID:cuplv,项目名称:droidel,代码行数:25,代码来源:ActivityThread.java
示例10: dispatchKeyEvent
import android.os.SystemProperties; //导入依赖的package包/类
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_HOME:
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (SystemProperties.getInt("debug.launcher2.dumpstate", 0) != 0) {
dumpState();
return true;
}
break;
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_HOME:
return true;
}
}
return super.dispatchKeyEvent(event);
}
开发者ID:pengqinping,项目名称:androidProject,代码行数:23,代码来源:Launcher.java
示例11: performStart
import android.os.SystemProperties; //导入依赖的package包/类
final void performStart() {
mActivityTransitionState.setEnterActivityOptions(this, getActivityOptions());
mFragments.noteStateNotSaved();
mCalled = false;
mFragments.execPendingActions();
mInstrumentation.callActivityOnStart(this);
if (!mCalled) {
throw new SuperNotCalledException(
"Activity " + mComponent.toShortString() +
" did not call through to super.onStart()");
}
mFragments.dispatchStart();
mFragments.reportLoaderStart();
// This property is set for all builds except final release
boolean isDlwarningEnabled = SystemProperties.getInt("ro.bionic.ld.warning", 0) == 1;
boolean isAppDebuggable =
(mApplication.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
if (isAppDebuggable || isDlwarningEnabled) {
String dlwarning = getDlWarning();
if (dlwarning != null) {
String appName = getApplicationInfo().loadLabel(getPackageManager())
.toString();
String warning = "Detected problems with app native libraries\n" +
"(please consult log for detail):\n" + dlwarning;
if (isAppDebuggable) {
new AlertDialog.Builder(this).
setTitle(appName).
setMessage(warning).
setPositiveButton(android.R.string.ok, null).
setCancelable(false).
show();
} else {
Toast.makeText(this, appName + "\n" + warning, Toast.LENGTH_LONG).show();
}
}
}
mActivityTransitionState.enterReady(this);
}
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:42,代码来源:a.java
示例12: getProductVariant
import android.os.SystemProperties; //导入依赖的package包/类
public static String getProductVariant() {
String result = "";
try {
result = SystemProperties.get(PROPERTY_PRODUCT_VARIANT, null).toUpperCase();
} catch (Exception e) {
} catch (Error e2) {
}
return result;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:ProductUtils.java
示例13: isYunOS
import android.os.SystemProperties; //导入依赖的package包/类
public static boolean isYunOS() {
String hw = "";
try {
hw = SystemProperties.get("ro.yunos.hardware", null).toLowerCase();
} catch (Exception e) {
} catch (Error e2) {
}
return !TextUtils.isEmpty(hw) && hw.equals("yunos");
}
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:ProductUtils.java
示例14: getLetvRomVersion
import android.os.SystemProperties; //导入依赖的package包/类
public static String getLetvRomVersion() {
return SystemProperties.get(PROPERTY_RELEASE_VERSION, "");
}
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:DeviceUtils.java
示例15: getAdbPort
import android.os.SystemProperties; //导入依赖的package包/类
public static int getAdbPort() {
// XXX: SystemProperties.get is @hide method
String port = SystemProperties.get("service.adb.tcp.port", "");
UILog.i("service.adb.tcp.port: " + port);
if (!TextUtils.isEmpty(port) && TextUtils.isDigitsOnly(port)) {
int p = Integer.parseInt(port);
if (p > 0 && p <= 0xffff) {
return p;
}
}
return -1;
}
开发者ID:brevent,项目名称:Brevent,代码行数:13,代码来源:AdbPortUtils.java
示例16: isAdbRunning
import android.os.SystemProperties; //导入依赖的package包/类
static boolean isAdbRunning() {
return "running".equals(SystemProperties.get("init.svc.adbd", Build.UNKNOWN));
}
开发者ID:brevent,项目名称:Brevent,代码行数:4,代码来源:AppsDisabledFragment.java
示例17: isMIUI
import android.os.SystemProperties; //导入依赖的package包/类
public static boolean isMIUI() {
return !SystemProperties.get("ro.miui.ui.version.name", "").equals("");
}
开发者ID:AdBlocker-Reborn,项目名称:AdBlocker_Reborn,代码行数:4,代码来源:PreferencesHelper.java
示例18: getActualState
import android.os.SystemProperties; //导入依赖的package包/类
@Override
public int getActualState(Context context) {
try {
return working ? STATE_INTERMEDIATE :
("5555".equals(SystemProperties.get("service.adb.tcp.port")) ? STATE_ENABLED : STATE_DISABLED);
} catch (Throwable e) {
Debug.log(e);
return STATE_DISABLED;
}
}
开发者ID:sunnygoyal,项目名称:PowerToggles,代码行数:11,代码来源:AdbWirelessTracker.java
示例19: onPause
import android.os.SystemProperties; //导入依赖的package包/类
@Override
public void onPause() {
super.onPause();
if (mRecServ != null) {
mRecServ.onPause();
}
SystemProperties.set("sys.dvr.run.state", "2");
}
开发者ID:rockcarry,项目名称:CameraDVR,代码行数:10,代码来源:CameraActivity.java
示例20: getDeviceDensity
import android.os.SystemProperties; //导入依赖的package包/类
private static int getDeviceDensity() {
// qemu.sf.lcd_density can be used to override ro.sf.lcd_density
// when running in the emulator, allowing for dynamic configurations.
// The reason for this is that ro.sf.lcd_density is write-once and is
// set by the init process when it parses build.prop before anything else.
return SystemProperties.getInt("qemu.sf.lcd_density",
SystemProperties.getInt("ro.sf.lcd_density", DENSITY_DEFAULT));
}
开发者ID:Gracker,项目名称:Android-Framework-Tools-Utils,代码行数:9,代码来源:DisplayMetrics.java
注:本文中的android.os.SystemProperties类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论