"...packages_providers_downloadprovider.git" did not exist on "3074179d22e9d7e1f506b85dca866301a6206156"
Commit 7b182d70 authored by John Reck's avatar John Reck
Browse files

Handle MANAGE_NETWORK_USAGE intent

 Bug: 4726553

Change-Id: I790ff56ae0dceb742a225d8b1edd7076997a517f
parent 180d76d9
......@@ -162,6 +162,10 @@
</activity>
<activity android:name="BrowserPreferencesPage" android:label="@string/menu_preferences">
<intent-filter>
<action android:name="android.intent.action.MANAGE_NETWORK_USAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="BookmarkSearch"
......
......@@ -16,18 +16,21 @@
package com.android.browser;
import com.android.browser.preferences.DebugPreferencesFragment;
import android.app.ActionBar;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.MenuItem;
import com.android.browser.preferences.BandwidthPreferencesFragment;
import com.android.browser.preferences.DebugPreferencesFragment;
import java.util.List;
public class BrowserPreferencesPage extends PreferenceActivity {
public static final String CURRENT_PAGE = "currentPage";
private List<Header> mHeaders;
@Override
public void onCreate(Bundle icicle) {
......@@ -53,6 +56,21 @@ public class BrowserPreferencesPage extends PreferenceActivity {
debug.fragment = DebugPreferencesFragment.class.getName();
target.add(debug);
}
mHeaders = target;
}
@Override
public Header onGetInitialHeader() {
String action = getIntent().getAction();
if (Intent.ACTION_MANAGE_NETWORK_USAGE.equals(action)) {
String fragName = BandwidthPreferencesFragment.class.getName();
for (Header h : mHeaders) {
if (fragName.equals(h.fragment)) {
return h;
}
}
}
return super.onGetInitialHeader();
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment