Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d6e46d6 authored by Danesh Mondegarian's avatar Danesh Mondegarian
Browse files

Lockscreen landscape fix

Fixes the force close introduced by http://review.cyanogenmod.com/#change,6731

Mismatched viewgroup casting was causing this.

Thanks Giulio Cervera for reporting the bug :)

Change-Id: I93b23f79ab8514fb4d361dc81d8ad276f0471c69
parent c740f234
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -295,19 +295,21 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM

        final LayoutInflater inflater = LayoutInflater.from(context);
        if (DBG) Log.v(TAG, "Creation orientation = " + mCreationOrientation);
        if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) {
            inflater.inflate(R.layout.keyguard_screen_tab_unlock, this, true);
        } else {
            inflater.inflate(R.layout.keyguard_screen_tab_unlock_land, this, true);
        }
        try {
            LOCK_WALLPAPER = mContext.createPackageContext("com.cyanogenmod.cmparts", 0).getFilesDir()+"/lockwallpaper";
        } catch (NameNotFoundException e1) {
            LOCK_WALLPAPER = "";
        }
        ViewGroup lockWallpaper = null;
        if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) {
            inflater.inflate(R.layout.keyguard_screen_tab_unlock, this, true);
            lockWallpaper = (RelativeLayout) findViewById(R.id.root);
        } else {
            inflater.inflate(R.layout.keyguard_screen_tab_unlock_land, this, true);
            lockWallpaper = (LinearLayout) findViewById(R.id.root);
        }
        if (!LOCK_WALLPAPER.equals("")){
            String mLockBack = Settings.System.getString(context.getContentResolver(), Settings.System.LOCKSCREEN_BACKGROUND);
            RelativeLayout lockWallpaper = (RelativeLayout) findViewById(R.id.root);
            if (mLockBack != null){
                if (mLockBack.length() == 0){
                    Bitmap lockb = BitmapFactory.decodeFile(LOCK_WALLPAPER);