添加系统属性,通过监听插拔广播判断当前有无OTG U盘插入
--- a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -246,6 +246,7 @@ import java.security.InvalidAlgorithmParameterException;import java.security.NoSuchAlgorithmException;import java.security.NoSuchProviderException;import java.security.KeyPairGenerator;
+import android.hardware.usb.UsbManager; //yim add/**/*** WindowManagerPolicy implementation for the Android phone UI. This
@@ -2115,6 +2116,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
+ filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);//yim add
+ filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);//yim addfilter.addAction(Intent.ACTION_DOCK_EVENT);Intent intent = contex