Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb034652 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Implement all of the infrastructure for configuring wallpapers.

Actually being able to configure a wallpaper relies on additional
work in the launcher and wallpapers that will be in another change.
Also note that this breaks all existing wallpapers, since they now
need to include a meta-data item about themselves.  This also
will be fixed in another change.

Change-Id: I97d2c2bd07237abc32f92b9147c32530a2f73c71
parent 9c93007b
Loading
Loading
Loading
Loading
+206 −0
Original line number Diff line number Diff line
@@ -10615,6 +10615,17 @@
 visibility="public"
>
</field>
<field name="screen_background_dark_transparent"
 type="int"
 transient="false"
 volatile="false"
 value="17301673"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="screen_background_light"
 type="int"
 transient="false"
@@ -18115,6 +18126,16 @@
 visibility="public"
>
</field>
<field name="uid"
 type="int"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="ActivityManager.RunningServiceInfo"
 extends="java.lang.Object"
@@ -34398,6 +34419,17 @@
 visibility="public"
>
</field>
<field name="EXTRA_INITIAL_INTENTS"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.intent.extra.INITIAL_INTENTS&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="EXTRA_INTENT"
 type="java.lang.String"
 transient="false"
@@ -38233,6 +38265,155 @@
>
</field>
</class>
<class name="LabeledIntent"
 extends="android.content.Intent"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="LabeledIntent"
 type="android.content.pm.LabeledIntent"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="origIntent" type="android.content.Intent">
</parameter>
<parameter name="sourcePackage" type="java.lang.String">
</parameter>
<parameter name="labelRes" type="int">
</parameter>
<parameter name="icon" type="int">
</parameter>
</constructor>
<constructor name="LabeledIntent"
 type="android.content.pm.LabeledIntent"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="origIntent" type="android.content.Intent">
</parameter>
<parameter name="sourcePackage" type="java.lang.String">
</parameter>
<parameter name="nonLocalizedLabel" type="java.lang.CharSequence">
</parameter>
<parameter name="icon" type="int">
</parameter>
</constructor>
<constructor name="LabeledIntent"
 type="android.content.pm.LabeledIntent"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="sourcePackage" type="java.lang.String">
</parameter>
<parameter name="labelRes" type="int">
</parameter>
<parameter name="icon" type="int">
</parameter>
</constructor>
<constructor name="LabeledIntent"
 type="android.content.pm.LabeledIntent"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="sourcePackage" type="java.lang.String">
</parameter>
<parameter name="nonLocalizedLabel" type="java.lang.CharSequence">
</parameter>
<parameter name="icon" type="int">
</parameter>
</constructor>
<method name="getIconResource"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getLabelResource"
 return="int"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getNonLocalizedLabel"
 return="java.lang.CharSequence"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="getSourcePackage"
 return="java.lang.String"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="loadIcon"
 return="android.graphics.drawable.Drawable"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="pm" type="android.content.pm.PackageManager">
</parameter>
</method>
<method name="loadLabel"
 return="java.lang.CharSequence"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="pm" type="android.content.pm.PackageManager">
</parameter>
</method>
<field name="CREATOR"
 type="android.os.Parcelable.Creator"
 transient="false"
 volatile="false"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</class>
<class name="PackageInfo"
 extends="java.lang.Object"
 abstract="false"
@@ -40670,6 +40851,16 @@
 visibility="public"
>
</field>
<field name="resolvePackageName"
 type="java.lang.String"
 transient="false"
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="serviceInfo"
 type="android.content.pm.ServiceInfo"
 transient="false"
@@ -40766,6 +40957,21 @@
 visibility="public"
>
</method>
<method name="dump"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="pw" type="android.util.Printer">
</parameter>
<parameter name="prefix" type="java.lang.String">
</parameter>
</method>
<field name="CREATOR"
 type="android.os.Parcelable.Creator"
 transient="false"
+7 −0
Original line number Diff line number Diff line
@@ -684,6 +684,11 @@ public class ActivityManager {
         */
        public int pid;
        
        /**
         * The user id of this process.
         */
        public int uid;
        
        public String pkgList[];
        
        /**
@@ -797,6 +802,7 @@ public class ActivityManager {
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(processName);
            dest.writeInt(pid);
            dest.writeInt(uid);
            dest.writeStringArray(pkgList);
            dest.writeInt(importance);
            dest.writeInt(lru);
@@ -808,6 +814,7 @@ public class ActivityManager {
        public void readFromParcel(Parcel source) {
            processName = source.readString();
            pid = source.readInt();
            uid = source.readInt();
            pkgList = source.readStringArray();
            importance = source.readInt();
            lru = source.readInt();
+6 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.app;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.app.IWallpaperManagerCallback;
import android.app.WallpaperInfo;
import android.content.ComponentName;

/** @hide */
@@ -40,6 +41,11 @@ interface IWallpaperManager {
    ParcelFileDescriptor getWallpaper(IWallpaperManagerCallback cb,
            out Bundle outParams);
    
    /**
     * Get information about a live wallpaper.
     */
    WallpaperInfo getWallpaperInfo();
    
    /**
     * Clear the wallpaper.
     */
+15 −7
Original line number Diff line number Diff line
@@ -53,9 +53,9 @@ import java.util.List;
 *
 */
public abstract class LauncherActivity extends ListActivity {

    Intent mIntent;
    PackageManager mPackageManager;
    IconResizer mIconResizer;
    
    /**
     * An item in the list
@@ -77,7 +77,9 @@ public abstract class LauncherActivity extends ListActivity {
                label = resolveInfo.activityInfo.name;
            }
            
            if (resizer != null) {
                icon = resizer.createIconThumbnail(resolveInfo.loadIcon(pm));
            }
            packageName = ci.applicationInfo.packageName;
            className = ci.name;
        }
@@ -93,13 +95,15 @@ public abstract class LauncherActivity extends ListActivity {
        private final Object lock = new Object();
        private ArrayList<ListItem> mOriginalValues;

        protected final IconResizer mIconResizer;
        protected final LayoutInflater mInflater;

        protected List<ListItem> mActivitiesList;

        private Filter mFilter;
        
        public ActivityAdapter() {
        public ActivityAdapter(IconResizer resizer) {
            mIconResizer = resizer;
            mInflater = (LayoutInflater) LauncherActivity.this.getSystemService(
                    Context.LAYOUT_INFLATER_SERVICE);
            mActivitiesList = makeListItems();
@@ -154,6 +158,10 @@ public abstract class LauncherActivity extends ListActivity {
        private void bindView(View view, ListItem item) {
            TextView text = (TextView) view;
            text.setText(item.label);
            if (item.icon == null) {
                item.icon = mIconResizer.createIconThumbnail(
                        item.resolveInfo.loadIcon(getPackageManager()));
            }
            text.setCompoundDrawablesWithIntrinsicBounds(item.icon, null, null, null);
        }
        
@@ -330,9 +338,11 @@ public abstract class LauncherActivity extends ListActivity {
        setProgressBarIndeterminateVisibility(true);
        onSetContentView();
            
        mIconResizer = new IconResizer();
        
        mIntent = new Intent(getTargetIntent());
        mIntent.setComponent(null);
        mAdapter = new ActivityAdapter();
        mAdapter = new ActivityAdapter(mIconResizer);
        
        setListAdapter(mAdapter);
        getListView().setTextFilterEnabled(true);
@@ -398,13 +408,11 @@ public abstract class LauncherActivity extends ListActivity {
        List<ResolveInfo> list = onQueryPackageManager(mIntent);
        Collections.sort(list, new ResolveInfo.DisplayNameComparator(mPackageManager));
        
        IconResizer resizer = new IconResizer();
        
        ArrayList<ListItem> result = new ArrayList<ListItem>(list.size());
        int listSize = list.size();
        for (int i = 0; i < listSize; i++) {
            ResolveInfo resolveInfo = list.get(i);
            result.add(new ListItem(mPackageManager, resolveInfo, resizer));
            result.add(new ListItem(mPackageManager, resolveInfo, null));
        }

        return result;
+19 −0
Original line number Diff line number Diff line
/*
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License"); 
** you may not use this file except in compliance with the License. 
** You may obtain a copy of the License at 
**
**     http://www.apache.org/licenses/LICENSE-2.0 
**
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/

package android.app;

parcelable WallpaperInfo;
Loading