76 EXPORT_C TBool CKeyguardAccessApi::IsKeylockEnabled() |
76 EXPORT_C TBool CKeyguardAccessApi::IsKeylockEnabled() |
77 { |
77 { |
78 |
78 |
79 RDEBUG("0", 0); |
79 RDEBUG("0", 0); |
80 TInt value; |
80 TInt value; |
|
81 TBool ret = EFalse; |
81 TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value); |
82 TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value); |
82 RDEBUG("err", err); |
83 RDEBUG("err", err); |
83 RDEBUG("value", value); |
84 RDEBUG("value", value); |
84 if ( err == KErrNone ) |
85 if ( err == KErrNone ) |
85 { |
86 { |
86 switch( value ) |
87 switch( value ) |
87 { |
88 { |
88 case EKeyguardLocked: |
89 case EKeyguardLocked: |
89 case EKeyguardAutolockEmulation: |
90 case EKeyguardAutolockEmulation: |
90 return ETrue; |
91 ret = ETrue; |
91 case EKeyguardNotActive: |
92 case EKeyguardNotActive: |
92 default: |
93 default: |
93 return EFalse; |
94 ret = EFalse; |
94 } |
95 } |
95 } |
96 } |
96 else |
97 else |
97 { |
98 { |
98 return EFalse; |
99 ret = EFalse; |
99 } |
100 } |
|
101 RDEBUG("bool ret", ret); |
|
102 return ret; |
100 } |
103 } |
101 |
104 |
102 // --------------------------------------------------------------------------- |
105 // --------------------------------------------------------------------------- |
103 // Checks if the keyguard is enabled or not |
106 // Checks if the keyguard is enabled or not |
104 // --------------------------------------------------------------------------- |
107 // --------------------------------------------------------------------------- |
105 EXPORT_C TBool CKeyguardAccessApi::IsKeyguardEnabled() |
108 EXPORT_C TBool CKeyguardAccessApi::IsKeyguardEnabled() |
106 { |
109 { |
107 RDEBUG("0", 0); |
110 RDEBUG("0", 0); |
108 TInt value; |
111 TInt value; |
|
112 TBool ret = EFalse; |
109 TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value); |
113 TInt err = RProperty::Get(KPSUidAvkonDomain, KAknKeyguardStatus, value); |
110 RDEBUG("err", err); |
114 RDEBUG("err", err); |
111 RDEBUG("value", value); |
115 RDEBUG("value", value); |
112 if ( err == KErrNone ) |
116 if ( err == KErrNone ) |
113 { |
117 { |
114 switch( value ) |
118 switch( value ) |
115 { |
119 { |
116 case EKeyguardLocked: |
120 case EKeyguardLocked: |
117 return ETrue; |
121 ret = ETrue; |
118 case EKeyguardAutolockEmulation: |
122 case EKeyguardAutolockEmulation: |
119 case EKeyguardNotActive: |
123 case EKeyguardNotActive: |
120 default: |
124 default: |
121 return EFalse; |
125 ret = EFalse; |
122 } |
126 } |
123 } |
127 } |
124 else |
128 else |
125 { |
129 { |
126 return EFalse; |
130 ret = EFalse; |
127 } |
131 } |
|
132 RDEBUG("bool ret", ret); |
|
133 return ret; |
128 } |
134 } |
129 |
135 |
130 // --------------------------------------------------------------------------- |
136 // --------------------------------------------------------------------------- |
131 // Requests lockapp server to enable keyguard with or without note. |
137 // Requests lockapp server to enable keyguard with or without note. |
132 // --------------------------------------------------------------------------- |
138 // --------------------------------------------------------------------------- |