Merge branch 'master' into honeycomb-release
This commit is contained in:
@@ -52,7 +52,8 @@
|
||||
<activity android:name="Settings"
|
||||
android:label="@string/settings_label_launcher"
|
||||
android:taskAffinity="com.android.settings"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:launchMode="singleTask"
|
||||
>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -73,7 +74,7 @@
|
||||
<!-- Wireless Controls -->
|
||||
|
||||
<activity android:name="Settings$WirelessSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/wireless_networks_settings_title"
|
||||
>
|
||||
<intent-filter>
|
||||
@@ -93,7 +94,7 @@
|
||||
<!-- Top-level settings -->
|
||||
|
||||
<activity android:name="Settings$WifiSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/wifi_settings"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:clearTaskOnLaunch="true"
|
||||
@@ -188,7 +189,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$BluetoothSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/bluetooth_settings_title"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -209,7 +210,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$TetherSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -223,7 +224,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$VpnSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/vpn_settings_activity_title"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:clearTaskOnLaunch="true">
|
||||
@@ -241,7 +242,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$DateTimeSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/date_and_time" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -265,7 +266,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$LocalePickerActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/language_picker_title"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -281,7 +282,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$InputMethodAndLanguageSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/language_keyboard_settings_title"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -298,7 +299,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$InputMethodAndSubtypeEnablerActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/input_methods_and_subtype_enabler_title"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -324,7 +325,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$UserDictionarySettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/user_dict_settings_titlebar"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -342,7 +343,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$SoundSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/sound_settings"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -360,7 +361,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$DisplaySettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/display_settings"
|
||||
android:clearTaskOnLaunch="true"
|
||||
>
|
||||
@@ -379,7 +380,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$DockSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/dock_settings_title"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -429,7 +430,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$ApplicationSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/applications_settings_header">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -444,7 +445,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$ManageApplicationsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/manageapplications_settings_title"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -490,7 +491,7 @@
|
||||
|
||||
<!-- Provide direct entry into manage apps showing running services. -->
|
||||
<activity android:name="Settings$RunningServicesActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/runningservices_settings_title">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -507,7 +508,7 @@
|
||||
|
||||
<!-- Provide direct entry into manage apps showing running services. -->
|
||||
<activity android:name="Settings$StorageUseActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/storageuse_settings_title">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -523,7 +524,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$SecuritySettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/location_security_settings_title"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:clearTaskOnLaunch="true">
|
||||
@@ -551,7 +552,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$PrivacySettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/privacy_settings_title"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:clearTaskOnLaunch="true">
|
||||
@@ -603,7 +604,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$AccessibilitySettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/accessibility_settings_title">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -618,7 +619,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$VoiceInputOutputSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/voice_input_output_settings"
|
||||
android:targetActivity="Settings">
|
||||
<intent-filter>
|
||||
@@ -686,7 +687,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$StorageSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/storage_settings_title">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -742,7 +743,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$DevelopmentSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/development_settings_title"
|
||||
android:clearTaskOnLaunch="true">
|
||||
<intent-filter>
|
||||
@@ -917,7 +918,7 @@
|
||||
</activity>
|
||||
|
||||
<activity android:name="Settings$PowerUsageSummaryActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/storage_settings_title">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -933,7 +934,7 @@
|
||||
|
||||
<activity
|
||||
android:name="Settings$ManageAccountsSettingsActivity"
|
||||
android:theme="@android:style/Theme.Holo.Extended"
|
||||
android:theme="@android:style/Theme.Holo"
|
||||
android:label="@string/sync_settings">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -2408,6 +2408,8 @@ found in the list of installed applications.</string>
|
||||
<string name="power_usage_summary_title">Battery use</string>
|
||||
<!-- Activity title summary for App Fuel Gauge summary -->
|
||||
<string name="power_usage_summary">What has been using the battery</string>
|
||||
<!-- Message to show when battery usage data is not available [CHAR LIMIT=30] -->
|
||||
<string name="power_usage_not_available">Battery usage data not available</string>
|
||||
<!-- Battery usage since unplugged -->
|
||||
<string name="battery_since_unplugged">Battery use since unplugged</string>
|
||||
<!-- Battery usage since user reset the stats -->
|
||||
|
||||
@@ -38,6 +38,7 @@ public class Settings extends PreferenceActivity {
|
||||
|
||||
private String mFragmentClass;
|
||||
private int mTopLevelHeaderId;
|
||||
private Header mFirstHeader;
|
||||
|
||||
// TODO: Update Call Settings based on airplane mode state.
|
||||
|
||||
@@ -52,6 +53,17 @@ public class Settings extends PreferenceActivity {
|
||||
highlightHeader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
|
||||
// If it is not launched from history, then reset to top-level
|
||||
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) == 0
|
||||
&& mFirstHeader != null) {
|
||||
switchToHeader(mFirstHeader);
|
||||
}
|
||||
}
|
||||
|
||||
private void highlightHeader() {
|
||||
if (mTopLevelHeaderId != 0) {
|
||||
Integer index = mHeaderIndexMap.get(mTopLevelHeaderId);
|
||||
@@ -143,6 +155,8 @@ public class Settings extends PreferenceActivity {
|
||||
}
|
||||
// Increment if the current one wasn't removed by the Utils code.
|
||||
if (target.get(i) == header) {
|
||||
// Hold on to the first header, when we need to reset to the top-level
|
||||
if (i == 0) mFirstHeader = header;
|
||||
mHeaderIndexMap.put(id, i);
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,13 @@
|
||||
|
||||
package com.android.settings.fuelgauge;
|
||||
|
||||
import com.android.internal.app.IBatteryStats;
|
||||
import com.android.internal.os.BatteryStatsImpl;
|
||||
import com.android.internal.os.PowerProfile;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.applications.InstalledAppDetails;
|
||||
import com.android.settings.fuelgauge.PowerUsageDetail.DrainType;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.hardware.SensorManager;
|
||||
@@ -40,13 +47,6 @@ import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.android.internal.app.IBatteryStats;
|
||||
import com.android.internal.os.BatteryStatsImpl;
|
||||
import com.android.internal.os.PowerProfile;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.applications.InstalledAppDetails;
|
||||
import com.android.settings.fuelgauge.PowerUsageDetail.DrainType;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
@@ -309,6 +309,12 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private void addNotAvailableMessage() {
|
||||
Preference notAvailable = new Preference(getActivity());
|
||||
notAvailable.setTitle(R.string.power_usage_not_available);
|
||||
mAppListGroup.addPreference(notAvailable);
|
||||
}
|
||||
|
||||
private void refreshStats() {
|
||||
if (mStats == null) {
|
||||
load();
|
||||
@@ -323,15 +329,19 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable {
|
||||
mUsageList.clear();
|
||||
mWifiSippers.clear();
|
||||
mBluetoothSippers.clear();
|
||||
processAppUsage();
|
||||
processMiscUsage();
|
||||
|
||||
mAppListGroup.setOrderingAsAdded(false);
|
||||
|
||||
BatteryHistoryPreference hist = new BatteryHistoryPreference(getActivity(), mStats);
|
||||
hist.setOrder(-1);
|
||||
mAppListGroup.addPreference(hist);
|
||||
|
||||
if (mPowerProfile.getAveragePower(PowerProfile.POWER_SCREEN_FULL) < 10) {
|
||||
addNotAvailableMessage();
|
||||
return;
|
||||
}
|
||||
processAppUsage();
|
||||
processMiscUsage();
|
||||
|
||||
Collections.sort(mUsageList);
|
||||
for (BatterySipper sipper : mUsageList) {
|
||||
if (sipper.getSortValue() < MIN_POWER_THRESHOLD) continue;
|
||||
|
||||
@@ -45,10 +45,6 @@ import java.util.EnumMap;
|
||||
public class WifiSettingsForSetupWizardXL extends Activity implements OnClickListener {
|
||||
private static final String TAG = "SetupWizard";
|
||||
|
||||
// We limit the number of showable access points so that the ListView won't become larger
|
||||
// than the screen.
|
||||
private static int MAX_MENU_COUNT_IN_XL = 8;
|
||||
|
||||
private static final EnumMap<DetailedState, DetailedState> stateMap =
|
||||
new EnumMap<DetailedState, DetailedState>(DetailedState.class);
|
||||
|
||||
@@ -441,14 +437,9 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
|
||||
*/
|
||||
/* package */ void onAccessPointsUpdated(
|
||||
PreferenceCategory holder, Collection<AccessPoint> accessPoints) {
|
||||
int count = MAX_MENU_COUNT_IN_XL;
|
||||
for (AccessPoint accessPoint : accessPoints) {
|
||||
accessPoint.setLayoutResource(R.layout.custom_preference);
|
||||
holder.addPreference(accessPoint);
|
||||
count--;
|
||||
if (count <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user