Setting中某些項的設置:
1.Device administrators.
2.Accessibility SERVICES.
在設置Device administrators中用到的setActiveAdmin方法已經隱藏了,需要另行編繹.
public void setDevice(){
List<ResolveInfo> avail = this.getPackageManager().queryBroadcastReceivers(
new Intent(DeviceAdminReceiver.ACTION_DEVICE_ADMIN_ENABLED),
PackageManager.GET_META_DATA);
int count = avail == null ? 0 : avail.size();
for (int i=0; i<count; i++) {
ResolveInfo ri = avail.get(i);
try {
DeviceAdminInfo dpi = new DeviceAdminInfo(this, ri);
if (dpi.isVisible() || mActiveAdmins.contains(dpi.getComponent())) {
mAvailableAdmins.add(dpi);
}
} catch (XmlPullParserException e) {
Log.w(TAG, "Skipping " + ri.activityInfo, e);
} catch (IOException e) {
Log.w(TAG, "Skipping " + ri.activityInfo, e);
}
}
DevicePolicyManager devicePolicyManager = (DevicePolicyManager)getSystemService(DEVICE_POLICY_SERVICE);
for (int i = 0; i < mAvailableAdmins.size(); i++) {
ComponentName componentName = mAvailableAdmins.get(i).getComponent();
devicePolicyManager.setActiveAdmin(componentName,true);
}
}
public void SetAccessibility(){
AccessibilityManager accessibilityManager =(AccessibilityManager) getSystemService(Service.ACCESSIBILITY_SERVICE);
List<ServiceInfo> installedServices = accessibilityManager.getAccessibilityServiceList();
// Log.i("Accessibility Test","The ServiceInfo size is: "+String.valueOf(installedServices.size()));
for (int i = 0; i < installedServices.size(); i++) {
ServiceInfo serviceInfo = installedServices.get(i);
Settings.Secure.putInt(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, 1);
Settings.Secure.putString(getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, serviceInfo.packageName + "/" + serviceInfo.name);
Settings.Secure.putInt(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, 1);
}
}
分享到:
相关推荐
<br>frameworks/opt/net/ethernet/java/com/android/server/ethernet/Ethe rnetNetworkFactory.java <br>frameworks/opt/net/ethernet/java/com/android/server/ethernet/EthernetServiceImpl.java <br>frameworks/...
<item>"bt-pan"</item> </string-array> 2、去掉蓝牙: Z:\home\rediron\a33\ap6181_bb16v3_sina33\android\device\softwinner\astar-y3\astar_y3.mk # wifi features PRODUCT_COPY_FILES += \ frameworks/...
在Android中,二级菜单可以通过`<group>`标签实现,它允许我们创建分组,每个分组内可包含多个菜单项。例如: ```xml <menu> <group android:checkableBehavior="single"> <item android:id="@+id/group_item1" ...
<item>"bt-pan"</item> </string-array> 2、干掉BT(特别是rtl8723bs的): R:\wyb\rtl8188eu_sina33m_sc3817\android\device\softwinner\astar-d7\astar_d7.mk PRODUCT_PACKAGES += Launcher3 PRODUCT_...
在Android系统中,Setting应用是用户与系统设置交互的主要界面,涵盖了各种设备配置选项,如Wi-Fi、蓝牙、显示、声音、账户等。本资源提供了Android 4.0(Ice Cream Sandwich,ICS)版本的Setting模块应用层的源代码...
<item>"bt-pan"</item> </string-array> 3、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\astar_y3.mk # ap6181/6210/6330 sdio wifi fw and nvram #$(call inherit-product-if-exists, ...
全志R16的android4.4.2平台点亮gc2145(evb30) 版本:V1.1 1、配置ov2640在android层配置的分辨率为vga(预览/拍照/录像) 注意:系统自带的快拍APP就在这里查找分辨率参数发送到camera的HAL层。 这里得分辨率...
本篇文章将深入探讨如何创建一个自定义的组合控件——`SettingItem`,它通常用于显示设置项,具有标题、描述、开关等元素。这种控件在各种应用程序的设置界面中广泛使用,能够提升用户体验并简化开发流程。 首先,...
wakeup_src_wl = port:PL07<4><default><default><0> ;wakeup_src_bt = port:PL09<4><default><default><0> bb_wake_ap = port:PL02<4><default><default><0> [usbc1] usb_used = 1 usb_drv_vbus_gpio = port:PD...
<item>"bt-pan"</item> </string-array> 3、 Q:\a33\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\astar_y3.mk # ap6181/6210/6330 sdio wifi fw and nvram #$(call inherit-product-if-exists, ...
wakeup_src_bt = port:PL09<4><default><default><0> bb_wake_ap = port:PL02<4><default><default><0> ;-------------------------------------------------------------------------------- ;wifi/bt/fm/gps/...
-- See the Adobe AIR documentation for more information about setting Google Android permissions --> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name=...
本篇将详细解析"android4.2.2 setting 库文件"所包含的重要组件。 首先,我们来看一下这些库的主要组成部分: 1. **bouncycastle**: Bouncy Castle 是一个开源的Java加密库,它为Android提供了广泛的加密算法和...
- `adb shell settings put <setting_key> <value>`:修改系统设置。 - `adb reboot recovery`,`adb reboot bootloader`,`adb reboot fastboot`:重启到不同模式。 - `adb shell svc wifi <state>`,`adb shell...
Android Studio Setting,包含code style,keymap,插件等设置。一键导入,终身受用。
<item>"bt-pan"</item> </string-array> 3、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\astar_y3.mk # ap6181/6210/6330 sdio wifi fw and nvram #$(call inherit-product-if-exists, ...
<item>"bt-pan"</item> </string-array> 3、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\astar_y3.mk # ap6181/6210/6330 sdio wifi fw and nvram #$(call inherit-product-if-exists, ...
在这个例子中,我们使用了`<merge>`标签,并为`TextView`和`Button`添加了之前在`attrs.xml`中定义的自定义属性。 最后,我们需要编写Java代码来处理自定义控件的行为。首先,创建一个新的Java类继承自`View`或`...
<string name="action_settings">setting</string> <string name="hello_world">i18ntextandimage</string> <string name="ok">OK</string> <string name="cancel">Cancel</string> <string name="ignore">Ignore</...