Loading packages/PrintSpooler/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ android:configChanges="mnc|mnc|touchscreen|navigation|screenLayout|screenSize|smallestScreenSize|orientation|locale|keyboard|keyboardHidden|fontScale|uiMode|layoutDirection|density" android:permission="android.permission.BIND_PRINT_SPOOLER_SERVICE" android:theme="@style/Theme.PrintActivity" android:enableOnBackInvokedCallback="true" android:exported="true"> <intent-filter> <action android:name="android.print.PRINT_DIALOG" /> Loading packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java +13 −6 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ import android.widget.ImageView; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; import android.window.OnBackInvokedDispatcher; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; Loading Loading @@ -323,6 +324,8 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat }); getLoaderManager().initLoader(LOADER_ID_ENABLED_PRINT_SERVICES, null, this); getWindow().getOnBackInvokedDispatcher().registerOnBackInvokedCallback( OnBackInvokedDispatcher.PRIORITY_DEFAULT, this::onBackInvoked); } private void onConnectedToPrintSpooler(final IBinder documentAdapter) { Loading Loading @@ -481,15 +484,19 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat if ((keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE) && event.isTracking() && !event.isCanceled()) { onBackInvoked(); return true; } return super.onKeyUp(keyCode, event); } private void onBackInvoked() { if (mPrintPreviewController != null && mPrintPreviewController.isOptionsOpened() && !hasErrors()) { mPrintPreviewController.closeOptions(); } else { cancelPrint(); } return true; } return super.onKeyUp(keyCode, event); } @Override Loading Loading
packages/PrintSpooler/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ android:configChanges="mnc|mnc|touchscreen|navigation|screenLayout|screenSize|smallestScreenSize|orientation|locale|keyboard|keyboardHidden|fontScale|uiMode|layoutDirection|density" android:permission="android.permission.BIND_PRINT_SPOOLER_SERVICE" android:theme="@style/Theme.PrintActivity" android:enableOnBackInvokedCallback="true" android:exported="true"> <intent-filter> <action android:name="android.print.PRINT_DIALOG" /> Loading
packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java +13 −6 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ import android.widget.ImageView; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; import android.window.OnBackInvokedDispatcher; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; Loading Loading @@ -323,6 +324,8 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat }); getLoaderManager().initLoader(LOADER_ID_ENABLED_PRINT_SERVICES, null, this); getWindow().getOnBackInvokedDispatcher().registerOnBackInvokedCallback( OnBackInvokedDispatcher.PRIORITY_DEFAULT, this::onBackInvoked); } private void onConnectedToPrintSpooler(final IBinder documentAdapter) { Loading Loading @@ -481,15 +484,19 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat if ((keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE) && event.isTracking() && !event.isCanceled()) { onBackInvoked(); return true; } return super.onKeyUp(keyCode, event); } private void onBackInvoked() { if (mPrintPreviewController != null && mPrintPreviewController.isOptionsOpened() && !hasErrors()) { mPrintPreviewController.closeOptions(); } else { cancelPrint(); } return true; } return super.onKeyUp(keyCode, event); } @Override Loading