[AT&T Samsung Galaxy Note I717] Gestalt73:
canStatusBarHide?

Hey DaGr8, have you had any luck overriding the default phone/tablet logic? I was thinking that it would be possible to enable tablet mode at a higher dpi, or perhaps even trigger phone vs tablet mode via orientation, but every time I override the logic I get a cast error, even if I hardcode the method to return false (tablet mode).

It's almost as if there's another method or bit of code used to determine whether or not to draw the statusbar or the systembar aside from PhoneWindowManager->canStatusBarHide().

I'm looking through SystemUIService.java now to see if I can pick out exactly where the first decision is made because it can't be using canStatusBarHide (because I'm hardcoding it).

Here's the quick hack I was using to lock the canStatusBarHide() to false:

.method public setInitialDisplaySize(II)V
.registers 11

const v7, 0x1110014

const/4 v3, 0x2

const/4 v6, 0x3

const/4 v4, 0x1

const/4 v5, 0x0

if-le p1, p2, :cond_97

move v1, p2

iput v5, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I

iput v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I

iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;

invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v3

invoke-virtual {v3, v7}, Landroid/content/res/Resources;->getBoolean(I)Z

move-result v3

if-eqz v3, :cond_92

iput v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I

iput v6, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I

:goto_1e
mul-int/lit16 v3, v1, 0xa0

sget v6, Landroid/util/DisplayMetrics;->DENSITY_DEVICE:I

div-int v2, v3, v6

const/16 v3, 0x258

#always return same value
#if result is greater or equal to 600, goto cond_b4
#if-ge v2, v3, :cond_b4

move v3, v4

:goto_29
iput-boolean v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBarCanHide:Z

Here's a sample logcat from when I hardcode canStatusBarHide at TabletMode:

E/AndroidRuntime( 996): FATAL EXCEPTION: main
E/AndroidRuntime( 996): java.lang.RuntimeException: Unable to create service com.android.systemui.SystemUIService: java.lang.ClassCastException: com.android.systemui.statusbar.tablet.TabletStatusBarView cannot be cast to com.android.systemui.statusbar.phone.PhoneStatusBarView
E/AndroidRuntime( 996):	at android.app.ActivityThread.handleCreateService(ActivityThread.java)
E/AndroidRuntime( 996):	at android.app.ActivityThread.access$1600(ActivityThread.java)
E/AndroidRuntime( 996):	at android.app.ActivityThread$H.handleMessage(ActivityThread.java)
E/AndroidRuntime( 996):	at android.os.Handler.dispatchMessage(Handler.java)
E/AndroidRuntime( 996):	at android.os.Looper.loop(Looper.java)
E/AndroidRuntime( 996):	at android.app.ActivityThread.main(ActivityThread.java)
E/AndroidRuntime( 996):	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 996):	at java.lang.reflect.Method.invoke(Method.java)
E/AndroidRuntime( 996):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
E/AndroidRuntime( 996):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
E/AndroidRuntime( 996):	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 996): Caused by: java.lang.ClassCastException: com.android.systemui.statusbar.tablet.TabletStatusBarView cannot be cast to com.android.systemui.statusbar.phone.PhoneStatusBarView
E/AndroidRuntime( 996):	at com.android.systemui.statusbar.phone.PhoneStatusBar.makeStatusBarView(PhoneStatusBar.java)
E/AndroidRuntime( 996):	at com.android.systemui.statusbar.StatusBar.start(StatusBar.java)
E/AndroidRuntime( 996):	at com.android.systemui.statusbar.phone.PhoneStatusBar.start(PhoneStatusBar.java)
E/AndroidRuntime( 996):	at com.android.systemui.SystemUIService.onCreate(SystemUIService.java)
E/AndroidRuntime( 996):	... 11 more