diff options
25 files changed, 50 insertions, 402 deletions
diff --git a/api/current.xml b/api/current.xml index bfd6e608d593..89d769e8eca2 100644 --- a/api/current.xml +++ b/api/current.xml @@ -26633,17 +26633,6 @@ visibility="public" > </field> -<field name="FLAG_HIGH_PRIORITY" - type="int" - transient="false" - volatile="false" - value="128" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="FLAG_INSISTENT" type="int" transient="false" @@ -46071,17 +46060,6 @@ visibility="public" > </field> -<field name="FLAG_IMMERSIVE" - type="int" - transient="false" - volatile="false" - value="512" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</field> <field name="FLAG_MULTIPROCESS" type="int" transient="false" diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 773ff7c58f31..f7a9a1848f8d 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -3740,48 +3740,6 @@ public class Activity extends ContextThemeWrapper return null; } - /** - * Bit indicating that this activity is "immersive" and should not be - * interrupted by notifications if possible. - * - * This value is initially set by the manifest property - * <code>android:immersive</code> but may be changed at runtime by - * {@link #setImmersive}. - * - * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE - * @hide - */ - public boolean isImmersive() { - try { - return ActivityManagerNative.getDefault().isImmersive(mToken); - } catch (RemoteException e) { - return false; - } - } - - /** - * Adjust the current immersive mode setting. - * - * Note that changing this value will have no effect on the activity's - * {@link android.content.pm.ActivityInfo} structure; that is, if - * <code>android:immersive</code> is set to <code>true</code> - * in the application's manifest entry for this activity, the {@link - * android.content.pm.ActivityInfo#flags ActivityInfo.flags} member will - * always have its {@link android.content.pm.ActivityInfo#FLAG_IMMERSIVE - * FLAG_IMMERSIVE} bit set. - * - * @see #isImmersive - * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE - * @hide - */ - public void setImmersive(boolean i) { - try { - ActivityManagerNative.getDefault().setImmersive(mToken, i); - } catch (RemoteException e) { - // pass - } - } - // ------------------ Internal API ------------------ final void setParent(Activity parent) { diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index 1d1b4dc070b6..a1808377c69c 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -1261,32 +1261,6 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } - case IS_IMMERSIVE_TRANSACTION: { - data.enforceInterface(IActivityManager.descriptor); - IBinder token = data.readStrongBinder(); - boolean isit = isImmersive(token); - reply.writeNoException(); - reply.writeInt(isit ? 1 : 0); - return true; - } - - case SET_IMMERSIVE_TRANSACTION: { - data.enforceInterface(IActivityManager.descriptor); - IBinder token = data.readStrongBinder(); - boolean imm = data.readInt() == 1; - setImmersive(token, imm); - reply.writeNoException(); - return true; - } - - case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { - data.enforceInterface(IActivityManager.descriptor); - boolean isit = isTopActivityImmersive(); - reply.writeNoException(); - reply.writeInt(isit ? 1 : 0); - return true; - } - case CRASH_APPLICATION_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); int uid = data.readInt(); @@ -2858,46 +2832,6 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); } - public void setImmersive(IBinder token, boolean immersive) - throws RemoteException { - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); - data.writeInterfaceToken(IActivityManager.descriptor); - data.writeStrongBinder(token); - data.writeInt(immersive ? 1 : 0); - mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); - reply.readException(); - data.recycle(); - reply.recycle(); - } - - public boolean isImmersive(IBinder token) - throws RemoteException { - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); - data.writeInterfaceToken(IActivityManager.descriptor); - data.writeStrongBinder(token); - mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); - reply.readException(); - boolean res = reply.readInt() == 1; - data.recycle(); - reply.recycle(); - return res; - } - - public boolean isTopActivityImmersive() - throws RemoteException { - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); - data.writeInterfaceToken(IActivityManager.descriptor); - mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); - reply.readException(); - boolean res = reply.readInt() == 1; - data.recycle(); - reply.recycle(); - return res; - } - public void crashApplication(int uid, int initialPid, String packageName, String message) throws RemoteException { Parcel data = Parcel.obtain(); diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index 664cf18b272a..f9bd46134ccb 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -311,10 +311,6 @@ public interface IActivityManager extends IInterface { public void finishHeavyWeightApp() throws RemoteException; - public void setImmersive(IBinder token, boolean immersive) throws RemoteException; - public boolean isImmersive(IBinder token) throws RemoteException; - public boolean isTopActivityImmersive() throws RemoteException; - public void crashApplication(int uid, int initialPid, String packageName, String message) throws RemoteException; diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 83a202409df0..5525ce3d85af 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -112,8 +112,6 @@ public class Notification implements Parcelable * An intent to launch instead of posting the notification to the status bar. Only for use with * extremely high-priority notifications demanding the user's attention, such as an incoming * call (handled in the core Android Phone app with a full-screen Activity). - * Use with {@link #FLAG_HIGH_PRIORITY} to ensure that this notification will reach the user - * even when other notifications are suppressed. */ public PendingIntent fullScreenIntent; @@ -273,14 +271,6 @@ public class Notification implements Parcelable */ public static final int FLAG_FOREGROUND_SERVICE = 0x00000040; - /** - * Bit to be bitwise-ored into the {@link #flags} field that should be set if this notification - * represents a high-priority event that may be shown to the user even if notifications are - * otherwise unavailable (that is, when the status bar is hidden). This flag is ideally used - * in conjunction with {@link #fullScreenIntent}. - */ - public static final int FLAG_HIGH_PRIORITY = 0x00000080; - public int flags; /** @@ -549,9 +539,6 @@ public class Notification implements Parcelable sb.append(Integer.toHexString(this.defaults)); sb.append(",flags=0x"); sb.append(Integer.toHexString(this.flags)); - if ((this.flags & FLAG_HIGH_PRIORITY) != 0) { - sb.append("!!!1!one!"); - } sb.append(")"); return sb.toString(); } diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 364c91e81d68..395c392b12b2 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -149,22 +149,6 @@ public class ActivityInfo extends ComponentInfo * {@link android.R.attr#finishOnCloseSystemDialogs} attribute. */ public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 0x0100; - /** - * Bit in {@link #flags} corresponding to an immersive activity - * that wishes not to be interrupted by notifications. - * Applications that hide the system notification bar with - * {@link android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN} - * may still be interrupted by high-priority notifications; for example, an - * incoming phone call may use - * {@link android.app.Notification#fullScreenIntent fullScreenIntent} - * to present a full-screen in-call activity to the user, pausing the - * current activity as a side-effect. An activity with - * {@link #FLAG_IMMERSIVE} set, however, will not be interrupted; the - * notification may be shown in some other way (such as a small floating - * "toast" window). - * {@see android.app.Notification#FLAG_HIGH_PRIORITY} - */ - public static final int FLAG_IMMERSIVE = 0x0200; /** * Options that have been set in the activity declaration in the * manifest. @@ -175,7 +159,6 @@ public class ActivityInfo extends ComponentInfo * {@link #FLAG_STATE_NOT_NEEDED}, {@link #FLAG_EXCLUDE_FROM_RECENTS}, * {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY}, * {@link #FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS}, - * {@link #FLAG_IMMERSIVE} */ public int flags; diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 2a39dc002eb6..e20cb5ee4134 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -1883,12 +1883,6 @@ public class PackageParser { a.info.flags |= ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS; } - if (sa.getBoolean( - com.android.internal.R.styleable.AndroidManifestActivity_immersive, - false)) { - a.info.flags |= ActivityInfo.FLAG_IMMERSIVE; - } - if (!receiver) { a.info.launchMode = sa.getInt( com.android.internal.R.styleable.AndroidManifestActivity_launchMode, diff --git a/core/java/android/webkit/PluginManager.java b/core/java/android/webkit/PluginManager.java index cdcb662e057c..e5eeb8cf59c5 100644 --- a/core/java/android/webkit/PluginManager.java +++ b/core/java/android/webkit/PluginManager.java @@ -21,9 +21,9 @@ import java.util.List; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; -import android.app.Service; import android.content.Context; import android.content.Intent; +import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; @@ -59,7 +59,9 @@ public class PluginManager { */ public static final String PLUGIN_PERMISSION = "android.webkit.permission.PLUGIN"; - private static final String LOGTAG = "webkit"; + private static final String LOGTAG = "PluginManager"; + + private static final String PLUGIN_SYSTEM_LIB = "/system/lib/plugins/"; private static final String PLUGIN_TYPE = "type"; private static final String TYPE_NATIVE = "native"; @@ -111,9 +113,8 @@ public class PluginManager { ArrayList<String> directories = new ArrayList<String>(); PackageManager pm = mContext.getPackageManager(); - List<ResolveInfo> plugins = pm.queryIntentServices(new Intent( - PLUGIN_ACTION), PackageManager.GET_SERVICES - | PackageManager.GET_META_DATA); + List<ResolveInfo> plugins = pm.queryIntentServices(new Intent(PLUGIN_ACTION), + PackageManager.GET_SERVICES | PackageManager.GET_META_DATA); synchronized(mPackageInfoCache) { @@ -143,10 +144,19 @@ public class PluginManager { continue; } - // check if their is a conflict in the lib directory names + /* + * find the location of the plugin's shared library. The default + * is to assume the app is either a user installed app or an + * updated system app. In both of these cases the library is + * stored in the app's data directory. + */ String directory = pkgInfo.applicationInfo.dataDir + "/lib"; - if (directories.contains(directory)) { - continue; + final int appFlags = pkgInfo.applicationInfo.flags; + final int updatedSystemFlags = ApplicationInfo.FLAG_SYSTEM | + ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; + // preloaded system app with no user updates + if ((appFlags & updatedSystemFlags) == ApplicationInfo.FLAG_SYSTEM) { + directory = PLUGIN_SYSTEM_LIB + pkgInfo.packageName; } // check if the plugin has the required permissions @@ -236,7 +246,7 @@ public class PluginManager { // must be synchronized to ensure the consistency of the cache synchronized(mPackageInfoCache) { for (PackageInfo pkgInfo : mPackageInfoCache) { - if (pluginLib.startsWith(pkgInfo.applicationInfo.dataDir)) { + if (pluginLib.contains(pkgInfo.packageName)) { return pkgInfo.packageName; } } diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 02a601a491ba..af04117db6c7 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -88,13 +88,6 @@ <item name="windowExitAnimation">@anim/status_bar_exit</item> </style> - <!-- {@hide} --> - <style name="Animation.StatusBar.IntruderAlert" - parent="@android:style/Animation.StatusBar"> - <item name="android:windowEnterAnimation">@anim/priority_alert_enter</item> - <item name="android:windowExitAnimation">@anim/priority_alert_exit</item> - </style> - <!-- Standard animations for a translucent window or activity. This style is <em>not<em> used by default for the translucent theme (since translucent activities are a special case that have no diff --git a/include/media/stagefright/foundation/ALooper.h b/include/media/stagefright/foundation/ALooper.h index 153ead9a4bd7..70e0c5e6b392 100644 --- a/include/media/stagefright/foundation/ALooper.h +++ b/include/media/stagefright/foundation/ALooper.h @@ -19,6 +19,7 @@ #define A_LOOPER_H_ #include <media/stagefright/foundation/ABase.h> +#include <media/stagefright/foundation/AString.h> #include <utils/Errors.h> #include <utils/KeyedVector.h> #include <utils/List.h> @@ -36,6 +37,9 @@ struct ALooper : public RefBase { ALooper(); + // Takes effect in a subsequent call to start(). + void setName(const char *name); + handler_id registerHandler(const sp<AHandler> &handler); void unregisterHandler(handler_id handlerID); @@ -63,6 +67,8 @@ private: Mutex mLock; Condition mQueueChangedCondition; + AString mName; + List<Event> mEventQueue; struct LooperThread; diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 7e25e8867f0b..7daac96b0a48 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -1241,6 +1241,7 @@ status_t AwesomePlayer::finishSetDataSource_l() { } else if (!strncmp("rtsp://gtalk/", mUri.string(), 13)) { if (mLooper == NULL) { mLooper = new ALooper; + mLooper->setName("gtalk rtp"); mLooper->start( false /* runOnCallingThread */, false /* canCallJava */, @@ -1352,6 +1353,7 @@ status_t AwesomePlayer::finishSetDataSource_l() { } else if (!strncasecmp("rtsp://", mUri.string(), 7)) { if (mLooper == NULL) { mLooper = new ALooper; + mLooper->setName("rtsp"); mLooper->start(); } mRTSPController = new ARTSPController(mLooper); diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp index c02b7f3c4e7f..9171aab8c42d 100644 --- a/media/libstagefright/NuCachedSource2.cpp +++ b/media/libstagefright/NuCachedSource2.cpp @@ -180,6 +180,7 @@ NuCachedSource2::NuCachedSource2(const sp<DataSource> &source) mLastAccessPos(0), mFetching(true), mLastFetchTimeUs(-1) { + mLooper->setName("NuCachedSource2"); mLooper->registerHandler(mReflector); mLooper->start(); diff --git a/media/libstagefright/foundation/ALooper.cpp b/media/libstagefright/foundation/ALooper.cpp index 77afb010e630..b7087f83df38 100644 --- a/media/libstagefright/foundation/ALooper.cpp +++ b/media/libstagefright/foundation/ALooper.cpp @@ -65,6 +65,10 @@ ALooper::~ALooper() { stop(); } +void ALooper::setName(const char *name) { + mName = name; +} + ALooper::handler_id ALooper::registerHandler(const sp<AHandler> &handler) { return gLooperRoster.registerHandler(this, handler); } @@ -100,7 +104,8 @@ status_t ALooper::start( mThread = new LooperThread(this, canCallJava); - status_t err = mThread->run("ALooper", priority); + status_t err = mThread->run( + mName.empty() ? "ALooper" : mName.c_str(), priority); if (err != OK) { mThread.clear(); } diff --git a/media/libstagefright/rtsp/ARTPWriter.cpp b/media/libstagefright/rtsp/ARTPWriter.cpp index d4eed7ce6efb..ce1ee0e8c358 100644 --- a/media/libstagefright/rtsp/ARTPWriter.cpp +++ b/media/libstagefright/rtsp/ARTPWriter.cpp @@ -31,6 +31,7 @@ ARTPWriter::ARTPWriter(int fd) mReflector(new AHandlerReflector<ARTPWriter>(this)) { CHECK_GE(fd, 0); + mLooper->setName("rtp writer"); mLooper->registerHandler(mReflector); mLooper->start(); diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h index 0685a4732af9..affacc86cb2f 100644 --- a/media/libstagefright/rtsp/MyHandler.h +++ b/media/libstagefright/rtsp/MyHandler.h @@ -76,7 +76,7 @@ struct MyHandler : public AHandler { mFirstAccessUnitNTP(0), mNumAccessUnitsReceived(0), mCheckPending(false) { - + mNetLooper->setName("rtsp net"); mNetLooper->start(false /* runOnCallingThread */, false /* canCallJava */, PRIORITY_HIGHEST); @@ -389,7 +389,7 @@ struct MyHandler : public AHandler { } mNumAccessUnitsReceived = 0; - msg->post(500000); + msg->post(1000000); break; } @@ -400,7 +400,7 @@ struct MyHandler : public AHandler { if (!mCheckPending) { mCheckPending = true; sp<AMessage> check = new AMessage('chek', id()); - check->post(500000); + check->post(1000000); } size_t trackIndex; diff --git a/packages/SystemUI/res/drawable-hdpi/alert_bar_background_normal.9.png b/packages/SystemUI/res/drawable-hdpi/alert_bar_background_normal.9.png Binary files differdeleted file mode 100644 index bc127bde4ad1..000000000000 --- a/packages/SystemUI/res/drawable-hdpi/alert_bar_background_normal.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-hdpi/alert_bar_background_pressed.9.png b/packages/SystemUI/res/drawable-hdpi/alert_bar_background_pressed.9.png Binary files differdeleted file mode 100644 index 59af8043f073..000000000000 --- a/packages/SystemUI/res/drawable-hdpi/alert_bar_background_pressed.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/alert_bar_background_normal.9.png b/packages/SystemUI/res/drawable-mdpi/alert_bar_background_normal.9.png Binary files differdeleted file mode 100644 index 258de13c1426..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/alert_bar_background_normal.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/alert_bar_background_pressed.9.png b/packages/SystemUI/res/drawable-mdpi/alert_bar_background_pressed.9.png Binary files differdeleted file mode 100644 index 258de13c1426..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/alert_bar_background_pressed.9.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable/alert_bar_background.xml b/packages/SystemUI/res/drawable/alert_bar_background.xml deleted file mode 100644 index 24b6aa326096..000000000000 --- a/packages/SystemUI/res/drawable/alert_bar_background.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2008 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. ---> - -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" - android:drawable="@drawable/alert_bar_background_pressed" /> - <item - android:drawable="@drawable/alert_bar_background_normal" /> -</selector> - diff --git a/packages/SystemUI/res/layout/intruder_alert.xml b/packages/SystemUI/res/layout/intruder_alert.xml deleted file mode 100644 index ba4a77471ef0..000000000000 --- a/packages/SystemUI/res/layout/intruder_alert.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/* apps/common/assets/default/default/skins/StatusBar.xml -** -** Copyright 2006, 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. -*/ ---> - -<!-- android:background="@drawable/status_bar_closed_default_background" --> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_height="32dip" - android:layout_width="match_parent" - android:paddingLeft="8dip" - android:paddingRight="8dip" - > - - <LinearLayout - android:id="@+id/intruder_alert_content" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="center" - android:animationCache="false" - android:orientation="horizontal" - android:background="@drawable/alert_bar_background" - android:clickable="true" - android:focusable="true" - android:descendantFocusability="afterDescendants" - > - - <ImageView - android:id="@+id/alertIcon" - android:layout_width="25dip" - android:layout_height="25dip" - android:layout_marginLeft="6dip" - android:layout_marginRight="8dip" - /> - <TextView - android:id="@+id/alertText" - android:textAppearance="@style/TextAppearance.StatusBar.IntruderAlert" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:singleLine="true" - /> - </LinearLayout> -</FrameLayout> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java index a47415ef1f0f..8f2da7abd794 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java @@ -91,11 +91,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks private static final int MSG_ANIMATE = 1000; private static final int MSG_ANIMATE_REVEAL = 1001; - private static final int MSG_SHOW_INTRUDER = 1002; - private static final int MSG_HIDE_INTRUDER = 1003; - - // will likely move to a resource or other tunable param at some point - private static final int INTRUDER_ALERT_DECAY_MS = 10000; StatusBarPolicy mIconPolicy; @@ -247,9 +242,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks // we're never destroyed } - // for immersive activities - private View mIntruderAlertView; - /** * Nobody binds to us. */ @@ -270,10 +262,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks R.layout.status_bar_expanded, null); expanded.mService = this; - mIntruderAlertView = View.inflate(context, R.layout.intruder_alert, null); - mIntruderAlertView.setVisibility(View.GONE); - mIntruderAlertView.setClickable(true); - StatusBarView sb = (StatusBarView)View.inflate(context, R.layout.status_bar, null); sb.mService = this; @@ -354,23 +342,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks // TODO lp.windowAnimations = R.style.Animation_StatusBar; WindowManagerImpl.getDefault().addView(view, lp); - - lp = new WindowManager.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.WRAP_CONTENT, - WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, - WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN - | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS - | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL - | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE - | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, - PixelFormat.TRANSLUCENT); - lp.gravity = Gravity.TOP | Gravity.FILL_HORIZONTAL; - lp.y += height * 1.5; // FIXME - lp.setTitle("IntruderAlert"); - lp.windowAnimations = com.android.internal.R.style.Animation_StatusBar_IntruderAlert; - - WindowManagerImpl.getDefault().addView(mIntruderAlertView, lp); } public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) { @@ -395,55 +366,23 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks } public void addNotification(IBinder key, StatusBarNotification notification) { - StatusBarIconView iconView = addNotificationViews(key, notification); - if (iconView == null) return; - - boolean immersive = false; - try { - immersive = ActivityManagerNative.getDefault().isTopActivityImmersive(); - Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive")); - } catch (RemoteException ex) { - } - if (immersive) { - if ((notification.notification.flags & Notification.FLAG_HIGH_PRIORITY) != 0) { - Slog.d(TAG, "Presenting high-priority notification in immersive activity"); - // @@@ special new transient ticker mode - // 1. Populate mIntruderAlertView - - ImageView alertIcon = (ImageView) mIntruderAlertView.findViewById(R.id.alertIcon); - TextView alertText = (TextView) mIntruderAlertView.findViewById(R.id.alertText); - alertIcon.setImageDrawable(StatusBarIconView.getIcon( - alertIcon.getContext(), - iconView.getStatusBarIcon())); - alertText.setText(notification.notification.tickerText); - - View button = mIntruderAlertView.findViewById(R.id.intruder_alert_content); - button.setOnClickListener( - new Launcher(notification.notification.contentIntent, - notification.pkg, notification.tag, notification.id)); - - // 2. Animate mIntruderAlertView in - mHandler.sendEmptyMessage(MSG_SHOW_INTRUDER); - - // 3. Set alarm to age the notification off (TODO) - mHandler.removeMessages(MSG_HIDE_INTRUDER); - mHandler.sendEmptyMessageDelayed(MSG_HIDE_INTRUDER, INTRUDER_ALERT_DECAY_MS); - } - } else if (notification.notification.fullScreenIntent != null) { - // not immersive & a full-screen alert should be shown - Slog.d(TAG, "Notification has fullScreenIntent and activity is not immersive;" - + " sending fullScreenIntent"); + boolean shouldTick = true; + if (notification.notification.fullScreenIntent != null) { + shouldTick = false; + Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent"); try { notification.notification.fullScreenIntent.send(); } catch (PendingIntent.CanceledException e) { } - } else { - // usual case: status bar visible & not immersive + } + + StatusBarIconView iconView = addNotificationViews(key, notification); + if (iconView == null) return; - // show the ticker + if (shouldTick) { tick(notification); } - + // Recalculate the position of the sliding windows and the titles. setAreThereNotifications(); updateExpandedViewPos(EXPANDED_LEAVE_ALONE); @@ -721,12 +660,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks case MSG_ANIMATE_REVEAL: doRevealAnimation(); break; - case MSG_SHOW_INTRUDER: - setIntruderAlertVisibility(true); - break; - case MSG_HIDE_INTRUDER: - setIntruderAlertVisibility(false); - break; } } } @@ -1109,9 +1042,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks // close the shade if it was open animateCollapse(); - - // If this click was on the intruder alert, hide that instead - mHandler.sendEmptyMessage(MSG_HIDE_INTRUDER); } } @@ -1548,10 +1478,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks } }; - private void setIntruderAlertVisibility(boolean vis) { - mIntruderAlertView.setVisibility(vis ? View.VISIBLE : View.GONE); - } - /** * Reload some of our resources when the configuration changes. * diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index d5353433e1c9..5d5e862f8eb8 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -5687,35 +5687,6 @@ public final class ActivityManagerService extends ActivityManagerNative implemen } } - public void setImmersive(IBinder token, boolean immersive) { - synchronized(this) { - int index = (token != null) ? mMainStack.indexOfTokenLocked(token) : -1; - if (index < 0) { - throw new IllegalArgumentException(); - } - ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(index); - r.immersive = immersive; - } - } - - public boolean isImmersive(IBinder token) { - synchronized (this) { - int index = (token != null) ? mMainStack.indexOfTokenLocked(token) : -1; - if (index < 0) { - throw new IllegalArgumentException(); - } - ActivityRecord r = (ActivityRecord)mMainStack.mHistory.get(index); - return r.immersive; - } - } - - public boolean isTopActivityImmersive() { - synchronized (this) { - ActivityRecord r = mMainStack.topRunningActivityLocked(null); - return (r != null) ? r.immersive : false; - } - } - public final void enterSafeMode() { synchronized(this) { // It only makes sense to do this before the system is ready diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java index 62be91853acc..1687db13e8ce 100644 --- a/services/java/com/android/server/am/ActivityRecord.java +++ b/services/java/com/android/server/am/ActivityRecord.java @@ -103,7 +103,6 @@ class ActivityRecord extends IApplicationToken.Stub { boolean idle; // has the activity gone idle? boolean hasBeenLaunched;// has this activity ever been launched? boolean frozenBeforeDestroy;// has been frozen but not yet destroyed. - boolean immersive; // immersive mode (don't interrupt if possible) String stringName; // for caching of toString(). @@ -160,7 +159,6 @@ class ActivityRecord extends IApplicationToken.Stub { pw.print(prefix); pw.print("keysPaused="); pw.print(keysPaused); pw.print(" inHistory="); pw.print(inHistory); pw.print(" persistent="); pw.print(persistent); - pw.print(" immersive="); pw.print(immersive); pw.print(" launchMode="); pw.println(launchMode); pw.print(prefix); pw.print("fullscreen="); pw.print(fullscreen); pw.print(" visible="); pw.print(visible); @@ -287,8 +285,6 @@ class ActivityRecord extends IApplicationToken.Stub { } else { isHomeActivity = false; } - - immersive = (aInfo.flags & ActivityInfo.FLAG_IMMERSIVE) != 0; } else { realActivity = null; taskAffinity = null; @@ -300,7 +296,6 @@ class ActivityRecord extends IApplicationToken.Stub { packageName = null; fullscreen = true; isHomeActivity = false; - immersive = false; } } diff --git a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java index b665d2f09b4a..1078701bacad 100644 --- a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java +++ b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java @@ -76,17 +76,7 @@ public class StatusBarTest extends TestActivity win.setAttributes(winParams); } }, - new Test("Immersive: Enter") { - public void run() { - setImmersive(true); - } - }, - new Test("Immersive: Exit") { - public void run() { - setImmersive(false); - } - }, - new Test("Priority notification") { + new Test("fullScreenIntent") { public void run() { Notification not = new Notification(StatusBarTest.this, R.drawable.stat_sys_phone, @@ -96,9 +86,8 @@ public class StatusBarTest extends TestActivity "(888) 555-5038", null ); - not.flags |= Notification.FLAG_HIGH_PRIORITY; Intent fullScreenIntent = new Intent(StatusBarTest.this, TestAlertActivity.class); - int id = (int)System.currentTimeMillis(); // XXX HAX + int id = (int)System.currentTimeMillis(); fullScreenIntent.putExtra("id", id); not.fullScreenIntent = PendingIntent.getActivity( StatusBarTest.this, |