×
Namespaces

Variants
Actions

Archived:JSR-135 player throws Symbian error after answering a phone call in S60 3rd Edition FP2 (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.


Article Metadata
Tested with
Devices(s): S60 3rd Edition Feature Pack 2 devices
Compatibility
Platform(s):
S60 3rd Edition FP2
Article
Created: User:Technical writer 1 (23 Oct 2008)
Last edited: hamishwillee (16 Aug 2013)

Contents

Overview

The MMAPI player throws a SymbianOSError after receiving a phone call event in S60 3rd Edition Feature Pack 2.

Description

When an MMAPI player is playing on a device (the player is in STARTED state) and that device receives a phone call event, the player should be stopped (player entering PREFETCHED state).

However, with S60 3rd Edition, Feature Pack 2 devices the player throws a SymbianOSError instead of entering the PREFETCHED state when a phone call is received.

How to reproduce

1. Implement a test MIDlet using the following code for the MMAPI audio player:

<codee java>

import java.io.InputStream;
import java.io.PrintStream;
import javax.microedition.lcdui.*;
import javax.microedition.media.*;
import javax.microedition.media.control.VolumeControl;
import javax.microedition.midlet.MIDlet;

public class Audio_Player extends MIDlet implements CommandListener, PlayerListener 
{
   Display d;
   Command exit;
   Command play;
   Command stop;
   Form f;
   Player p;
   VolumeControl vol;


   public void startApp()
   {
       d = Display.getDisplay(this);
       
       f = new Form("Audio player");
       play = new Command("Start play", Command.ITEM, 2);
       stop = new Command("Stop play", Command.ITEM, 2);
       exit = new Command("Exit", 7, 2);
       
       f.addCommand(play);
       f.addCommand(stop);
       f.addCommand(exit);
       f.setCommandListener(this);
       
       d.setCurrent(f);
   }

   public void pauseApp() {}

   public void destroyApp(boolean unconditional) {}

   public void commandAction(Command cmd, Displayable disp)
   {
       if(cmd == exit)
       {
           destroyApp(false);
           notifyDestroyed();
       } else
           
       if(cmd == play)
       {
        try
       {
           InputStream is = getClass().getResourceAsStream("/file.type");
           p = Manager.createPlayer(is, "audio/type");
           p.addPlayerListener(this);
           p.realize();
           vol = (VolumeControl)p.getControl("VolumeControl");
           vol.setLevel(70);
           p.prefetch();
           p.start();
       }
       catch(Exception e)
       {
           f.append(e.toString());
       }
       
       }
       else
           if(cmd == stop)
       {
           try
           {
               p.stop();
           }
           catch(Exception e) {}
       }
   } 
   
   public void playerUpdate(Player arg0, String arg1, Object arg2)
   {
       f.append("\nThis event happened: "+arg1+ ", event data: " +arg2 +"\n");
   }
}

</code>

2. Install the test MIDlet to a test device and launch it.

3. Start testing by pressing "Start play" ( 'Options' >'Start play').

4. Make a phone call to the test device.

5. Answer the call received by the test device. The following line will be printed to the MIDlet Form of an affected device: "This event happened: error, event data: SymbianOSError: <Error code>".

Solution

This issue is expected to be fixed in future software versions.

This page was last modified on 16 August 2013, at 09:11.
31 page views in the last 30 days.