equal
deleted
inserted
replaced
33 |
33 |
34 // MODULE DATA STRUCTURES |
34 // MODULE DATA STRUCTURES |
35 |
35 |
36 // LOCAL FUNCTION PROTOTYPES |
36 // LOCAL FUNCTION PROTOTYPES |
37 LOCAL_C TInt StartL(); |
37 LOCAL_C TInt StartL(); |
38 LOCAL_C TInt Reboot(); |
38 LOCAL_C TInt Reboot(RStarterSession::TResetReason aReason); |
39 LOCAL_C TInt RestoreFactorySettings( TBool aIsDeepRfs ); |
39 LOCAL_C TInt RestoreFactorySettings( TBool aIsDeepRfs ); |
40 |
40 |
41 |
41 |
42 // FORWARD DECLARATIONS |
42 // FORWARD DECLARATIONS |
43 |
43 |
52 TPtr ptCmdLine = cmdLine->Des(); |
52 TPtr ptCmdLine = cmdLine->Des(); |
53 User::CommandLine( ptCmdLine ); |
53 User::CommandLine( ptCmdLine ); |
54 |
54 |
55 if ( cmdLen == 0 ) |
55 if ( cmdLen == 0 ) |
56 { |
56 { |
57 error = Reboot(); |
57 error = Reboot(RStarterSession::EUnknownReset); |
58 } |
58 } |
59 |
59 |
60 else |
60 else |
61 { |
61 { |
62 TLex parser( *cmdLine ); |
62 TLex parser( *cmdLine ); |
|
63 TInt input; |
|
64 TInt ret = parser.Val(input); |
|
65 |
63 parser.SkipCharacters(); |
66 parser.SkipCharacters(); |
64 if ( parser.MarkedToken().CompareF( KParamNormalRfs ) == 0 ) |
67 if ( parser.MarkedToken().CompareF( KParamNormalRfs ) == 0 ) |
65 { |
68 { |
66 error = RestoreFactorySettings( EFalse ); |
69 error = RestoreFactorySettings( EFalse ); |
67 } |
70 } |
69 { |
72 { |
70 error = RestoreFactorySettings( ETrue ); |
73 error = RestoreFactorySettings( ETrue ); |
71 } |
74 } |
72 else |
75 else |
73 { |
76 { |
74 error = KErrArgument; // Unknown argument |
77 if(ret != KErrNone ) |
|
78 { |
|
79 error = KErrArgument; // Unknown argument |
|
80 } |
|
81 else |
|
82 { |
|
83 error = Reboot((RStarterSession::TResetReason)input); |
|
84 } |
75 } |
85 } |
76 } |
86 } |
77 |
87 |
78 CleanupStack::PopAndDestroy(); // cmdLine |
88 CleanupStack::PopAndDestroy(); // cmdLine |
79 return error; |
89 return error; |
80 } |
90 } |
81 |
91 |
82 LOCAL_C TInt Reboot() |
92 LOCAL_C TInt Reboot(RStarterSession::TResetReason aReason) |
83 { |
93 { |
84 RStarterSession session; |
94 RStarterSession session; |
85 TInt error = session.Connect(); |
95 TInt error = session.Connect(); |
86 if ( error == KErrNone ) |
96 if ( error == KErrNone ) |
87 { |
97 { |
88 session.Reset( RStarterSession::EUnknownReset ); |
98 session.Reset( aReason ); |
89 session.Close(); |
99 session.Close(); |
90 } |
100 } |
91 return error; |
101 return error; |
92 } |
102 } |
93 |
103 |