DO NOT MERGE UsbManager: squashed commit of:
USB: Add functions for querying if a USB function is supported and enabled. Rename android.hardware.Usb to UsbManager and UsbObserver to UsbService Change-Id: I920a211934d993eab8ce744c1cc7b05342389286 Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
@@ -38,7 +38,7 @@ import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.content.res.Resources;
|
||||
import android.database.ContentObserver;
|
||||
import android.hardware.Usb;
|
||||
import android.hardware.UsbManager;
|
||||
import android.media.AudioManager;
|
||||
import android.net.Uri;
|
||||
import android.os.BatteryManager;
|
||||
@@ -352,13 +352,13 @@ public class NotificationManagerService extends INotificationManager.Stub
|
||||
mBatteryFull = batteryFull;
|
||||
updateLights();
|
||||
}
|
||||
} else if (action.equals(Usb.ACTION_USB_STATE)) {
|
||||
} else if (action.equals(UsbManager.ACTION_USB_STATE)) {
|
||||
Bundle extras = intent.getExtras();
|
||||
boolean usbConnected = extras.getBoolean(Usb.USB_CONNECTED);
|
||||
boolean adbEnabled = (Usb.USB_FUNCTION_ENABLED.equals(
|
||||
extras.getString(Usb.USB_FUNCTION_ADB)));
|
||||
boolean usbConnected = extras.getBoolean(UsbManager.USB_CONNECTED);
|
||||
boolean adbEnabled = (UsbManager.USB_FUNCTION_ENABLED.equals(
|
||||
extras.getString(UsbManager.USB_FUNCTION_ADB)));
|
||||
updateAdbNotification(usbConnected && adbEnabled);
|
||||
} else if (action.equals(Usb.ACTION_USB_DISCONNECTED)) {
|
||||
} else if (action.equals(UsbManager.ACTION_USB_DISCONNECTED)) {
|
||||
updateAdbNotification(false);
|
||||
} else if (action.equals(Intent.ACTION_PACKAGE_REMOVED)
|
||||
|| action.equals(Intent.ACTION_PACKAGE_RESTARTED)
|
||||
@@ -464,7 +464,7 @@ public class NotificationManagerService extends INotificationManager.Stub
|
||||
// register for battery changed notifications
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
|
||||
filter.addAction(Usb.ACTION_USB_STATE);
|
||||
filter.addAction(UsbManager.ACTION_USB_STATE);
|
||||
filter.addAction(Intent.ACTION_SCREEN_ON);
|
||||
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
filter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
|
||||
|
||||
Reference in New Issue
Block a user