Skip to content

Commit 8cf857d

Browse files
Added the support for injection of new system services provided by API 14.
1 parent cb6bedb commit 8cf857d

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎AndroidAnnotations/androidannotations/src/main/java/com/googlecode/androidannotations/model/AndroidSystemServices.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ public AndroidSystemServices() {
4949
registeredServices.put("android.hardware.SensorManager", "android.content.Context.SENSOR_SERVICE");
5050
registeredServices.put("android.os.storage.StorageManager", "android.content.Context.STORAGE_SERVICE");
5151
registeredServices.put("android.telephony.TelephonyManager", "android.content.Context.TELEPHONY_SERVICE");
52+
registeredServices.put("android.view.textservice.TextServicesManager", "android.content.Context.TEXT_SERVICES_MANAGER_SERVICE");
5253
registeredServices.put("android.app.UiModeManager", "android.content.Context.UI_MODE_SERVICE");
5354
registeredServices.put("android.hardware.usb.UsbManager", "android.content.Context.USB_SERVICE");
5455
registeredServices.put("android.os.Vibrator", "android.content.Context.VIBRATOR_SERVICE");
5556
registeredServices.put("android.app.WallpaperManager", "android.content.Context.WALLPAPER_SERVICE");
5657
registeredServices.put("android.net.wifi.WifiManager", "android.content.Context.WIFI_SERVICE");
58+
registeredServices.put("android.net.wifi.p2p.WifiP2pManager", "android.content.Context.WIFI_P2P_SERVICE");
5759
registeredServices.put("android.view.WindowManager", "android.content.Context.WINDOW_SERVICE");
5860
}
5961

‎AndroidAnnotations/functional-test-1-5/src/main/java/com/googlecode/androidannotations/test15/ActivityWithServices.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ public class ActivityWithServices extends Activity {
122122
//@SystemService
123123
//UsbManager usbManager;
124124

125+
// API level 14
126+
//@SystemService
127+
//TextServicesManager textServicesManager;
128+
129+
//@SystemService
130+
//WifiP2pManager wifiP2pManager;
131+
125132
// TODO Test those for > 1.5 Android versions
126133
// UiModeManager uiModeManager;
127134
// DownloadManager downloadManager;

0 commit comments

Comments
 (0)