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

Search This thread

molesarecoming

Inactive Recognized Developer
Feb 12, 2012
7,532
27,173
Berlin
untitled1cfkvi.png




disclaimer:
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 . rom-build.sh 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. :cool:




paranoid_notab.png

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.



GUIDE FOR PORTING PA 1.6 and higher (JELLYBEAN/CM10)
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.

Code:
###################
# PARANOIDANDROID #
###################

## CONFIGURATION
%rom_dpi_min=160
%rom_dpi_max=320
%rom_default_dpi=320
%rom_default_layout=360

## CONFIGURATION
%hybrid_mode=1
%system_default_layout=0
%user_default_layout=0
%system_default_dpi=0
%user_default_dpi=0

## WORKSPACE PREFERENCES
android.dpi=0
android.layout=0
com.android.systemui.dpi=%rom_default_dpi
com.android.systemui.layout=%rom_default_layout

## SYSTEM PREFERENCES
com.paranoid.preferences.dpi=270
com.android.chrome.dpi=%rom_default_dpi
com.android.chrome.layout=%rom_default_layout
com.android.contacts.dpi=%rom_default_dpi
com.android.contacts.layout=%rom_default_layout
com.android.settings.dpi=245
com.android.settings.layout=720
com.android.calendar.dpi=260
com.android.browser.dpi=260
com.android.browser.layout=600
com.android.calculator2.dpi=160
com.android.calculator2.layout=600
com.android.email.dpi=230
com.android.email.layout=600
com.android.vending.dpi=220
com.android.vending.layout=1000
com.google.android.gm.dpi=250
com.google.android.gm.layout=600
com.google.android.talk.dpi=260
com.google.android.talk.layout=360
com.google.android.youtube.dpi=240
com.google.android.youtube.layout=800
com.google.android.apps.docs.dpi=240
com.google.android.apps.docs.layout=600

## USER PREFERENCES



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
Code:
ro.cm.version=PARANOIDANDROID
ro.modversion=PARANOIDANDROID
ro.pa.version=PARANOIDANDROID-pa_YOURDEVICE-1.XXa-DDMMMYYYY

oh, and do not, under any circumstance, touch build.prop dpi. system dpi runs always in default dpi.
 
Last edited:

molesarecoming

Inactive Recognized Developer
Feb 12, 2012
7,532
27,173
Berlin
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.
    Code:
    --- a/services/java/com/android/server/wm/WindowManagerService.java
    +++ b/services/java/com/android/server/wm/WindowManagerService.java
    @@ -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,
    build.prop
    Code:
    ###################
    # PARANOIDANDROID #
    ###################
    
    ro.sf.lcd_density=192
    qemu.hw.mainkeys=1
  • 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.
    Code:
    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:
    Code:
    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:
    Code:
    ###################
    # PARANOIDANDROID #
    ###################
    
    ## DEFAULTS
    %rom_tablet_base=192
    %rom_phone_base=320
    %rom_mid_base=260
    %rom_mid_high_base=290
    %rom_framework_dpi=250
    %rom_systemui_dpi=220
    %rom_launcher_dpi=290
    %screen_default_width=360
    %screen_default_height=567
    %screen_default_layout=268435474
    %screen_opposite_width=600
    %screen_opposite_height=1018
    %screen_opposite_layout=268435491
    
    ## CONFIGURATION
    %hybrid_mode=1
    %system_default_dpi=%rom_mid_base
    %user_default_dpi=%rom_mid_base
    %user_default_mode=1
    android.dpi=%rom_framework_dpi
    com.android.systemui.dpi=%rom_systemui_dpi
    
    ## PREFERENCES
    com.android.phone.mode=1
    com.android.inputmethod.dpi=%rom_phone_base
    com.android.inputmethod.latin.mode=1
    com.android.inputmethod.dpi=%rom_phone_base
    com.android.camera.mode=2
    com.android.camera.dpi=%rom_tablet_base
    com.cyanogenmod.trebuchet.mode=1
    com.cyanogenmod.trebuchet.dpi=%rom_launcher_dpi
    com.anddoes.launcher.mode=1
    com.anddoes.launcher.dpi=%rom_launcher_dpi
    com.teslacoilsw.launcher.mode=1
    com.teslacoilsw.launcher.dpi=%rom_launcher_dpi
    com.android.chrome.mode=1
    com.android.chrome.dpi=%rom_mid_high_base
    com.android.calendar.mode=2
    com.android.contacts.mode=2
    com.android.email.mode=2
    com.android.htmlviewer.mode=1
    com.android.mms.mode=1
    com.android.settings.mode=2
    com.android.vending.mode=2
    com.google.android.gm.mode=2
    com.google.android.googlequicksearchbox.mode=2
    com.google.android.talk.mode=1
    com.google.android.youtube.mode=2
    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:
    Code:
    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:
    Code:
    ###################
    # PARANOIDANDROID #
    ###################
    
    ro.sf.lcd_density=192
    ro.cm.version=PARANOIDANDROID
    ro.modversion=PARANOIDANDROID
    ro.pa.version=PARANOIDANDROID-pa_maguro-1.5a-28JUN2012-180025
    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: http://betadan.com/paranoid/sources/

  • 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: http://4ndr01d.com/drcmda/common/

  • 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.
 
Last edited:

T-Macgnolia

Senior Member
Sep 30, 2010
3,796
2,023
Shannon, Ms.
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.

Code:
audio="/system/customize/resource/android_audio.mp3"

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.
 

D4rKn3sSyS

Inactive Recognized Developer
Jan 12, 2011
3,800
16,278
Medellín
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.
 

sgtkwol

Senior Member
Sep 2, 2010
417
284
Buffalo, NY
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.
 
Last edited:

DaXmax

Senior Member
Sep 16, 2008
10,846
9,928
Singapore
@molesarecoming

I totally forgot my skills of compiling kangs, can you guide me a bit through pm... Wifi Tethering is not fully working....

My computer specs, already had external HDD to compile...

-Intel i7-2760qm (8 cores, 2.4ghz)
-8 GB Ram
-1 TB HDD SATA (Internal HDD)
-500 GB HDD 3x faster writing...
 
Last edited:

molesarecoming

Inactive Recognized Developer
Feb 12, 2012
7,532
27,173
Berlin
@molesarecoming

I totally forgot my skills of compiling kangs, can you guide me a bit through pm... Wifi Tethering is not fully working....

My computer specs, already had external HDD to compile...

-Intel i7-2760qm (8 cores, 2.4ghz)
-8 GB Ram
-1 TB HDD SATA (Internal HDD)
-500 GB HDD 3x faster writing...

what i do is mostly hacking. i have never ported a rom before. i guess what i would do is taking a nightly or compiling a build, test if everything works and then add pa's additions. i cant remember all components but from mind they are: framework.jar, framework-res.apk, android.policy.jar, services.jar, maybe core.jar. the apps are not so important, you can compile our trebuchet fork from source, try making settings.apk run, if not i think that ones coming out today and if not today than very soon.

it would be cool if one of the guys who's made it writes a small rundown and i would put it up.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 117
    untitled1cfkvi.png




    disclaimer:
    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 . rom-build.sh 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. :cool:




    paranoid_notab.png

    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.



    GUIDE FOR PORTING PA 1.6 and higher (JELLYBEAN/CM10)
    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.

    Code:
    ###################
    # PARANOIDANDROID #
    ###################
    
    ## CONFIGURATION
    %rom_dpi_min=160
    %rom_dpi_max=320
    %rom_default_dpi=320
    %rom_default_layout=360
    
    ## CONFIGURATION
    %hybrid_mode=1
    %system_default_layout=0
    %user_default_layout=0
    %system_default_dpi=0
    %user_default_dpi=0
    
    ## WORKSPACE PREFERENCES
    android.dpi=0
    android.layout=0
    com.android.systemui.dpi=%rom_default_dpi
    com.android.systemui.layout=%rom_default_layout
    
    ## SYSTEM PREFERENCES
    com.paranoid.preferences.dpi=270
    com.android.chrome.dpi=%rom_default_dpi
    com.android.chrome.layout=%rom_default_layout
    com.android.contacts.dpi=%rom_default_dpi
    com.android.contacts.layout=%rom_default_layout
    com.android.settings.dpi=245
    com.android.settings.layout=720
    com.android.calendar.dpi=260
    com.android.browser.dpi=260
    com.android.browser.layout=600
    com.android.calculator2.dpi=160
    com.android.calculator2.layout=600
    com.android.email.dpi=230
    com.android.email.layout=600
    com.android.vending.dpi=220
    com.android.vending.layout=1000
    com.google.android.gm.dpi=250
    com.google.android.gm.layout=600
    com.google.android.talk.dpi=260
    com.google.android.talk.layout=360
    com.google.android.youtube.dpi=240
    com.google.android.youtube.layout=800
    com.google.android.apps.docs.dpi=240
    com.google.android.apps.docs.layout=600
    
    ## USER PREFERENCES



    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
    Code:
    ro.cm.version=PARANOIDANDROID
    ro.modversion=PARANOIDANDROID
    ro.pa.version=PARANOIDANDROID-pa_YOURDEVICE-1.XXa-DDMMMYYYY

    oh, and do not, under any circumstance, touch build.prop dpi. system dpi runs always in default dpi.
    49
    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.
      Code:
      --- a/services/java/com/android/server/wm/WindowManagerService.java
      +++ b/services/java/com/android/server/wm/WindowManagerService.java
      @@ -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,
      build.prop
      Code:
      ###################
      # PARANOIDANDROID #
      ###################
      
      ro.sf.lcd_density=192
      qemu.hw.mainkeys=1
    • 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.
      Code:
      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:
      Code:
      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:
      Code:
      ###################
      # PARANOIDANDROID #
      ###################
      
      ## DEFAULTS
      %rom_tablet_base=192
      %rom_phone_base=320
      %rom_mid_base=260
      %rom_mid_high_base=290
      %rom_framework_dpi=250
      %rom_systemui_dpi=220
      %rom_launcher_dpi=290
      %screen_default_width=360
      %screen_default_height=567
      %screen_default_layout=268435474
      %screen_opposite_width=600
      %screen_opposite_height=1018
      %screen_opposite_layout=268435491
      
      ## CONFIGURATION
      %hybrid_mode=1
      %system_default_dpi=%rom_mid_base
      %user_default_dpi=%rom_mid_base
      %user_default_mode=1
      android.dpi=%rom_framework_dpi
      com.android.systemui.dpi=%rom_systemui_dpi
      
      ## PREFERENCES
      com.android.phone.mode=1
      com.android.inputmethod.dpi=%rom_phone_base
      com.android.inputmethod.latin.mode=1
      com.android.inputmethod.dpi=%rom_phone_base
      com.android.camera.mode=2
      com.android.camera.dpi=%rom_tablet_base
      com.cyanogenmod.trebuchet.mode=1
      com.cyanogenmod.trebuchet.dpi=%rom_launcher_dpi
      com.anddoes.launcher.mode=1
      com.anddoes.launcher.dpi=%rom_launcher_dpi
      com.teslacoilsw.launcher.mode=1
      com.teslacoilsw.launcher.dpi=%rom_launcher_dpi
      com.android.chrome.mode=1
      com.android.chrome.dpi=%rom_mid_high_base
      com.android.calendar.mode=2
      com.android.contacts.mode=2
      com.android.email.mode=2
      com.android.htmlviewer.mode=1
      com.android.mms.mode=1
      com.android.settings.mode=2
      com.android.vending.mode=2
      com.google.android.gm.mode=2
      com.google.android.googlequicksearchbox.mode=2
      com.google.android.talk.mode=1
      com.google.android.youtube.mode=2
      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:
      Code:
      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:
      Code:
      ###################
      # PARANOIDANDROID #
      ###################
      
      ro.sf.lcd_density=192
      ro.cm.version=PARANOIDANDROID
      ro.modversion=PARANOIDANDROID
      ro.pa.version=PARANOIDANDROID-pa_maguro-1.5a-28JUN2012-180025
      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: http://betadan.com/paranoid/sources/

    • 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: http://4ndr01d.com/drcmda/common/

    • 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.
    40
    what i do is mostly hacking. i have never ported a rom before. i guess what i would do is taking a nightly or compiling a build, test if everything works and then add pa's additions. i cant remember all components but from mind they are: framework.jar, framework-res.apk, android.policy.jar, services.jar, maybe core.jar. the apps are not so important, you can compile our trebuchet fork from source, try making settings.apk run, if not i think that ones coming out today and if not today than very soon.

    it would be cool if one of the guys who's made it writes a small rundown and i would put it up.

    The way I port this rom for my device in short :

    Things needed :

    • Apktool + latest aapt (android sdk)
    • Main compiled PA rom (use D4rKn3sSyS compiled rom for 240 dpi device, use molesarecoming compiled rom for 320 dpi device)
    • (un)official CM9 nightly donor rom for your device
    • 7-zip
    • Comparison tool (I use WinMergeU)
    • ADB (I prefer QtADB)

    Working order :

    • unzip main and donor rom
    • copy system/framework/framework-res.apk from main rom to your apktool folder.
    • rename system/framework/framework-res.apk to framework-res2.apk from donor rom and copy it to your apktool folder.
    • decompile both framework-res.apk files with apktool.
    • compare and merge your device specific entries in the res/values folder and the res/xml folder using a comparison tool with both framework-res.apk files loaded.
    • compile your freshly modified framework-res.apk using apktool.
    • open your compiled framework-res.apk found in apktool/framework-res/dist folder and open the original framework-res.apk file of the main PA rom using 7-zip.
    • Overwrite the /res folder from main PA framework-res.apk with the /res folder from your modified framework-res.apk using 7-zip.
    • delete system/framework and system/app folders from donor rom
    • copy system/framework (including your modified framework-res.apk) and system/app folders from main PA rom to your donor rom.
    • copy pad.prop from main PA rom to your donor /system folder
    • compare both build.props to check for important entries/changes and don't forget to add the PA specific lines:

    Code:
    ro.cm.version=PARANOIDANDROID
    ro.modversion=PARANOIDANDROID
    ro.pa.version=PARANOIDANDROID-yourdevice-1.4a-18JUN2012-150205

    • delete the /system folder from your donor ROM.zip and copy your 'freshly ported' /system folder back to the donor ROM.zip
    • hope for the best after flashing and check ADB for errors if they appear.

    Sounds easy, but there is more to it.. this is basic stuff.. just don't forget to use xda and google for more information regarding device specific stuff, errors and porting in general..

    Please don't fill this thread with questions about how to use the mentioned software... there are most likely other threads for that !

    Good Luck..
    14
    next update will be a revolutionary again.

    we figured using hardcoded configs to push apps into this and that UI mode is not really the way to go. and its SUCKS to calculate them. right now we now offer three fixed modes: phone, phab, tablet, but the fact is, apps can bring as many layouts as they want, some only bring one and some 10. it is confusing that you say "tabmode!" and the app doesnt care because it only has a low-res container. even more confusing if you say "tabmode!" and the app defines its tabUI higher than we defined it in pad.prop.

    the new code can set these layoutcontainers precisely, i have it running on my phone --- i cannot help but notice that this speeds up everything aswell, the phone feels snappier. i guess this is because we fed it hardcoded sizes in the past and he had to calculate the screensize again. now he's getting everything in the right size and apps come up immediately.

    the panel will even be cooler, it will actually read out the layout containers of each app you select. you can chose from a list. and if an app only has one, you see it immediately.

    for example, systemUI.apk, the app that display your bars (status/navigation/combined system) knows three modes:
    layout-default
    layout-sw600
    layout-sw720

    these values designate screensizes. nexus has a sw value of 360 for example, so by itself it will never reach into the higher containers. you could simply tap the last container and you'd have "tablet-mode", tap the second and you have phablet. first one, phone.

    just for reference, thats how my properties.conf looks like at the moment (for tablet mode):
    Code:
    ###################
    # PARANOIDANDROID #
    ###################
    
    ## CONFIGURATION
    %rom_dpi_min=160
    %rom_dpi_max=320
    
    ## CONFIGURATION
    %hybrid_mode=1
    %system_default_layout=0
    %user_default_layout=0
    %system_default_dpi=0
    %user_default_dpi=0
    
    ## WORKSPACE PREFERENCES
    android.dpi=0
    android.layout=0
    com.android.systemui.dpi=220
    com.android.systemui.layout=720
    
    ## SYSTEM PREFERENCES
    com.paranoid.preferences.dpi=260
    com.paranoid.preferences.layout=600
    com.android.settings.dpi=245
    com.android.settings.layout=720
    com.android.calendar.dpi=260
    com.android.browser.dpi=260
    com.android.browser.layout=600
    com.android.calculator2.dpi=160
    com.android.calculator2.layout=600
    com.android.email.dpi=230
    com.android.email.layout=600
    com.android.vending.dpi=220
    com.android.vending.layout=1000
    com.google.android.gm.dpi=250
    com.google.android.gm.layout=600
    com.google.android.talk.dpi=260
    com.google.android.talk.layout=600

    super happy about this, this will be the icing on the cake. :fingers-crossed:
    13
    -----------------------------reserved