Remove All Ads from XDA

[PARANOIDANDROID JB/CS] Developers only: Porting, Support and Maintanance

7,532 posts
Thanks Meter: 27,418
By molesarecoming, Inactive Recognized Developer on 18th June 2012, 02:42 PM
Post Reply Email Thread

it shouldnt be necessary to mention but well, Paranoid-Settings is meant for official paranoid android only or ports that stay true to our vision. it is not meant to be included in other roms or kangs - unless we give permission. this is our good name that people pull through the mud when they mix it with conflicting source like aokp. hybrid engine and dpi changer will only result in a crappy user experience for the end-user. Hybrid relies on a clean system and does not change its DPI, thats the whole point of it. furthermore hybrid engine is huge and complicated to kang because it grew over half a year and hundreds of commits, resets, reverts, rewrites. the only real hybrid engine is the result of a clean repo init and . devicename.
kangs and roms that dont have our permission can either write their own implementation (its really just a text file reader/writer) or adapt on the old paprefs version in the ICS branch, which is 100% opensource. hybrid engine is 100% open source aswell of course.

Some of you may have heard of tablet mode and if you have tried it you know well that it smashes your phone. Apps are small, their layout is screwed, things overlap, crash or stop working, Google Play forbids you to download, if you tried AOKP you cant even use launcher and phone. In short, it is a mess.

PARANOIDANDROID changed that. It does not "heal" tablet mode, it obliterates the boundaries. You define how big or small apps are, you define in which UI they display, no matter if your phone runs in tablet or phone mode, which also you can define. Customize every single entity on your phone, lockscreen, navigationbar, system-components, widgets, apps. If you prefer stay with your three bearpaw buttons + drop-down curtain or switch to a combined navigationbar + drop-up notificationcenter, enjoy Youtube in 3D, Gmail and settings in 2-columns, Chrome in its better mobile UI, etc. Nothing overlaps, nothing crashes, everything works as you'd expect. This is completely new ground and has never been realized before, it is lightyears from tablet mode.

We created it to establish the idea that tablet/hybrid mode can indeed work and that is was an error on Googles side to use the same layout for high resolution devices that is used on tiny little things like htc wildfire. We saw how badly build.prop tablet-mode was milked so we decided to remain closedsource until the codebase is mature enough to publish. Our first repos went public last week and the rest will follow soon, i will personally commit the hybrid sourcetree into CM9. Until then, do not ask us for sources, we have good reason to do it like this and when it's out people will know why, they will see something that works, not features for show. We are still fully open to ports. As long as they stay true to our vision and base on CM9.

As the sheer amount of porting requests needed to be addressed somehow we open this topic so maintainers can help each other and it'll be easy for us to take a look once in awhile as our pm-boxes are exploding. We understand that setting up PA can be quite confusing since it introduces must-have configurations that are unique.

the bad news is, everything has changed. the good news is, porting will be way less troublesome. (-;

look at the ICS guide for more info, this ones onna be straight forward.

1. pad.prop no more. you'll have to look in /system/etc/paranoid/properties.conf. dont forget to supply the same file twice, as backup.conf, its a sefety net for users who screw their properties.

you dont need to worry about this file anymore. rom_min/max are arbitrary values. choose something that makes sense for your device. the GUI will pick it up and load its sliders with these values.

rom default dpi is a simple fallback value, used by the GUI aswell. rom default mode is the same. notice though that modes are not hardcoded, Youre targeting the actual layout containers. the GUI can even extract them from any apk. layouts for sysUI are: 360 (phone mode), 600 (phablet mode) and 720 (tablet mode). apps can define these tresholds as they want. thats the reason you couldnt get tabUI for playmarket for instance, because its containers sits at 800dp. "tabletUI" was hardcoded to 720. so thats no problem anymore.

the rest is clear, find a couple of good values for standard apps. make sure you dont create a spotty experience. and do set tabUI for the interesting apps. i have seen PA reviews on youtube and the guy browses the phone and everythings stock ... that kinda sucks. you dont need to boot into tablet mode right away, but at least take the time to find good values for settings, gmail, etc.







well, thats it. i told you it was easy.

for those who port for legacy devices, we included a hide softscreenbuttons option in settings/system/navigationbar.

and then theres the speed dial preferences in the PA panel. thats a little bit compliated right now because the xml files that drive it are in the app itself. im not sure if you can backsmali it, it has a rom fingerprint. i need to ask jesus. one thing more, then that is resolved you will be able to create your own configurations, and those can not only contain hybrid data but ANY setting you can make in the entire android system.

example: on nexus we dont have much space in portrait mode, so the android standard of 5 notificationicons in tabletUI overlaps. so in one of those prefs i simply say: sysUI.dpi=240, that makes the systembar pretty big, sysUI.layout=720, that drops it into tabletUI, clock=0, that hides the android clock, notificationnumber=2, that limits the icons to two. i guess most of you will switch off softbuttons, and with these prefs you can do it, or even create several and let your users choose.
i know jesus has already completed the code to load user presets, i will add the information when i have it.

and dont forget this in your build.prop
oh, and do not, under any circumstance, touch build.prop dpi. system dpi runs always in default dpi.
The Following 117 Users Say Thank You to molesarecoming For This Useful Post: [ View ] Gift molesarecoming Ad-Free
18th June 2012, 02:42 PM |#2  
molesarecoming's Avatar
OP Inactive Recognized Developer
Flag Berlin
Thanks Meter: 27,418
Donate to Me
GUIDE FOR PA 1.5 and lower (ICS)
  • 1. Unlock Tablet Mode for all devices
    This has been already stuffend into the framework by us and if you use our files you wont need it, but i will include it nonetheless. Legacy devices crippled with hardware buttons need hacks to make tablet mode work. I dont know exactly whom to thank for this find, names that pop up in my head are Xylograph and evilisto. Ics compilant devices simply need one more entry in their build.prop: qemu.hw.mainkeys=1. You can include both, doesnt hurt.
    --- a/services/java/com/android/server/wm/
    +++ b/services/java/com/android/server/wm/
    @@ -5962,7 +5962,7 @@ public class WindowManagerService extends IWindowManager.S
    unrotDw = dw;
    unrotDh = dh;
    - int sw = reduceConfigWidthSize(unrotDw, Surface.ROTATION_0, density, un
    + int sw = reduceConfigWidthSize((int)(unrotDw / density), Surface.ROTATI
    sw = reduceConfigWidthSize(sw, Surface.ROTATION_90, density, unrotDh, u
    sw = reduceConfigWidthSize(sw, Surface.ROTATION_180, density, unrotDw, 
    sw = reduceConfigWidthSize(sw, Surface.ROTATION_270, density, unrotDh,
  • 2. Find out tabletmode DPI treshold value
    Tablet mode is AOSP standard functionality. ICS is will drop into tablet mode if it acknowledges a certain treshold DPI, depending on your devices screen. Changing ro.sf.lcd_density in /system/build.prop will do. You can calculate that value as follows, here's a snippet of the ICS code that decides if your UI runs in tablet mode or phone mode.
    int shortSizeDp = shortSize * DisplayMetrics.DENSITY_DEFAULT / DisplayMetrics.DENSITY_DEVICE;
    mStatusBarCanHide = shortSizeDp < 600;
    In short, you need to reach a short-side device-independend pixel number of 600. Example: Nexus has a width of 720 and a height of 1280, shortest side is 720, default density is 320. shortSizeDp = 720 * 160 / 320 = 360. lower than 600, phone mode. We need to lower the Dpi: shortSizeDp = 720 * 160 / 192 = 600. Thats it, tablet mode!
    The formula is:
    treshold_dpi = shortest-side-dp * 160  / 600
  • 3. Setting up pad.prop and build.prop
    /system/pad.prop is the file that defines how apps scale and in which UI they display. You should provide your users with a nice selection of everyday apps and define the system-apps well. Users should not be shocked when the phone boots up, what they are supposed to see is something that drops their jaws.
    For Galaxy Nexus it looks like this:
    What is important here is that you need to set it up first with device specific informations. Here's a small rundown of these values:
    %rom_tablet_base=xxx - table mode treshold dpi
    %rom_phone_base=xxx - default device dpi
    %rom_mid_base=xxx - a good middle value that works both for tabUI & phoneUI apps, for nexus its ~260
    %rom_mid_high_base=xxx - a little bit higher than middle
    %rom_framework_dpi=xxx - a good value for the lockscreen
    %rom_systemui_dpi=xxx - good value for navigationbar
    %rom_launcher_dpi=xxx - default value for trebuchet
    %system_default_dpi=0 - sets the global density for system apps. 0 means undefined. We will probably make it obsolete soon.
    %user_default_dpi=xxx - sets the global density for non-system apps, set it to default dpi as this will guarantee that all of your users apps will look stock
    %user_default_mode=1 - sets the global UI for non-system apps. 1 = phoneUI, 2 = tablet UI. set it to 1, all user apps will display in mobileUI. If the user has tablet ready apps he can switch himself in the settings panel
    ## P.A.L PARAMETERS - these are extremely important. you get them by logging the output of Configuration in tablet mode (_opposite) and phonemode (_default) kevdliu wrote a nice little helper to make it easier for you, look here

    make dead sure you get pad.prop right or you'll get bootloops or crashes!
    notice that we use packagenames for apps, if you dont know the name of an app open up your shell and type:
    adb shell
    pm list packages -f
    android - framework-res, applies to lockscreen, dialogs, powermenu, toasts
    systemUI - applies to the navigationbar, makes it bigger or smaller. DO NOT APPLY an UI to these two apps. everything else is fine, set it to tablet or phoneUI all you want, but not these two!
    Configuration in phone mode and tablet mode

    build.prop needs to be configures like this:
    density to tablet treshold. versions to PA and version in that exact format because internal functions are relying on it (OTA for example). change the name of your device and the date. the last numbers, i have no idea what they are, came from the buildscript.
  • 4. Check our sourcetrees
    More and more source will be published soon. Right now we have three projects out, OTA, Backup and Trebuchet (optimized for tabletmode with cool features). Hybrid code will come out soon. Use what you can get from there:

  • 5. Port the rom
    You are ready to go. Do what you always do when porting roms. I have zero experience with that. Again, use CM9. Do not even think about using AOKP.
    Check out Xylopgraph's PA porting guide

  • 6. Link to our Google Apps
    Google policy forbids you to use their market if you change your DPI. The only values allowed are 160, 240, 320. Why? No one knows why. There have been workaroundw, wiping cache, using a valid DPI, open market, reboot back, blablabla, forget it, its rubbish. It will work for a minute and then it will cease to. In our package Phonesky and GoogleServicesFramework were hacked. It has other additions aswell:

  • 7. Post your port link and help out others
    We will include you in our webpage and when our repo's are open you are invited to compile from source and/or submit patches and additions. We might even work together as theres still much to do. Be sure to help out others here.
The Following 49 Users Say Thank You to molesarecoming For This Useful Post: [ View ] Gift molesarecoming Ad-Free
18th June 2012, 02:42 PM |#3  
molesarecoming's Avatar
OP Inactive Recognized Developer
Flag Berlin
Thanks Meter: 27,418
Donate to Me
The Following 13 Users Say Thank You to molesarecoming For This Useful Post: [ View ] Gift molesarecoming Ad-Free
18th June 2012, 03:38 PM |#4  
Note2Frat's Avatar
Senior Member
Thanks Meter: 839
Thanks Moles, this will continue to help us on the Vivow Port till we can build from source.

The Following User Says Thank You to Note2Frat For This Useful Post: [ View ] Gift Note2Frat Ad-Free
18th June 2012, 03:40 PM |#5  
JokerAce's Avatar
Senior Member
Flag Teleporting..
Thanks Meter: 719
Donate to Me
Thanks for this innovation. Salute!
The Following 3 Users Say Thank You to JokerAce For This Useful Post: [ View ] Gift JokerAce Ad-Free
18th June 2012, 03:57 PM |#6  
DAGr8's Avatar
Inactive Recognized Developer
Thanks Meter: 6,376
Donate to Me
I just thanked all post ,if yo had one more I woudl have thanked it to ,

in other words , thanks !
The Following User Says Thank You to DAGr8 For This Useful Post: [ View ] Gift DAGr8 Ad-Free
18th June 2012, 04:03 PM |#7  
flappjaxxx's Avatar
Senior Member
Flag Somewhere, FL
Thanks Meter: 11,434
Awesome! Thanks for this awesome contribution!
The Following User Says Thank You to flappjaxxx For This Useful Post: [ View ] Gift flappjaxxx Ad-Free
18th June 2012, 04:20 PM |#8  
T-Macgnolia's Avatar
Senior Member
Flag Shannon, Ms.
Thanks Meter: 2,011
Donate to Me
Thanks for opening up this thread, I actually have a question for you professionals. I have been trying to figure out how to enable audio during the boot animation. I have been searching like crazy to figure it out. I have tried adding the following to /system/customize/CID/default.xml. And also ading a android_audio.mp3 to /data/local.

I have also tried placing the android_audio.mp3 and the bootanimation in /system/media but no love.

My buddy GROGG88 even made a zip file for me to flash that added some files to /system/bin but still no luck. Here is the zip if you would like to take a look at it.

I plan on making some more bootanimations for the Paranoid Android ROM for the Sensation and would really like to be able to include audio with them. Any assistance you can give will be very much appreciated.
The Following 2 Users Say Thank You to T-Macgnolia For This Useful Post: [ View ] Gift T-Macgnolia Ad-Free
18th June 2012, 09:41 PM |#9  
Senior Member
Flag Buffalo, NY
Thanks Meter: 285
What files does ParanoidOTA depend on, (/system/framework or others)? I get it copied over, but it crashes on me when I try to open it.
18th June 2012, 10:28 PM |#10  
Inactive Recognized Developer
Flag Medellín
Thanks Meter: 16,015
Donate to Me
Originally Posted by sgtkwol

What files does ParanoidOTA depend on, (/system/framework or others)? I get it copied over, but it crashes on me when I try to open it.

Only settings are used (but settings depends on OTA not OTA on settings), you must be sure the right intent is sent via Settings > About > Check for updates. Also we need first to setup environment if some device is gonna add OTA.
The Following 2 Users Say Thank You to D4rKn3sSyS For This Useful Post: [ View ] Gift D4rKn3sSyS Ad-Free
18th June 2012, 10:44 PM |#11  
Senior Member
Flag Buffalo, NY
Thanks Meter: 285
Originally Posted by D4rKn3sSyS

Only settings are used (but settings depends on OTA not OTA on settings), you must be sure the right intent is sent via Settings > About > Check for updates. Also we need first to setup environment if some device is gonna add OTA.

I'm porting from Crespo4g to Epic4g which are very similar devices.

Paranoid OTA and Paranoid Settings showing in Settings.apk I pulled from Crespo4g must be different, then. Not seeing a ParanoidSettings.apk, am I missing something? I have "Paranoid Settings" showing, but clicking it or "System" crash Settings.apk that I pulled from Crespo. No Paranoid Settings when I compile from source. Unable to local pad or pal within existing builds, either.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes