Loading core/res/res/layout/unsupported_display_size_dialog_content.xml 0 → 100644 +31 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- * Copyright (C) 2016 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. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="?attr/dialogPreferredPadding" android:paddingLeft="?attr/dialogPreferredPadding" android:paddingRight="?attr/dialogPreferredPadding"> <CheckBox android:id="@+id/ask_checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="start" android:text="@string/unsupported_display_size_show" /> </FrameLayout> core/res/res/values/strings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2768,6 +2768,11 @@ <!-- [CHAR LIMIT=200] Compat mode dialog: hint to re-enable compat mode dialog. --> <string name="screen_compat_mode_hint">Re-enable this in System settings > Apps > Downloaded.</string> <!-- [CHAR LIMIT=200] Unsupported display size dialog: message. Refers to "Display size" setting. --> <string name="unsupported_display_size_message"><xliff:g id="app_name">%1$s</xliff:g> does not support the current Display size setting and may behave unexpectedly.</string> <!-- [CHAR LIMIT=50] Unsupported display size dialog: check box label. --> <string name="unsupported_display_size_show">Always show</string> <!-- Text of the alert that is displayed when an application has violated StrictMode. --> <string name="smv_application">The app <xliff:g id="application">%1$s</xliff:g> (process <xliff:g id="process">%2$s</xliff:g>) has violated its self-enforced StrictMode policy.</string> Loading core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -2609,4 +2609,7 @@ <java-symbol type="array" name="config_defaultPinnerServiceFiles" /> <java-symbol type="string" name="suspended_widget_accessibility" /> <java-symbol type="layout" name="unsupported_display_size_dialog_content" /> <java-symbol type="string" name="unsupported_display_size_message" /> </resources> services/core/java/com/android/server/am/ActivityManagerService.java +55 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,6 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.app.ProfilerInfo; import android.app.admin.DevicePolicyManager; import android.app.admin.DevicePolicyManagerInternal; import android.app.assist.AssistContent; import android.app.assist.AssistStructure; import android.app.backup.IBackupManager; Loading Loading @@ -205,6 +204,7 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.AtomicFile; import android.util.DebugUtils; import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; import android.util.Pair; Loading Loading @@ -1513,6 +1513,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final int NOTIFY_FORCED_RESIZABLE_MSG = 67; static final int NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG = 68; static final int VR_MODE_APPLY_IF_NEEDED_MSG = 69; static final int SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG = 70; static final int FIRST_ACTIVITY_STACK_MSG = 100; static final int FIRST_BROADCAST_QUEUE_MSG = 200; Loading @@ -1523,6 +1524,7 @@ public final class ActivityManagerService extends ActivityManagerNative static KillHandler sKillHandler = null; CompatModeDialog mCompatModeDialog; UnsupportedDisplaySizeDialog mUnsupportedDisplaySizeDialog; long mLastMemUsageReportTime = 0; /** Loading Loading @@ -1693,6 +1695,22 @@ public final class ActivityManagerService extends ActivityManagerNative } break; } case SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG: { synchronized (ActivityManagerService.this) { final ActivityRecord ar = (ActivityRecord) msg.obj; if (mUnsupportedDisplaySizeDialog != null) { mUnsupportedDisplaySizeDialog.dismiss(); mUnsupportedDisplaySizeDialog = null; } if (ar != null && mCompatModePackages.getPackageNotifyUnsupportedZoomLocked( ar.packageName)) { mUnsupportedDisplaySizeDialog = new UnsupportedDisplaySizeDialog( ActivityManagerService.this, mContext, ar.info.applicationInfo); mUnsupportedDisplaySizeDialog.show(); } } break; } case START_USER_SWITCH_UI_MSG: { mUserController.showUserSwitchDialog((Pair<UserInfo, UserInfo>) msg.obj); break; Loading Loading @@ -3099,6 +3117,16 @@ public final class ActivityManagerService extends ActivityManagerNative mUiHandler.sendMessage(msg); } final void showUnsupportedZoomDialogIfNeededLocked(ActivityRecord r) { if (mConfiguration.densityDpi != DisplayMetrics.DENSITY_DEVICE_STABLE && r.appInfo.requiresSmallestWidthDp > mConfiguration.smallestScreenWidthDp) { final Message msg = Message.obtain(); msg.what = SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG; msg.obj = r; mUiHandler.sendMessage(msg); } } private int updateLruProcessInternalLocked(ProcessRecord app, long now, int index, String what, Object obj, ProcessRecord srcApp) { app.lastActivityTime = now; Loading Loading @@ -17763,6 +17791,14 @@ public final class ActivityManagerService extends ActivityManagerNative removeUriPermissionsForPackageLocked(ssp, userId, true); removeTasksByPackageNameLocked(ssp, userId); // Hide the "unsupported display" dialog if necessary. if (mUnsupportedDisplaySizeDialog != null && ssp.equals( mUnsupportedDisplaySizeDialog.getPackageName())) { mUnsupportedDisplaySizeDialog.dismiss(); mUnsupportedDisplaySizeDialog = null; } mCompatModePackages.handlePackageUninstalledLocked(ssp); mBatteryStatsService.notePackageUninstalled(ssp); } } else { Loading Loading @@ -17834,6 +17870,21 @@ public final class ActivityManagerService extends ActivityManagerNative } break; } case Intent.ACTION_PACKAGE_DATA_CLEARED: { Uri data = intent.getData(); String ssp; if (data != null && (ssp = data.getSchemeSpecificPart()) != null) { // Hide the "unsupported display" dialog if necessary. if (mUnsupportedDisplaySizeDialog != null && ssp.equals( mUnsupportedDisplaySizeDialog.getPackageName())) { mUnsupportedDisplaySizeDialog.dismiss(); mUnsupportedDisplaySizeDialog = null; } mCompatModePackages.handlePackageDataClearedLocked(ssp); } break; } case Intent.ACTION_TIMEZONE_CHANGED: // If this is the time zone changed action, queue up a message that will reset // the timezone of all currently running processes. This message will get Loading Loading @@ -18656,6 +18707,9 @@ public final class ActivityManagerService extends ActivityManagerNative final boolean isDensityChange = (changes & ActivityInfo.CONFIG_DENSITY) != 0; if (isDensityChange) { // Reset the unsupported display size dialog. mUiHandler.sendEmptyMessage(SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG); killAllBackgroundProcessesExcept(Build.VERSION_CODES.N, ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE); } services/core/java/com/android/server/am/ActivityStack.java +1 −0 Original line number Diff line number Diff line Loading @@ -2481,6 +2481,7 @@ final class ActivityStack { System.identityHashCode(next), next.task.taskId, next.shortComponentName); next.sleeping = false; mService.showUnsupportedZoomDialogIfNeededLocked(next); mService.showAskCompatModeDialogLocked(next); next.app.pendingUiClean = true; next.app.forceProcessStateUpTo(mService.mTopProcessState); Loading Loading
core/res/res/layout/unsupported_display_size_dialog_content.xml 0 → 100644 +31 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- * Copyright (C) 2016 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. --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="?attr/dialogPreferredPadding" android:paddingLeft="?attr/dialogPreferredPadding" android:paddingRight="?attr/dialogPreferredPadding"> <CheckBox android:id="@+id/ask_checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="start" android:text="@string/unsupported_display_size_show" /> </FrameLayout>
core/res/res/values/strings.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2768,6 +2768,11 @@ <!-- [CHAR LIMIT=200] Compat mode dialog: hint to re-enable compat mode dialog. --> <string name="screen_compat_mode_hint">Re-enable this in System settings > Apps > Downloaded.</string> <!-- [CHAR LIMIT=200] Unsupported display size dialog: message. Refers to "Display size" setting. --> <string name="unsupported_display_size_message"><xliff:g id="app_name">%1$s</xliff:g> does not support the current Display size setting and may behave unexpectedly.</string> <!-- [CHAR LIMIT=50] Unsupported display size dialog: check box label. --> <string name="unsupported_display_size_show">Always show</string> <!-- Text of the alert that is displayed when an application has violated StrictMode. --> <string name="smv_application">The app <xliff:g id="application">%1$s</xliff:g> (process <xliff:g id="process">%2$s</xliff:g>) has violated its self-enforced StrictMode policy.</string> Loading
core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -2609,4 +2609,7 @@ <java-symbol type="array" name="config_defaultPinnerServiceFiles" /> <java-symbol type="string" name="suspended_widget_accessibility" /> <java-symbol type="layout" name="unsupported_display_size_dialog_content" /> <java-symbol type="string" name="unsupported_display_size_message" /> </resources>
services/core/java/com/android/server/am/ActivityManagerService.java +55 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,6 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.app.ProfilerInfo; import android.app.admin.DevicePolicyManager; import android.app.admin.DevicePolicyManagerInternal; import android.app.assist.AssistContent; import android.app.assist.AssistStructure; import android.app.backup.IBackupManager; Loading Loading @@ -205,6 +204,7 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.AtomicFile; import android.util.DebugUtils; import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; import android.util.Pair; Loading Loading @@ -1513,6 +1513,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final int NOTIFY_FORCED_RESIZABLE_MSG = 67; static final int NOTIFY_ACTIVITY_DISMISSING_DOCKED_STACK_MSG = 68; static final int VR_MODE_APPLY_IF_NEEDED_MSG = 69; static final int SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG = 70; static final int FIRST_ACTIVITY_STACK_MSG = 100; static final int FIRST_BROADCAST_QUEUE_MSG = 200; Loading @@ -1523,6 +1524,7 @@ public final class ActivityManagerService extends ActivityManagerNative static KillHandler sKillHandler = null; CompatModeDialog mCompatModeDialog; UnsupportedDisplaySizeDialog mUnsupportedDisplaySizeDialog; long mLastMemUsageReportTime = 0; /** Loading Loading @@ -1693,6 +1695,22 @@ public final class ActivityManagerService extends ActivityManagerNative } break; } case SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG: { synchronized (ActivityManagerService.this) { final ActivityRecord ar = (ActivityRecord) msg.obj; if (mUnsupportedDisplaySizeDialog != null) { mUnsupportedDisplaySizeDialog.dismiss(); mUnsupportedDisplaySizeDialog = null; } if (ar != null && mCompatModePackages.getPackageNotifyUnsupportedZoomLocked( ar.packageName)) { mUnsupportedDisplaySizeDialog = new UnsupportedDisplaySizeDialog( ActivityManagerService.this, mContext, ar.info.applicationInfo); mUnsupportedDisplaySizeDialog.show(); } } break; } case START_USER_SWITCH_UI_MSG: { mUserController.showUserSwitchDialog((Pair<UserInfo, UserInfo>) msg.obj); break; Loading Loading @@ -3099,6 +3117,16 @@ public final class ActivityManagerService extends ActivityManagerNative mUiHandler.sendMessage(msg); } final void showUnsupportedZoomDialogIfNeededLocked(ActivityRecord r) { if (mConfiguration.densityDpi != DisplayMetrics.DENSITY_DEVICE_STABLE && r.appInfo.requiresSmallestWidthDp > mConfiguration.smallestScreenWidthDp) { final Message msg = Message.obtain(); msg.what = SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG; msg.obj = r; mUiHandler.sendMessage(msg); } } private int updateLruProcessInternalLocked(ProcessRecord app, long now, int index, String what, Object obj, ProcessRecord srcApp) { app.lastActivityTime = now; Loading Loading @@ -17763,6 +17791,14 @@ public final class ActivityManagerService extends ActivityManagerNative removeUriPermissionsForPackageLocked(ssp, userId, true); removeTasksByPackageNameLocked(ssp, userId); // Hide the "unsupported display" dialog if necessary. if (mUnsupportedDisplaySizeDialog != null && ssp.equals( mUnsupportedDisplaySizeDialog.getPackageName())) { mUnsupportedDisplaySizeDialog.dismiss(); mUnsupportedDisplaySizeDialog = null; } mCompatModePackages.handlePackageUninstalledLocked(ssp); mBatteryStatsService.notePackageUninstalled(ssp); } } else { Loading Loading @@ -17834,6 +17870,21 @@ public final class ActivityManagerService extends ActivityManagerNative } break; } case Intent.ACTION_PACKAGE_DATA_CLEARED: { Uri data = intent.getData(); String ssp; if (data != null && (ssp = data.getSchemeSpecificPart()) != null) { // Hide the "unsupported display" dialog if necessary. if (mUnsupportedDisplaySizeDialog != null && ssp.equals( mUnsupportedDisplaySizeDialog.getPackageName())) { mUnsupportedDisplaySizeDialog.dismiss(); mUnsupportedDisplaySizeDialog = null; } mCompatModePackages.handlePackageDataClearedLocked(ssp); } break; } case Intent.ACTION_TIMEZONE_CHANGED: // If this is the time zone changed action, queue up a message that will reset // the timezone of all currently running processes. This message will get Loading Loading @@ -18656,6 +18707,9 @@ public final class ActivityManagerService extends ActivityManagerNative final boolean isDensityChange = (changes & ActivityInfo.CONFIG_DENSITY) != 0; if (isDensityChange) { // Reset the unsupported display size dialog. mUiHandler.sendEmptyMessage(SHOW_UNSUPPORTED_DISPLAY_SIZE_DIALOG_MSG); killAllBackgroundProcessesExcept(Build.VERSION_CODES.N, ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE); }
services/core/java/com/android/server/am/ActivityStack.java +1 −0 Original line number Diff line number Diff line Loading @@ -2481,6 +2481,7 @@ final class ActivityStack { System.identityHashCode(next), next.task.taskId, next.shortComponentName); next.sleeping = false; mService.showUnsupportedZoomDialogIfNeededLocked(next); mService.showAskCompatModeDialogLocked(next); next.app.pendingUiClean = true; next.app.forceProcessStateUpTo(mService.mTopProcessState); Loading