Commit f4eb85bc authored by Dianne Hackborn's avatar Dianne Hackborn

Start fragmentizing Manage Applications.

Change-Id: I0c3d6a358d0236893aba7257537ec32bfad4170d
parent 58524fc5
......@@ -382,6 +382,47 @@
</intent-filter>
</activity-alias>
<activity-alias android:name=".applications.ManageApplications"
android:label="@string/manageapplications_settings_title"
android:clearTaskOnLaunch="true"
android:targetActivity="Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MANAGE_PACKAGE_STORAGE" />
<action android:name="android.settings.MANAGE_APPLICATIONS_SETTINGS" />
<action android:name="android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
<category android:name="com.android.settings.SHORTCUT" />
</intent-filter>
</activity-alias>
<!-- Keep compatibility with old shortcuts. -->
<activity-alias android:name=".ManageApplications"
android:label="@string/manageapplications_settings_title"
android:clearTaskOnLaunch="true"
android:exported="true"
android:targetActivity="Settings">
</activity-alias>
<!-- Still need a top-level activity for showing app details. Aliasing
trick is so the code that is now a fragment can still be called
InstalledAppDetails. -->
<activity android:name=".applications.InstalledAppDetailsTop"
android:label="@string/application_info_label"
android:exported="true">
</activity>
<activity-alias android:name=".applications.InstalledAppDetails"
android:label="@string/application_info_label"
android:targetActivity=".applications.InstalledAppDetailsTop">
<intent-filter>
<action android:name="android.settings.APPLICATION_DETAILS_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="package" />
</intent-filter>
</activity-alias>
<!--
<activity android:name=".applications.ManageApplications"
android:label="@string/manageapplications_settings_title"
android:clearTaskOnLaunch="true"
......@@ -398,7 +439,6 @@
</intent-filter>
</activity>
<!-- Keep compatibility with old shortcuts. -->
<activity-alias android:name=".ManageApplications"
android:targetActivity=".applications.ManageApplications"
android:exported="true" />
......@@ -412,6 +452,7 @@
<data android:scheme="package" />
</intent-filter>
</activity>
-->
<!-- Provide direct entry into manage apps showing running services. -->
<activity-alias android:name=".RunningServices"
......
......@@ -5,4 +5,4 @@
-keep class com.android.settings.wifi.*Settings
-keep class com.android.settings.deviceinfo.*
-keep class com.android.settings.bluetooth.*
-keep class com.android.settings.applications.*
......@@ -44,11 +44,9 @@
</PreferenceScreen>
<PreferenceScreen
android:title="@string/manageapplications_settings_title"
android:summary="@string/manageapplications_settings_summary">
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.ManageApplications" />
android:fragment="com.android.settings.applications.ManageApplications"
android:title="@string/manageapplications_settings_title"
android:summary="@string/manageapplications_settings_summary">
</PreferenceScreen>
<PreferenceScreen
......
......@@ -17,6 +17,7 @@
package com.android.settings;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import java.util.List;
......@@ -34,6 +35,13 @@ public class Settings extends PreferenceActivity {
if (startingFragment != null && !onIsMultiPane()) {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
Bundle args = super.getIntent().getExtras();
if (args != null) {
args = new Bundle(args);
} else {
args = new Bundle();
}
args.putParcelable("intent", super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, super.getIntent().getExtras());
return modIntent;
}
......@@ -45,9 +53,14 @@ public class Settings extends PreferenceActivity {
* returns the class name to load as a fragment.
*/
private String getStartingFragmentClass(Intent intent) {
final String intentClass = intent.getComponent().getClassName();
String intentClass = intent.getComponent().getClassName();
if (intentClass.equals(getClass().getName())) return null;
if ("com.android.settings.ManageApplications".equals(intentClass)) {
// Old name of manage apps.
intentClass = com.android.settings.applications.ManageApplications.class.getName();
}
return intentClass;
}
......
package com.android.settings.applications;
import android.content.Intent;
import android.preference.PreferenceActivity;
public class InstalledAppDetailsTop extends PreferenceActivity {
@Override
public Intent getIntent() {
Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, InstalledAppDetails.class.getName());
return modIntent;
}
}
......@@ -433,7 +433,7 @@ public class RunningProcessesView extends FrameLayout
super(context, attrs);
}
public void doCreate(Bundle savedInstanceState, Object nonConfigurationInstace) {
public void doCreate(Bundle savedInstanceState) {
mAm = (ActivityManager)getContext().getSystemService(Context.ACTIVITY_SERVICE);
mState = RunningState.getInstance(getContext());
LayoutInflater inflater = (LayoutInflater)getContext().getSystemService(
......@@ -486,10 +486,6 @@ public class RunningProcessesView extends FrameLayout
return false;
}
public Object doRetainNonConfigurationInstance() {
return null;
}
void updateTimes() {
Iterator<ActiveItem> it = mActiveItems.values().iterator();
while (it.hasNext()) {
......
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