javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistrator.java
changeset 56 abc41079b313
parent 50 023eef975703
child 87 1627c337e51e
equal deleted inserted replaced
50:023eef975703 56:abc41079b313
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 package com.nokia.mj.impl.installer.applicationregistrator;
    19 package com.nokia.mj.impl.installer.applicationregistrator;
    20 
    20 
       
    21 import com.nokia.mj.impl.installer.storagehandler.SuiteInfo;
    21 import com.nokia.mj.impl.installer.utils.InstallerException;
    22 import com.nokia.mj.impl.installer.utils.InstallerException;
    22 import com.nokia.mj.impl.installer.utils.FileRoots;
    23 import com.nokia.mj.impl.installer.utils.FileRoots;
    23 import com.nokia.mj.impl.installer.utils.FileUtils;
    24 import com.nokia.mj.impl.installer.utils.FileUtils;
    24 import com.nokia.mj.impl.installer.utils.Log;
    25 import com.nokia.mj.impl.installer.utils.Log;
    25 import com.nokia.mj.impl.installer.utils.PlatformUid;
    26 import com.nokia.mj.impl.installer.utils.PlatformUid;
   437     {
   438     {
   438         _notifyLauncherThatUiIsReady();
   439         _notifyLauncherThatUiIsReady();
   439         return;
   440         return;
   440     }
   441     }
   441 
   442 
       
   443     /**
       
   444      * Adds an entry to platform installation log.
       
   445      *
       
   446      * @param aSuite application suite information
       
   447      * @param aAction 0 - installation, 1 - uninstallation
       
   448      */
       
   449     public static void addInstallLogEntry(SuiteInfo aSuite, int aAction)
       
   450     {
       
   451         // In S60 the version number is restricted to limited range.
       
   452         // If version number is outside of this range, use version
       
   453         // number 0 instead.
       
   454         int result = _addInstallLogEntry(
       
   455             aAction, PlatformUid.getIntValue(aSuite.getUid()),
       
   456             aSuite.getName(), aSuite.getVendor(),
       
   457             getVersion(aSuite.getVersion().getMajor(), 0, 127),
       
   458             getVersion(aSuite.getVersion().getMinor(), 0, 99),
       
   459             getVersion(aSuite.getVersion().getMicro(), 0, 32767));
       
   460         if (result < 0)
       
   461         {
       
   462             Log.logError("Adding installation log entry failed, err=" + result);
       
   463         }
       
   464         else
       
   465         {
       
   466             Log.log("Added installation log entry");
       
   467         }
       
   468     }
       
   469 
   442     /*** ----------------------------- PACKAGE ---------------------------- */
   470     /*** ----------------------------- PACKAGE ---------------------------- */
   443     /*** ----------------------------- PRIVATE ---------------------------- */
   471     /*** ----------------------------- PRIVATE ---------------------------- */
       
   472 
       
   473     /**
       
   474      * Checks that given version number is between specified minimum and
       
   475      * maximum value range (inclusive) and if it is returns version number.
       
   476      * If version number is out of given range, returns 0.
       
   477      */
       
   478     private static int getVersion(int aVersion, int aMin, int aMax)
       
   479     {
       
   480         if (aVersion >= aMin && aVersion <= aMax)
       
   481         {
       
   482             return aVersion;
       
   483         }
       
   484         return 0;
       
   485     }
       
   486 
   444     /*** ----------------------------- NATIVE ----------------------------- */
   487     /*** ----------------------------- NATIVE ----------------------------- */
   445 
   488 
   446     /**
   489     /**
   447      * Starts native application registration session.
   490      * Starts native application registration session.
   448      *
   491      *
   579      * emulator environment.
   622      * emulator environment.
   580      *
   623      *
   581      * @return true if Symbian 9.2 emulator environment
   624      * @return true if Symbian 9.2 emulator environment
   582      */
   625      */
   583     private static native boolean _runningIn92Emulator();
   626     private static native boolean _runningIn92Emulator();
       
   627 
       
   628     /**
       
   629      * Adds an entry to platform installation log.
       
   630      *
       
   631      * @param aAction 0 - installation, 1 - uninstallation
       
   632      * @param aUid application suite uid
       
   633      * @param aName application suite name
       
   634      * @param aVendor application suite vendor
       
   635      * @param aMajorVersion application suite major version
       
   636      * @param aMinorVersion application suite minor version
       
   637      * @param aMicroVersion application suite micro version
       
   638      * @return Symbian error code (negative number) if fails, otherwise 0
       
   639      */
       
   640     private static native int _addInstallLogEntry(
       
   641         int aAction, int aUid, String aName, String aVendor,
       
   642         int aMajorVersion, int aMinorVersion, int aMicroVersion);
   584 }
   643 }