[Sony Xperia M2] Dutch Burdock:
AOSP 5.0.2 Barebones for D2303

Hi all.

This is my first run of compiling a barebones AOSP 5.0.2 for our D2303's. I got sick of all the failed ports and wanted to make my own from scratch. Here you have my first launch. You can not get as barebones as this. This ROM was made using the guides on Sony Developer website and should be the same result if anybody else follows the same steps.

I have made ZERO modifications to this ROM. I have changed no code, made no patches or even themed it with a custom name. This ROM is as-is if you built it following the same guides on Sony's site. I just saved you the time.

**This ROM works!**

Data / Calls / SMS / NFC / Bluetooth / GPS/GloNAS / Wifi all work!

Camera does not. It might, but I broke mine and doesn't even work after stock restore!

No lag!

Clean, basic, no-frills, xPosed ready!

Unlock your bootloader!

Be running either a modem from a 4.4.2 ROM or a 4.3 ROM!

This ROM is provided as-is. The sources are freely availble following Sony's guides. You use it purely at you own risk!

Let's clear some confusion with this device, which I am shocked top developers have missed!

* You **have* to be running either 4.3 or 4.4.2 MODEM! If you are running a 4.4.4 ROM, use Flashtool to drop back to 4.4.2 or 4.3 first

* You will not be able to boot ANY 5.x ROM with a 4.4.4 modem, it **HAS** to be 4.4.2 or 4.3 MODEM!

There are guides on how to revert back on this forum and I will not detail that here. But in essence, it is only the modem you need to revert back.

This ROM I would say is usable.

* Camera doesn't work on mine, but I broke it to the point it wont work in stock ROM

* Calls / SMS / Data / Wifi / GPS / NFC / Bluetooth all appear to work as they should

* Sensors appear to all be working as they should (at least compass and light)

* No lag or FCs

This is a totally unmodified ROM using the AOSP & Sony sources provided in Sony guides. I did not develop or make any of the code or scripts. I simply compiled it, flashed it and now using it. All credit to the software that made this ROM goes to all those involved in making, patching and taking the time to make this work.

I do not want any donations. If you wish to donate, donate to FXP/CM12/Omni/PAC/TWRP and the persons that created what I have simply bundled here.

Download via magnet/bittorrent only for now. For trackers, please use OBT trackers. Issue with previous download! I somehow crossed an .img from another project as the boot.img for this. I have recitified this issue and the correct boot.img has been added. Apologies for this & thankyou to all whom spotted it.

Magnet Link

magnet:?xt=urn:btih:44d710f71b92adb9e64475994b5ab905d665af7d&dn=AOSP-5.0.2-D2303.tgz&tr=udp%3A%2F%2Fopen.demonii.com%3A1337

Mega Link

https://mega.co.nz/#!HZUUCCJS!AgjmKr4Nx4NMWPKxVXIGfp72m9JyMMlsF0pvzuGBrg8

Sorry for the bad link effort, since I am new to contributions I'm stuck until I make the relevant posts.

I have no idea if this will work on any of the variants of this device. You are welcome to try, but don't blame me if you break it. This ROM comes as is, is provided under the same licenses as AOSP and Sony Development.

Tricks & Tips:

* Download the .zip for Omni ROM 4.4.4 for our D2303's. Extract the boot.img and keep it safe. This boot.img holds a reliable TWRP which we can use to ''fastboot boot'' instead of flash and even make a reliable backup of a stock ROM. When you put device into fastboot/bootloader (hold power up when plug in data ready cable), execute ''fastboot boot boot.img'' which will boot that kernel w/o modifiying anything. Now keep hitting volume down when you see Sony logo. TWRP should load!

* Use this for all your backing up, flashing zips, ROMs etc. Do NOT flash it. Just fastboot boot it instead. This can even be used AFTER we install Lollipop for the same reasons.

* Flashing this ROM requires you to use the above TWRP to wipe all partitions, System, Data, Cache etc. It's best to start afresh (I actually wiped everything except since I wanted a totally clean slate, wiping external storage isn't necessary but wiping internal is recommended.)

* Extract the tarball with the .img files

* Put the device into fastboot mode again!

* execute the following commands:

* fastboot flash boot boot.img

* fastboot flash system system.img

* fastboot flash userdata userdata.img

Make sure all processes complete successfully!

Unplug cable, wait a second or two and power up your device! (I prefer this to fastboot reboot as the data cable can hang the device in a weird, red led stays on mode that has bootlooped me a few times).

Give it a while to boot. Whalla, Lollipop!

If you want gapps, using the fastboot boot method above with our Omni 4.4.4 boot.img and TWRP.. Download CM's gapps for Lollipop and flash/install it. This does not lag the device. However, you will get a black screen for a while after first boot of installing any system/ZIP flashable (it wont show updating apps, just blank screen). BE PATIENT! The same applies if you do anything that triggers that "Updating App X of X.." Android is updating effort.

xPosed requires you to follow the instructions for flashing the ZIP then installing APK. Use the same method above for installing the ZIP.

To get root, just download the latest SuperSU-2.x.zip and flash the same way as above.

**Issues**

* With a 4.3 Modem, the Bluetooth is slow coming to life. Take about 5 mins when turned on from off. 4.4.2 modem doesn't seem to have this issue

* Location services will forget a change to Accurate on a 4.3 Modem. On 4.4.2 Modem doesn't seem to do this.

* My loudspeaker during calls is tempremental, sometimes it works sometimes it doesn't.

* Some OTG devices work, some dont. I had one or two pendrives that did, some that didn't & a 3G modem (with PPP widget's help) that did & another that didn't!

* Screencasting initially didn't work. Enabling Developer Mode and disable HDCP checks seemed to allow some functionality for me.

* Data icon always said 3G for me, even when on HSPA(+) - I use OSM which showed varying network types. GPRS/EDGE shows as 2G. I do not know for 4G as my carrier isn't 4G enabled yet.

* No hardware accelleration (using VLC & MX Player as guides) for video playback, however it can playback a 1080 MKV over wifi no problem.

* Same applies to screen-recording software. I can't seem to get native Lollipop one to work at all, but SCR Free works.

* 3D Performance is a little smoother than in stock ROM (IMPO playing Ingress).

* GravityBox for Lollipop works. However!! On some instances it can cause a softboot on a boot up (when it goes for PIN entry). For me it comes back after they next cycle. Not pinned it down to what in GB doing it though.

* Compass, proximity & light sensors all work. There is some screen flicker once so often when using dynamic brightness.

* No way to force use of 5Ghz or 2.4Ghz wifi (or leave it to select auto) as there is in stock ROM.

* Battery life when using the device as I do is as the same as stock, the device is however faster in general. I can sit it for 29 hours idling, providing not too many calls. The powersaving modes built-in can extend on this but I haven't properly tested.

I only mention these as some people may care to know. If the camera worked, I would actually be totally happy with this ROM minus it's few pitfalls.

MD5's for the paranoid:

2c053445ab096e813afc2a02079aba85 boot.img

af636c1558e8d6651f211dbd2042443f system.img

adbb0b8d0b5eee98186a71a00d8352a4 userdata.img