title: How To Stop (incognito) URL Suppression When Running HLS Streams Within Google-TV Sony 3.2 Android Programs
body: <p>EDIT: as per my comments below I have been able to extend my testing to other Honeycomb 3.2 and ICS devices. In all cases the URL's are, in fact, appearing and thus allowing me to validate the adaptive streaming.  This, therefore, is an issue with only the Sony Blueray (which, at the time, was my only adaptive streaming supporting device).  Since this isn't an issue with 3.2+ OS but with only one manufacturer device it is not an issue with adaptive streaming testing and I can withdraw this request for support. </p>
  
  <p>I'm having an issue with URL's blocked and suppressed in locat/DDMS.  What I"m trying to do is verify my HLS adaptive streaming is really adapting.  How I planned to do this is monitor the logcat and watch the segments being picked up.   The issue I have is that the URLs are suppressed so I can't see what's going on.  Here's a snippet from what I see in Logcat. </p>
  
  <p>05-15 14:05:03.499: D/AVAPIMediaPlayer(247): AVAPIMediaPlayer constructed<br/>
  05-15 14:05:03.503: D/AVAPIMediaPlayer(247): initCheck called<br/>
  <b>05-15 14:05:03.503: D/AVAPIMediaPlayer(247): SetDataSource &#60;BLOCKED&#62;</b><br/>
  05-15 14:05:03.503: D/AVAPIMediaPlayer(247): surfaceChangedCallback: call setVideoRectangle this 0x66901738, x 480, y 180, w 1440, h 680  <br/>
  05-15 14:05:03.507: D/AVAPIMediaPlayer(247): Create player core for mime type video/mp2t<br/>
  05-15 14:05:03.507: D/AVSettingsBridge(247): prepare, handle:c560b6c8f9, type:0<br/>
  05-15 14:05:03.507: I/AVSettingsBridge(247): IAVSettingsBridgeImpl::registerCb, map size:0->1<br/>
  <b>05-15 14:05:03.511: I/LiveSession(247): onConnect &#60;URL suppressed&#62;</b><br/>
  <b>05-15 14:05:03.511: I/NuHTTPDataSource(247): connect to &#60;URL suppressed&#62; @0</b><br/></p>
  
  <p>Now I quickly traced these back to the chrome framework and the incognito mode.   Some framework sources: <a href="http://androidxref.com/source/s?defs=kFlagIncognito&amp;project=frameworks" rel="nofollow">http://androidxref.com/source/s?defs=kFlagIncognito&amp;project=frameworks</a>.</p>
  
  <pre><code>81     if (!(mFlags &amp; kFlagIncognito)) {
   82         LOG_PRI(ANDROID_LOG_INFO, LOG_TAG, "connect to %s @%lld", uri, offset);
   83     } else {
   84         LOG_PRI(ANDROID_LOG_INFO, LOG_TAG,
   85                 "connect to &lt;URL suppressed&gt; @%lld", offset);
  </code></pre>
  
  <p>I also picked up a reference  in Android 3.0 "The browser includes new features that let users navigate and organize more efficiently. Multiple tabs replace browser windows and a new “incognito” mode allows anonymous browsing".</p>
  
  <p>What I figure is perhaps it's going into incognito mode by default?</p>
  
  <p>Now, I'm not a coder, just struggling with code that was dropped in my lap, but it dawned on me that somewhere in setDataSource(Context context, Uri uri) or associated HTTP Headers there's probably a tag/flag that can be set to turn incognito on or off.  And that seasoned <b> Android </b> programmers would probably be able to figure it out quickly.  </p>
  
  <p>Can anyone help?</p>
  
  <p>I have additional references below if it helps. </p>
  
  <hr>
  
  <p>Reference in our code:</p>
  
  <pre><code> public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      Intent receivedIntent = this.getIntent();
      receivedIntent = this.getIntent();
      String title = receivedIntent.getExtras().getString("label");
      String subtitle = receivedIntent.getExtras().getString("subtitle");
      String description = receivedIntent.getExtras().getString("description");
      String URI = receivedIntent.getExtras().getString("URI");
      String imagePrefix = receivedIntent.getExtras().getString("imagePrefix");
      setContentView(R.layout.video_page);
  
      String fileName = Environment.getExternalStorageDirectory().toString() + "/CamaroPit/" + imagePrefix  + ".mp4";
      File file = new File(fileName);
      if (!file.exists()) {
          fileName = Environment.getExternalStorageDirectory().toString() + "/CamaroPit/alschevrolet.mp4";
      }
  
      Log.d("GTV", "Video to play: " + fileName);
      TextView textTitle = (TextView) findViewById(R.id.video_page_title);
      textTitle.setText(title);
      TextView textSubtitle = (TextView) findViewById(R.id.video_page_subtitle);
      if (subtitle.equals("subtitle")) {
          subtitle = "Check out \""+ title + "\" and really get a feel for your Camaro.";
      }
      textSubtitle.setText(subtitle);
      TextView textDescription = (TextView) findViewById(R.id.video_page_description);
      textDescription.setText(description);
      this.getWindow().setFormat(PixelFormat.TRANSPARENT);
      final VideoView vView = (VideoView) findViewById(R.id.page_view);
      vView.setMediaController(new MediaController(this));
      vView.setVideoURI(Uri.parse(URI));
      vView.requestFocus();      
  }
  
   item.setOnClickListener(new OnClickListener() {
  @Override
  public void onClick(View view) {
      final VideoView vView = (VideoView) GTVHomeScreenSetup.this.homeScreen.findViewById(R.id.gtv_video_view);
      MediaController mC = new MediaController(GTVHomeScreenSetup.this.homeScreen);
      vView.setMediaController(mC);
      mC.setAnchorView(vView);
  
      VideoData clickedVideo = currentVideoList.get(item.position);
  
      vView.setVideoURI(Uri.parse(homeScreen.getVideoURI(clickedVideo, cPath)));
      vView.start();
  
      item.requestFocus();
      for (ImageItemView item : GTVHomeScreenSetup.this.imageItems) {
          item.unSelect();
      }
      item.select();
  </code></pre>
  
  <hr>
  
  <p><b>Additional References from frameworks: </b></p>
  
  <p>PS: it wouldn't let me post the hyperlinks as hyperlinks.</p>
  
  <p>// HTTPBase.h (http://androidxref.com/source/xref/frameworks/base/media/libstagefright/include/HTTPBase.h)</p>
  
  <pre><code> 28 struct HTTPBase : public DataSource {
   29     enum Flags {
   30         // Don't log any URLs.
   31         kFlagIncognito = 1
   32     };
  </code></pre>
  
  <p>// HTTPLiveSource.h (http://androidxref.com/source/xref/frameworks/base/media/libmediaplayerservice/nuplayer/HTTPLiveSource.h)</p>
  
  <pre><code>        struct NuPlayer::HTTPLiveSource : public NuPlayer::Source {
   30     HTTPLiveSource(
   31             const char *url,
   32             const KeyedVector&lt;String8, String8&gt; *headers,
   33             bool uidValid = false,
   34             uid_t uid = 0);
   35 
   36     virtual void start();
   37 
   38     virtual status_t feedMoreTSData();
   39 
   40     virtual sp&lt;MetaData&gt; getFormat(bool audio);
   41     virtual status_t dequeueAccessUnit(bool audio, sp&lt;ABuffer&gt; *accessUnit);
   42 
   43     virtual status_t getDuration(int64_t *durationUs);
   44     virtual status_t seekTo(int64_t seekTimeUs);
   45     virtual bool isSeekable();
   46 
   47 protected:
   48     virtual ~HTTPLiveSource();
    51     enum Flags {
   52         // Don't log any URLs.
   53         kFlagIncognito = 1,
   54     };
   55 
   56     AString mURL;
   57     KeyedVector&lt;String8, String8&gt; mExtraHeaders;
   58     bool mUIDValid;
   59     uid_t mUID;
   60     uint32_t mFlags;
  </code></pre>
  
  <p>//HTTPLiveSession.h    (http://androidxref.com/source/xref/frameworks/base/media/libstagefright/include/LiveSession.h#36)</p>
  
  <pre><code> 33 struct LiveSession : public AHandler {
   34     enum Flags {
   35         // Don't log any URLs.
   36         kFlagIncognito = 1,
   37     };
   38     LiveSession(uint32_t flags = 0, bool uidValid = false, uid_t uid = 0);
  </code></pre>
  
  <p>AwesomePlayer
   140         INCOGNITO           = 0x8000,</p>
  
  <p>PreviewPlayerBase.h
  132         INCOGNITO           = 32768,</p>
  
  <p>//PreviewPlayerBase.cpp (http://androidxref.com/source/xref/frameworks/media/libvideoeditor/lvpp/PreviewPlayerBase.cpp)</p>
  
  <pre><code>247 status_t PreviewPlayerBase::setDataSource_l(
  248         const char *uri, const KeyedVector&lt;String8, String8&gt; *headers) {
  249     reset_l();
  250 
  251     mUri = uri;
  252 
  253     if (headers) {
  254         mUriHeaders = *headers;
  255 
  256         ssize_t index = mUriHeaders.indexOfKey(String8("x-hide-urls-from-log"));
  257         if (index &gt;= 0) {
  258             // Browser is in "incognito" mode, suppress logging URLs.
  259 
  260             // This isn't something that should be passed to the server.
  261             mUriHeaders.removeItemsAt(index);
  262 
  263             mFlags |= INCOGNITO;
  264         }
  265     }
  266 
  267     if (!(mFlags &amp; INCOGNITO)) {
  268         LOGI("setDataSource_l('%s')", mUri.string());
  269     } else {
  270         LOGI("setDataSource_l(URL suppressed)");
  271     }
  272 
  273     // The actual work will be done during preparation in the call to
  274     // ::finishSetDataSource_l to avoid blocking the calling thread in
  275     // setDataSource for any significant time.
  276 
  277     return OK;
  278 }
  279  
  
  
  
  
   30 struct ChromiumHTTPDataSource : public HTTPBase {
   31     ChromiumHTTPDataSource(uint32_t flags = 0);
   32 
   33     virtual status_t connect(
   34             const char *uri,
   35             const KeyedVector&lt;String8, String8&gt; *headers = NULL,
   36             off64_t offset = 0);
   37 
   38     virtual void disconnect();
   39 
   40     virtual status_t initCheck() const;
   41 
   42     virtual ssize_t readAt(off64_t offset, void *data, size_t size);
   43     virtual status_t getSize(off64_t *size);
   44     virtual uint32_t flags();
  </code></pre>