Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,105 Members 51,936 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
molesarecoming
Old
(Last edited by molesarecoming; 17th October 2012 at 11:23 AM.)
#1  
molesarecoming's Avatar
Recognized Developer - OP
Thanks Meter 27374
Posts: 7,530
Join Date: Feb 2012
Location: Berlin

 
DONATE TO ME
Tablet [PARANOIDANDROID JB/CS] Developers only: Porting, Support and Maintanance





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.




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.
"I just flash 3/25 and my car broke down after Bluetooth sync...thanks....idiots."
The Following 117 Users Say Thank You to molesarecoming For This Useful Post: [ Click to Expand ]
 
molesarecoming
Old
(Last edited by molesarecoming; 8th August 2012 at 06:44 PM.)
#2  
molesarecoming's Avatar
Recognized Developer - OP
Thanks Meter 27374
Posts: 7,530
Join Date: Feb 2012
Location: Berlin

 
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.
    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.
"I just flash 3/25 and my car broke down after Bluetooth sync...thanks....idiots."
The Following 49 Users Say Thank You to molesarecoming For This Useful Post: [ Click to Expand ]
 
molesarecoming
Old
#3  
molesarecoming's Avatar
Recognized Developer - OP
Thanks Meter 27374
Posts: 7,530
Join Date: Feb 2012
Location: Berlin

 
DONATE TO ME
-----------------------------reserved
"I just flash 3/25 and my car broke down after Bluetooth sync...thanks....idiots."
The Following 13 Users Say Thank You to molesarecoming For This Useful Post: [ Click to Expand ]
 
Note2Frat
Old
#4  
Note2Frat's Avatar
Senior Member
Thanks Meter 834
Posts: 918
Join Date: Mar 2010
Thanks Moles, this will continue to help us on the Vivow Port till we can build from source.

*I do not have any of my original work for WM. Lost it when all of the online servers had issues.
*You are welcome to continue my previous WM projects.
The Following User Says Thank You to Note2Frat For This Useful Post: [ Click to Expand ]
 
JokerAce
Old
#5  
JokerAce's Avatar
Senior Member
Thanks Meter 653
Posts: 1,434
Join Date: Sep 2009
Location: Teleporting..

 
DONATE TO ME
Thanks for this innovation. Salute!


Phone Info
Ph.Model: Nexus 5, Hammerhead
ROM: Dirty Unicorn
Kernel: Franco r25
RADIO: -

Personal Info
I Had:
HTC Magic 32A, GingerYoshi 1.5,
Nexus One, CM 7.1 w C.BlackRose
Nexus S, PA 2.22, Bedalus Marmite Kernel
I9100, PACman, DorimanX kernel
E975, ThinkingBridge
SuperCharge y'phone!









Assist in development with this
"Logcat or it never happened"
The Following 3 Users Say Thank You to JokerAce For This Useful Post: [ Click to Expand ]
 
DAGr8
Old
#6  
DAGr8's Avatar
Recognized Developer
Thanks Meter 6332
Posts: 3,525
Join Date: Feb 2010
Location: Montreal

 
DONATE TO ME
I just thanked all post ,if yo had one more I woudl have thanked it to ,

in other words , thanks !
COME CHAT WITH US

T W I T T E R
 
King-Kang For The Galaxy Note LTE

The Hybrid for Galaxy Note II & SGH-I717


SAUROM-PROJEKT for I9000


or

The Following User Says Thank You to DAGr8 For This Useful Post: [ Click to Expand ]
 
flappjaxxx
Old
#7  
flappjaxxx's Avatar
Senior Member
Thanks Meter 11358
Posts: 2,625
Join Date: Apr 2009
Location: Somewhere, FL

 
DONATE TO ME
Awesome! Thanks for this awesome contribution!
The Following User Says Thank You to flappjaxxx For This Useful Post: [ Click to Expand ]
 
T-Macgnolia
Old
#8  
T-Macgnolia's Avatar
Forum Moderator
Thanks Meter 1886
Posts: 3,707
Join Date: Sep 2010
Location: Shannon, Ms.

 
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.

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.
New to XDA? Please have a read here and here, they are here to help you.
XDA Search Video
S-off explained
Guide on HTC HD2
4EXT Themes, Splash screens, and Bootanimation By T-Macgnolia
XDA-BLOG Writer
RegawMOD Bootloader Customizer for Sensation

Current daily device= Samsung Galaxy Note 2
ROM=TMOUS Stock Multi Window update not rooted
Other devices=TMOUS HTC Sensation 4G,TMOUS HTC HD2 , Acer Iconia A500

The Following 2 Users Say Thank You to T-Macgnolia For This Useful Post: [ Click to Expand ]
 
sgtkwol
Old
#9  
Senior Member
Thanks Meter 283
Posts: 411
Join Date: Sep 2010
Location: Buffalo, NY
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.
 
D4rKn3sSyS
Old
#10  
D4rKn3sSyS's Avatar
Recognized Developer
Thanks Meter 15983
Posts: 3,776
Join Date: Jan 2011
Location: Monteria

 
DONATE TO ME
Quote:
Originally Posted by sgtkwol View Post
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: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes