javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java
changeset 61 bf7ee68962da
parent 47 f40128debb5d
equal deleted inserted replaced
48:e0d6e9bd3ca7 61:bf7ee68962da
   138         ApplicationUtils appUtils = ApplicationUtils.getInstance();
   138         ApplicationUtils appUtils = ApplicationUtils.getInstance();
   139         appUtils.checkPermission(new MobileInfoPermission(aKey, "read"));
   139         appUtils.checkPermission(new MobileInfoPermission(aKey, "read"));
   140 
   140 
   141         int value = ((Integer)iPropertyKeys.get(aKey)).intValue();
   141         int value = ((Integer)iPropertyKeys.get(aKey)).intValue();
   142         Uid appSuiteUid;
   142         Uid appSuiteUid;
       
   143         int apId = APP_DEFAULT_APN_NOT_SPECIFIED;        // access point id
       
   144         int apType = APP_DEFAULT_APN_NOT_SPECIFIED;      // MIDlet access point type, can be SNAP or IAP
       
   145 
   143         ConnectionManager CmInstance = null;
   146         ConnectionManager CmInstance = null;
   144         String result = null;
   147         String result = null;
   145         // Only network access seems to have another way to handle it.
   148         // Only network access seems to have another way to handle it.
   146         if (aKey.equals(EMAIL_RECIEVE_SETTINGS)
   149         if (aKey.equals(EMAIL_RECIEVE_SETTINGS)
   147                 || aKey.equals(EMAIL_SEND_SETTINGS))
   150                 || aKey.equals(EMAIL_SEND_SETTINGS))
   158                 if (CmInstance != null)
   161                 if (CmInstance != null)
   159                 {
   162                 {
   160                     AccessPoint apn = CmInstance.getApplicationDefault(appSuiteUid);
   163                     AccessPoint apn = CmInstance.getApplicationDefault(appSuiteUid);
   161                     if (apn != null)
   164                     if (apn != null)
   162                     {
   165                     {
   163                         if (apn.getType() == AccessPoint.NAP_IAP) // IAP ID
   166                         apId = apn.getNapId();
       
   167                         apType = apn.getType();
       
   168 
       
   169 
       
   170                         if ((apType!=AccessPoint.NAP_SNAP) && (apType!=AccessPoint.NAP_IAP))
   164                         {
   171                         {
   165                             result = _getPropertyApn(NETWORK_ACCESS_V, apn.getNapId());
   172                             apType = APP_DEFAULT_APN_NOT_SPECIFIED;
       
   173                             apId = APP_DEFAULT_APN_NOT_SPECIFIED;
   166                         }
   174                         }
   167                         else
   175 
   168                         {
       
   169                             result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED);
       
   170                         }
       
   171                     }
   176                     }
   172                     else
   177 
   173                     {
       
   174                         result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED);
       
   175                     }
       
   176                 }
   178                 }
   177                 else
   179                 result = _getPropertyApn(NETWORK_ACCESS_V, apId,apType);
   178                 {
       
   179                     result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED);
       
   180                 }
       
   181             }
   180             }
   182             catch (Exception e)
   181             catch (Exception e)
   183             {
   182             {
   184                 Logger.LOG(Logger.ESOCKET, Logger.EInfo,"MobilInfoProperties :: getSuiteUid exception ");
   183                 Logger.LOG(Logger.ESOCKET, Logger.EInfo,"MobilInfoProperties :: getSuiteUid exception ");
   185                 result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED);
   184                 result = _getPropertyApn(NETWORK_ACCESS_V, apId,apType);
   186             }
   185             }
   187             return result;
   186             return result;
   188         }
   187         }
   189         else
   188         else
   190         {
   189         {
   200         }
   199         }
   201         return false;
   200         return false;
   202     }
   201     }
   203 
   202 
   204     private native String _getProperty(int value);
   203     private native String _getProperty(int value);
   205     private static native String _getPropertyApn(int property, int aAppDefaultApn);
   204     private static native String _getPropertyApn(int property, int aAppDefaultApn, int apType);
   206 
   205 
   207 }
   206 }