Loading core/java/android/app/IActivityManager.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -266,7 +266,8 @@ interface IActivityManager { boolean isImmersive(in IBinder token); void setImmersive(in IBinder token, boolean immersive); boolean isTopActivityImmersive(); void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message); void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message, boolean force); String getProviderMimeType(in Uri uri, int userId); IBinder newUriPermissionOwner(in String name); void grantUriPermissionFromOwner(in IBinder owner, int fromUid, in String targetPkg, Loading core/java/android/app/Presentation.java +15 −8 Original line number Diff line number Diff line Loading @@ -19,24 +19,25 @@ package android.app; import static android.content.Context.DISPLAY_SERVICE; import static android.content.Context.WINDOW_SERVICE; import static android.view.WindowManager.LayoutParams.TYPE_PRESENTATION; import static android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION; import android.content.Context; import android.content.res.Resources; import android.hardware.display.DisplayManager; import android.hardware.display.DisplayManager.DisplayListener; import android.os.Binder; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.Display; import android.view.Gravity; import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerImpl; import android.os.Handler; import android.os.Message; import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; /** * Base class for presentations. Loading Loading @@ -115,7 +116,9 @@ import android.util.TypedValue; * The display manager keeps track of all displays in the system. However, not all * displays are appropriate for showing presentations. For example, if an activity * attempted to show a presentation on the main display it might obscure its own content * (it's like opening a dialog on top of your activity). * (it's like opening a dialog on top of your activity). Creating a presentation on the main * display will result in {@link android.view.WindowManager.InvalidDisplayException} being thrown * when invoking {@link #show()}. * </p><p> * Here's how to identify suitable displays for showing presentations using * {@link DisplayManager#getDisplays(String)} and the Loading Loading @@ -188,12 +191,16 @@ public class Presentation extends Dialog { mDisplay = display; mDisplayManager = (DisplayManager)getContext().getSystemService(DISPLAY_SERVICE); final int windowType = (display.getFlags() & Display.FLAG_PRIVATE) != 0 ? TYPE_PRIVATE_PRESENTATION : TYPE_PRESENTATION; final Window w = getWindow(); final WindowManager.LayoutParams attr = w.getAttributes(); attr.token = mToken; w.setAttributes(attr); w.setGravity(Gravity.FILL); w.setType(TYPE_PRESENTATION); w.setType(windowType); setCanceledOnTouchOutside(false); } Loading Loading @@ -242,7 +249,7 @@ public class Presentation extends Dialog { /** * Inherited from {@link Dialog#show}. Will throw * {@link android.view.WindowManager.InvalidDisplayException} if the specified secondary * {@link Display} can't be found. * {@link Display} can't be found or if it does not have {@link Display#FLAG_PRESENTATION} set. */ @Override public void show() { Loading packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +10 −1 Original line number Diff line number Diff line Loading @@ -603,7 +603,16 @@ public class ImageWallpaper extends WallpaperService { final FloatBuffer triangleVertices = createMesh(left, top, right, bottom); final int texture = loadTexture(mBackground); int texture = 0; try { texture = loadTexture(mBackground); } catch (IllegalArgumentException e) { mEgl.eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); mEgl.eglDestroySurface(mEglDisplay, mEglSurface); mEgl.eglDestroyContext(mEglDisplay, mEglContext); mEgl.eglTerminate(mEglDisplay); return false; } final int program = buildProgram(sSimpleVS, sSimpleFS); final int attribPosition = glGetAttribLocation(program, "position"); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +5 −3 Original line number Diff line number Diff line Loading @@ -591,7 +591,8 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks, String message = mContext.getString(R.string.instant_apps_message); PendingIntent appInfoAction = PendingIntent.getActivity(mContext, 0, new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) .setData(Uri.fromParts("package", pkg, null)), 0); .setData(Uri.fromParts("package", pkg, null)), PendingIntent.FLAG_IMMUTABLE); Action action = new Notification.Action.Builder(null, mContext.getString(R.string.app_info), appInfoAction).build(); Loading @@ -605,7 +606,7 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks, .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0 /* requestCode */, browserIntent, 0 /* flags */); 0 /* requestCode */, browserIntent, PendingIntent.FLAG_IMMUTABLE); ComponentName aiaComponent = null; try { aiaComponent = AppGlobals.getPackageManager().getInstantAppInstallerComponent(); Loading @@ -621,7 +622,8 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks, .putExtra(Intent.EXTRA_VERSION_CODE, appInfo.versionCode) .putExtra(Intent.EXTRA_EPHEMERAL_FAILURE, pendingIntent); PendingIntent webPendingIntent = PendingIntent.getActivity(mContext, 0, goToWebIntent, 0); PendingIntent webPendingIntent = PendingIntent.getActivity( mContext, 0, goToWebIntent, PendingIntent.FLAG_IMMUTABLE); Action webAction = new Notification.Action.Builder(null, mContext.getString(R.string.go_to_web), webPendingIntent).build(); builder.addAction(webAction); Loading services/core/java/com/android/server/am/ActiveServices.java +11 −1 Original line number Diff line number Diff line Loading @@ -653,6 +653,15 @@ public final class ActiveServices { } } void killMisbehavingService(ServiceRecord r, int appUid, int appPid, String localPackageName) { synchronized (mAm) { stopServiceLocked(r); mAm.crashApplication(appUid, appPid, localPackageName, -1, "Bad notification for startForeground", true /*force*/); } } IBinder peekServiceLocked(Intent service, String resolvedType, String callingPackage) { ServiceLookupResult r = retrieveServiceLocked(service, resolvedType, callingPackage, Binder.getCallingPid(), Binder.getCallingUid(), Loading Loading @@ -3391,7 +3400,8 @@ public final class ActiveServices { void serviceForegroundCrash(ProcessRecord app) { mAm.crashApplication(app.uid, app.pid, app.info.packageName, app.userId, "Context.startForegroundService() did not then call Service.startForeground()"); "Context.startForegroundService() did not then call Service.startForeground()", false /*force*/); } void scheduleServiceTimeoutLocked(ProcessRecord proc) { Loading Loading
core/java/android/app/IActivityManager.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -266,7 +266,8 @@ interface IActivityManager { boolean isImmersive(in IBinder token); void setImmersive(in IBinder token, boolean immersive); boolean isTopActivityImmersive(); void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message); void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message, boolean force); String getProviderMimeType(in Uri uri, int userId); IBinder newUriPermissionOwner(in String name); void grantUriPermissionFromOwner(in IBinder owner, int fromUid, in String targetPkg, Loading
core/java/android/app/Presentation.java +15 −8 Original line number Diff line number Diff line Loading @@ -19,24 +19,25 @@ package android.app; import static android.content.Context.DISPLAY_SERVICE; import static android.content.Context.WINDOW_SERVICE; import static android.view.WindowManager.LayoutParams.TYPE_PRESENTATION; import static android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION; import android.content.Context; import android.content.res.Resources; import android.hardware.display.DisplayManager; import android.hardware.display.DisplayManager.DisplayListener; import android.os.Binder; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.Display; import android.view.Gravity; import android.view.Window; import android.view.WindowManager; import android.view.WindowManagerImpl; import android.os.Handler; import android.os.Message; import android.util.DisplayMetrics; import android.util.Log; import android.util.TypedValue; /** * Base class for presentations. Loading Loading @@ -115,7 +116,9 @@ import android.util.TypedValue; * The display manager keeps track of all displays in the system. However, not all * displays are appropriate for showing presentations. For example, if an activity * attempted to show a presentation on the main display it might obscure its own content * (it's like opening a dialog on top of your activity). * (it's like opening a dialog on top of your activity). Creating a presentation on the main * display will result in {@link android.view.WindowManager.InvalidDisplayException} being thrown * when invoking {@link #show()}. * </p><p> * Here's how to identify suitable displays for showing presentations using * {@link DisplayManager#getDisplays(String)} and the Loading Loading @@ -188,12 +191,16 @@ public class Presentation extends Dialog { mDisplay = display; mDisplayManager = (DisplayManager)getContext().getSystemService(DISPLAY_SERVICE); final int windowType = (display.getFlags() & Display.FLAG_PRIVATE) != 0 ? TYPE_PRIVATE_PRESENTATION : TYPE_PRESENTATION; final Window w = getWindow(); final WindowManager.LayoutParams attr = w.getAttributes(); attr.token = mToken; w.setAttributes(attr); w.setGravity(Gravity.FILL); w.setType(TYPE_PRESENTATION); w.setType(windowType); setCanceledOnTouchOutside(false); } Loading Loading @@ -242,7 +249,7 @@ public class Presentation extends Dialog { /** * Inherited from {@link Dialog#show}. Will throw * {@link android.view.WindowManager.InvalidDisplayException} if the specified secondary * {@link Display} can't be found. * {@link Display} can't be found or if it does not have {@link Display#FLAG_PRESENTATION} set. */ @Override public void show() { Loading
packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +10 −1 Original line number Diff line number Diff line Loading @@ -603,7 +603,16 @@ public class ImageWallpaper extends WallpaperService { final FloatBuffer triangleVertices = createMesh(left, top, right, bottom); final int texture = loadTexture(mBackground); int texture = 0; try { texture = loadTexture(mBackground); } catch (IllegalArgumentException e) { mEgl.eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); mEgl.eglDestroySurface(mEglDisplay, mEglSurface); mEgl.eglDestroyContext(mEglDisplay, mEglContext); mEgl.eglTerminate(mEglDisplay); return false; } final int program = buildProgram(sSimpleVS, sSimpleFS); final int attribPosition = glGetAttribLocation(program, "position"); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +5 −3 Original line number Diff line number Diff line Loading @@ -591,7 +591,8 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks, String message = mContext.getString(R.string.instant_apps_message); PendingIntent appInfoAction = PendingIntent.getActivity(mContext, 0, new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS) .setData(Uri.fromParts("package", pkg, null)), 0); .setData(Uri.fromParts("package", pkg, null)), PendingIntent.FLAG_IMMUTABLE); Action action = new Notification.Action.Builder(null, mContext.getString(R.string.app_info), appInfoAction).build(); Loading @@ -605,7 +606,7 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks, .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0 /* requestCode */, browserIntent, 0 /* flags */); 0 /* requestCode */, browserIntent, PendingIntent.FLAG_IMMUTABLE); ComponentName aiaComponent = null; try { aiaComponent = AppGlobals.getPackageManager().getInstantAppInstallerComponent(); Loading @@ -621,7 +622,8 @@ public class PhoneStatusBarPolicy implements Callback, Callbacks, .putExtra(Intent.EXTRA_VERSION_CODE, appInfo.versionCode) .putExtra(Intent.EXTRA_EPHEMERAL_FAILURE, pendingIntent); PendingIntent webPendingIntent = PendingIntent.getActivity(mContext, 0, goToWebIntent, 0); PendingIntent webPendingIntent = PendingIntent.getActivity( mContext, 0, goToWebIntent, PendingIntent.FLAG_IMMUTABLE); Action webAction = new Notification.Action.Builder(null, mContext.getString(R.string.go_to_web), webPendingIntent).build(); builder.addAction(webAction); Loading
services/core/java/com/android/server/am/ActiveServices.java +11 −1 Original line number Diff line number Diff line Loading @@ -653,6 +653,15 @@ public final class ActiveServices { } } void killMisbehavingService(ServiceRecord r, int appUid, int appPid, String localPackageName) { synchronized (mAm) { stopServiceLocked(r); mAm.crashApplication(appUid, appPid, localPackageName, -1, "Bad notification for startForeground", true /*force*/); } } IBinder peekServiceLocked(Intent service, String resolvedType, String callingPackage) { ServiceLookupResult r = retrieveServiceLocked(service, resolvedType, callingPackage, Binder.getCallingPid(), Binder.getCallingUid(), Loading Loading @@ -3391,7 +3400,8 @@ public final class ActiveServices { void serviceForegroundCrash(ProcessRecord app) { mAm.crashApplication(app.uid, app.pid, app.info.packageName, app.userId, "Context.startForegroundService() did not then call Service.startForeground()"); "Context.startForegroundService() did not then call Service.startForeground()", false /*force*/); } void scheduleServiceTimeoutLocked(ProcessRecord proc) { Loading