startup/ssmstartuppolicy.cpp
author William Roberts <williamr@symbian.org>
Thu, 18 Nov 2010 11:34:02 +0000
changeset 133 20a717d43d32
parent 30 292fee808849
permissions -rw-r--r--
Add oby file which requests t_vfp test code, ConnTest app and eshell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     1
/*
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     8
*
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    11
*
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    12
* Contributors:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    13
*
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    14
* Description: Implementation of CSsmStartupPolicy class.
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    15
*
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    16
*/
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    17
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    18
#include <centralrepository.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    19
#include <e32property.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    20
#include <e32uid.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    21
#include <featmgr.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    22
#include <ssm/ssmdomaindefs.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    23
#include <ssm/ssmcmd.hrh>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    24
#include <ssm/ssmcommandlistresourcereader.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    25
#include <ssm/ssmstate.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    26
#include <ssm/ssmstateawaresession.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    27
#include <ssm/ssmstatetransition.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    28
#include <ssm/startupdomainpskeys.h>
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    29
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    30
#include "ssmsubstateext.hrh"
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    31
#include "ssmmapperutility.h"
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    32
#include "ssmmapperutilitystatic.h"
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    33
#include "ssmstartuppolicy.h"
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    34
#include "ssmpolicypluginsprivatecrkeys.h"
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    35
#include "trace.h"
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    36
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    37
/**
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    38
* Start-up state policy resource file path format :
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    39
* "\private\<SID of SSM>\startup\<Value of KSystemStartupModeKey>\"
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    40
*/
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    41
_LIT( KCommandListPath, "Z:\\private\\2000D75B\\startup\\%d\\" );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    42
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    43
// ======== LOCAL FUNCTIONS ========
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    44
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    45
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    46
// GetStartupMode
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    47
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    48
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    49
static TInt GetStartupMode()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    50
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    51
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    52
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    53
    TInt startupMode( EStartupModeNormal );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    54
    TInt errorCode = RProperty::Get(
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    55
        SsmMapperUtility::PsUid( KPSUidStartup ), KPSGlobalStartupMode, startupMode );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    56
    ERROR( errorCode, "Failed to read startup mode from P&S" );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    57
    INFO_1( "Startup mode is %d", startupMode );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    58
    return startupMode;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    59
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    60
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    61
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    62
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    63
// DecideStateByStartupMode
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    64
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    65
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    66
static TSsmStartupSubStateExt DecideStateByStartupMode()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    67
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    68
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    69
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    70
    TInt startupMode( GetStartupMode() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    71
    TSsmStartupSubStateExt nextState( ESsmStateSecurityCheck );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    72
    switch ( startupMode )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    73
        {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    74
        case EStartupModeTest:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    75
            nextState = ESsmStateTest;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    76
            break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    77
        case EStartupModeAlarm:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    78
            nextState = ESsmStateAlarm;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    79
            break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    80
        case EStartupModeCharging:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    81
            nextState = ESsmStateCharging;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    82
            break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    83
        default:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    84
            break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    85
        }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    86
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    87
    return nextState;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    88
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    89
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    90
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    91
// ======== MEMBER FUNCTIONS ========
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    92
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    93
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    94
// CSsmStartupPolicy::NewL
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    95
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    96
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    97
EXPORT_C MSsmStatePolicy* CSsmStartupPolicy::NewL()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    98
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    99
    CSsmStartupPolicy* self = new( ELeave ) CSsmStartupPolicy;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   100
    CleanupStack::PushL( self );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   101
    self->ConstructL();
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   102
    CleanupStack::Pop( self );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   103
    return self;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   104
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   105
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   106
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   107
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   108
// CSsmStartupPolicy::~CSsmStartupPolicy
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   109
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   110
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   111
CSsmStartupPolicy::~CSsmStartupPolicy()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   112
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   113
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   114
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   115
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   116
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   117
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   118
// CSsmStartupPolicy::GetNextState
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   119
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   120
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   121
// TomP - We've simplified this: we now only have 3 sub-states: PreUIServices StartingUIServices and StartingCriticalApps
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   122
// After that we'll drop into the Normal state which with it's 1 sub-state: NonCritcalApps
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   123
TBool CSsmStartupPolicy::GetNextState(
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   124
    TSsmState aCurrentTransition,
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   125
    TInt /*aReason*/,
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   126
    TInt aError,
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   127
    TInt aSeverity,
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   128
    TSsmState& aNextState )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   129
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   130
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   131
    INFO_2( "Current state %04x.%04x",
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   132
        aCurrentTransition.MainState(), aCurrentTransition.SubState() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   133
    ERROR_1( aError, "State transition resulted in an error, severity %d", aSeverity );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   134
	ASSERT_TRACE( aCurrentTransition.MainState() == ESsmStartup );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   135
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   136
	TBool moreToCome = EFalse;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   137
	if ( aError == KErrNone || aSeverity < ECmdHighSeverity )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   138
		{
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   139
		switch( aCurrentTransition.SubState() )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   140
			{
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   141
			case KSsmAnySubState:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   142
			case ESsmStatePreUiServices:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   143
				aNextState = TSsmState( ESsmStartup, ESsmStateStartingUiServices );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   144
				moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   145
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   146
			case ESsmStateStartingUiServices:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   147
				aNextState = TSsmState( ESsmStartup, ESsmStateStartingCriticalApps );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   148
				moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   149
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   150
			case ESsmStateStartingCriticalApps:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   151
				//TomP aNextState = TSsmState( ESsmStartup, ESsmStateSelfTestOK );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   152
				moreToCome = EFalse;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   153
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   154
/*TomP		
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   155
			case ESsmStateSelfTestOK:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   156
				aNextState = TSsmState( ESsmStartup, DecideStateByStartupMode() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   157
				moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   158
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   159
			case ESsmStateChargingToNormal:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   160
			case ESsmStateAlarmToNormal:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   161
				aNextState = TSsmState( ESsmStartup, ESsmStateSecurityCheck );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   162
				moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   163
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   164
			case ESsmStateSecurityCheck:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   165
				aNextState = TSsmState( ESsmStartup, SelectStateAfterSecurityCheck() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   166
				moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   167
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   168
			case ESsmStateChargingToAlarm:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   169
				aNextState = TSsmState( ESsmStartup, ESsmStateAlarm );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   170
				moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   171
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   172
			case ESsmStateAlarmToCharging:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   173
				aNextState = TSsmState( ESsmStartup, ESsmStateCharging );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   174
				moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   175
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   176
			case ESsmStateNonCritical:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   177
			    ClearResetCounter(); // start-up is successful
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   178
				aNextState = TSsmState( ESsmNormal, KSsmAnySubState );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   179
				moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   180
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   181
			case ESsmStateAlarm:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   182
			case ESsmStateCharging:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   183
			case ESsmStateTest:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   184
				moreToCome = EFalse;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   185
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   186
			case ESsmStateEmergencyCallsOnly:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   187
			    ClearResetCounter(); // start-up is successful
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   188
				moreToCome = EFalse;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   189
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   190
*/
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   191
			default:
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   192
        		ASSERT_ALWAYS_TRACE;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   193
				moreToCome = EFalse;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   194
				break;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   195
			}
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   196
		}
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   197
	else
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   198
		{
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   199
        if ( ResetLimitReached() ) // Updates the reset count
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   200
            {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   201
            aNextState = TSsmState( ESsmFail, KSsmAnySubState );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   202
	    	moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   203
    	    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   204
    	else
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   205
    	    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   206
            aNextState = TSsmState( ESsmShutdown, ESsmErrorShutdown );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   207
            moreToCome = ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   208
    	    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   209
		}
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   210
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   211
	return moreToCome;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   212
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   213
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   214
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   215
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   216
// CSsmStartupPolicy::GetCommandListPathL
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   217
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   218
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   219
void CSsmStartupPolicy::GetCommandListPathL( TDes& aCmdListPath )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   220
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   221
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   222
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   223
	aCmdListPath.Format( KCommandListPath, iHardwareReason );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   224
	iUtil->GetCommandListPath( aCmdListPath );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   225
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   226
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   227
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   228
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   229
// CSsmStartupPolicy::IsAllowedTargetState
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   230
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   231
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   232
TBool CSsmStartupPolicy::IsAllowedTargetState(
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   233
    const TSsmStateTransition& aRequest ) const
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   234
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   235
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   236
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   237
    TSsmState currentState;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   238
    TInt errorCode = GetCurrentState( currentState );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   239
    ERROR( errorCode, "Failed to get current state" );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   240
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   241
    if ( errorCode == KErrNone )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   242
        {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   243
        TUint16 reqMainState( aRequest.State().MainState() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   244
        TUint16 reqSubState( aRequest.State().SubState() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   245
        INFO_2( "Requested target state = %04x.%04x", reqMainState, reqSubState );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   246
        TUint16 curMainState( currentState.MainState() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   247
        TUint16 curSubState( currentState.SubState() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   248
        INFO_2( "Current state = %04x.%04x", curMainState, curSubState );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   249
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   250
		// TomP - We'll allow any state transition as long as there was no error
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   251
		return ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   252
        if ( reqMainState == ESsmStartup )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   253
            {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   254
            if ( ( curSubState == ESsmStateCharging &&
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   255
                   ( reqSubState == ESsmStateChargingToAlarm ||
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   256
                     reqSubState == ESsmStateChargingToNormal ) ) ||
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   257
                 ( curSubState == ESsmStateAlarm &&
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   258
                   ( reqSubState == ESsmStateAlarmToCharging ||
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   259
                     reqSubState == ESsmStateAlarmToNormal ) ) )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   260
                {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   261
                return ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   262
                }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   263
            }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   264
        else if ( reqMainState == ESsmNormal )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   265
            {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   266
            if ( ( curMainState == ESsmStartup &&
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   267
                   curSubState == ESsmStateNonCritical ) )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   268
                {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   269
                return ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   270
                }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   271
            }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   272
        else if ( reqMainState == ESsmFail ||
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   273
                  reqMainState == ESsmShutdown )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   274
            {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   275
            return ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   276
            }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   277
        }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   278
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   279
    return EFalse;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   280
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   281
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   282
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   283
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   284
// CSsmStartupPolicy::TargetSubState
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   285
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   286
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   287
TUint16 CSsmStartupPolicy::TargetSubState( const TUint16 aRequestedSubState )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   288
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   289
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   290
    INFO_1( "Requested sub state %04x", aRequestedSubState );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   291
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   292
	return ( aRequestedSubState == KSsmAnySubState ) ?
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   293
        ESsmStatePreUiServices : aRequestedSubState;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   294
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   295
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   296
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   297
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   298
// CSsmStartupPolicy::CSsmStartupPolicy
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   299
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   300
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   301
CSsmStartupPolicy::CSsmStartupPolicy()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   302
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   303
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   304
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   305
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   306
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   307
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   308
// CSsmStartupPolicy::ConstructL
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   309
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   310
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   311
void CSsmStartupPolicy::ConstructL()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   312
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   313
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   314
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   315
	// Read the hardware reason
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   316
	User::LeaveIfError( RProperty::Get(
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   317
	    KUidSystemCategory, KSystemStartupModeKey, iHardwareReason ) );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   318
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   319
    BaseConstructL();
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   320
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   321
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   322
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   323
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   324
// CSsmStartupPolicy::IsSimlessOfflineSupported
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   325
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   326
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   327
TBool CSsmStartupPolicy::IsSimlessOfflineSupported()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   328
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   329
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   330
/*	
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   331
    TBool ret( EFalse );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   332
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   333
    ret = ( iUtil->FeatureStatus( TUid::Uid( KFeatureIdOfflineMode ) ) ||
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   334
            iUtil->FeatureStatus( TUid::Uid( KFeatureIdFlightMode ) ) ) &&
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   335
            iUtil->FeatureStatus( TUid::Uid( KFeatureIdFfSimlessOfflineSupport ) );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   336
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   337
    INFO_1( "Simless offline supported = %d", ret );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   338
*/	
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   339
	//TomP - SIMless Offline is always supported
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   340
    return ETrue;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   341
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   342
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   343
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   344
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   345
// CSsmStartupPolicy::SelectStateAfterSecurityCheck
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   346
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   347
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   348
TUint16 CSsmStartupPolicy::SelectStateAfterSecurityCheck()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   349
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   350
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   351
/*
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   352
    TInt value( ESimStatusUninitialized );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   353
    TInt errorCode = RProperty::Get( iUtil->PsUid( KPSUidStartup ), KPSSimStatus, value );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   354
    ERROR( errorCode, "Failed to read KPSUidStartup::KPSSimStatus P&S key" );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   355
    INFO_1( "Current SIM status = %d", value );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   356
    TUint16 retVal( ESsmStateEmergencyCallsOnly );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   357
    if ( errorCode == KErrNone )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   358
        {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   359
        if ( value == ESimUsable || value == ESimNotSupported )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   360
            {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   361
            retVal = ESsmStateNonCritical;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   362
            }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   363
        else if ( value == ESimNotPresent && IsSimlessOfflineSupported() )
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   364
            {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   365
            retVal = ESsmStateNonCritical;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   366
            }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   367
        }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   368
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   369
    INFO_1( "State selected after security check = %04x", retVal );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   370
*/	
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   371
	// TomP - Always jump straight into Non Critical State next
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   372
    return ESsmStateNonCritical;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   373
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   374
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   375
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   376
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   377
// CSsmStartupPolicy::ClearResetCounter
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   378
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   379
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   380
void CSsmStartupPolicy::ClearResetCounter()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   381
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   382
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   383
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   384
    TRAPD_ERR( errorCode, ClearResetCounterL() );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   385
    ERROR( errorCode, "Failed to clear reset counter" );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   386
    }
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   387
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   388
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   389
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   390
// ClearResetCounterL
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   391
// ---------------------------------------------------------------------------
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   392
//
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   393
void CSsmStartupPolicy::ClearResetCounterL()
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   394
    {
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   395
    FUNC_LOG;
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   396
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   397
    CRepository* repository = CRepository::NewLC( iUtil->CrUid( KCRUidSsmStartupPolicy ) );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   398
    User::LeaveIfError( repository->Set( KSsmStartupErrorResetCounter, 0 ) );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   399
    CleanupStack::PopAndDestroy( repository );
292fee808849 First pass at stripping down the system startup (currently boots to a white screen responding to key input, but at least doesn't panic or go into shutdown)
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   400
    }