diff options
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothSocket.java | 14 | ||||
| -rw-r--r-- | core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl | 14 | ||||
| -rw-r--r-- | core/java/android/bluetooth/IBluetoothHealth.aidl | 14 | ||||
| -rwxr-xr-x | core/java/android/bluetooth/IBluetoothInputDevice.aidl | 15 | ||||
| -rwxr-xr-x | core/java/android/bluetooth/IBluetoothManager.aidl | 14 | ||||
| -rw-r--r-- | core/java/android/bluetooth/IBluetoothManagerCallback.aidl | 14 | ||||
| -rw-r--r-- | core/java/android/bluetooth/IBluetoothPan.aidl | 15 | ||||
| -rw-r--r-- | core/java/android/view/Display.java | 56 | ||||
| -rw-r--r-- | core/java/android/view/DisplayInfo.java | 3 | ||||
| -rw-r--r-- | core/java/android/view/HardwareRenderer.java | 53 | ||||
| -rw-r--r-- | core/java/android/view/SurfaceView.java | 22 | ||||
| -rw-r--r-- | core/java/android/view/WindowManager.java | 9 | ||||
| -rw-r--r-- | core/res/res/values-es-rUS/strings.xml | 9 | ||||
| -rw-r--r-- | core/res/res/values-ru/strings.xml | 2 | ||||
| -rw-r--r-- | core/res/res/values-zh-rCN/strings.xml | 4 |
15 files changed, 209 insertions, 49 deletions
diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java index 8cbf5b1..26bde19 100644 --- a/core/java/android/bluetooth/BluetoothSocket.java +++ b/core/java/android/bluetooth/BluetoothSocket.java @@ -1,5 +1,17 @@ /* - * Copyright (C) 2012 Google Inc. + * Copyright (C) 2012 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.bluetooth; diff --git a/core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl b/core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl index 163e4e2..d5e64f6 100644 --- a/core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl +++ b/core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl @@ -1,5 +1,17 @@ /* - * Copyright (C) 2012 Google Inc. + * Copyright (C) 2012 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.bluetooth; diff --git a/core/java/android/bluetooth/IBluetoothHealth.aidl b/core/java/android/bluetooth/IBluetoothHealth.aidl index e741da4..a84a42c 100644 --- a/core/java/android/bluetooth/IBluetoothHealth.aidl +++ b/core/java/android/bluetooth/IBluetoothHealth.aidl @@ -1,5 +1,17 @@ /* - * Copyright (C) 2012 Google Inc. + * Copyright (C) 2012 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.bluetooth; diff --git a/core/java/android/bluetooth/IBluetoothInputDevice.aidl b/core/java/android/bluetooth/IBluetoothInputDevice.aidl index 23e6d50..1ebb9ca 100755 --- a/core/java/android/bluetooth/IBluetoothInputDevice.aidl +++ b/core/java/android/bluetooth/IBluetoothInputDevice.aidl @@ -1,6 +1,19 @@ /* - * Copyright (C) 2012 Google Inc. + * Copyright (C) 2012 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.bluetooth; import android.bluetooth.BluetoothDevice; diff --git a/core/java/android/bluetooth/IBluetoothManager.aidl b/core/java/android/bluetooth/IBluetoothManager.aidl index de8fe91..ed8777c 100755 --- a/core/java/android/bluetooth/IBluetoothManager.aidl +++ b/core/java/android/bluetooth/IBluetoothManager.aidl @@ -1,5 +1,17 @@ /* - * Copyright (C) 2012 Google Inc. + * Copyright (C) 2012 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.bluetooth; diff --git a/core/java/android/bluetooth/IBluetoothManagerCallback.aidl b/core/java/android/bluetooth/IBluetoothManagerCallback.aidl index 3e795ea..9551086 100644 --- a/core/java/android/bluetooth/IBluetoothManagerCallback.aidl +++ b/core/java/android/bluetooth/IBluetoothManagerCallback.aidl @@ -1,5 +1,17 @@ /* - * Copyright (C) 2012 Google Inc. + * Copyright (C) 2012 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.bluetooth; diff --git a/core/java/android/bluetooth/IBluetoothPan.aidl b/core/java/android/bluetooth/IBluetoothPan.aidl index b91bd7d..5a32347 100644 --- a/core/java/android/bluetooth/IBluetoothPan.aidl +++ b/core/java/android/bluetooth/IBluetoothPan.aidl @@ -1,6 +1,19 @@ /* - * Copyright (C) 2012 Google Inc. + * Copyright (C) 2012 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.bluetooth; import android.bluetooth.BluetoothDevice; diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java index 662dc45..1cd3e05 100644 --- a/core/java/android/view/Display.java +++ b/core/java/android/view/Display.java @@ -82,22 +82,65 @@ public final class Display { * Display flag: Indicates that the display supports compositing content * that is stored in protected graphics buffers. * <p> + * If this flag is set then the display device supports compositing protected buffers. + * </p><p> + * If this flag is not set then the display device may not support compositing + * protected buffers; the user may see a blank region on the screen instead of + * the protected content. + * </p><p> * Secure (DRM) video decoders may allocate protected graphics buffers to request that * a hardware-protected path be provided between the video decoder and the external * display sink. If a hardware-protected path is not available, then content stored * in protected graphics buffers may not be composited. * </p><p> - * If this flag is not set, then the display device does not support compositing - * protected buffers; the user may see a blank region on the screen instead of - * the protected content. An application can use this flag as a hint that it should - * select an alternate content stream or adopt a different strategy for decoding - * content that does not rely on protected buffers so as to ensure that the user - * can view the content on the display as expected. + * An application can use the absence of this flag as a hint that it should not use protected + * buffers for this display because the content may not be visible. For example, + * if the flag is not set then the application may choose not to show content on this + * display, show an informative error message, select an alternate content stream + * or adopt a different strategy for decoding content that does not rely on + * protected buffers. * </p> + * + * @see #getFlags */ public static final int FLAG_SUPPORTS_PROTECTED_BUFFERS = 1 << 0; /** + * Display flag: Indicates that the display has a secure video output and + * supports compositing secure surfaces. + * <p> + * If this flag is set then the display device has a secure video output + * and is capable of showing secure surfaces. It may also be capable of + * showing {@link #FLAG_SUPPORTS_PROTECTED_BUFFERS protected buffers}. + * </p><p> + * If this flag is not set then the display device may not have a secure video + * output; the user may see a blank region on the screen instead of + * the contents of secure surfaces or protected buffers. + * </p><p> + * Secure surfaces are used to prevent content rendered into those surfaces + * by applications from appearing in screenshots or from being viewed + * on non-secure displays. Protected buffers are used by secure video decoders + * for a similar purpose. + * </p><p> + * An application creates a window with a secure surface by specifying the + * {@link WindowManager.LayoutParams#FLAG_SECURE} window flag. + * Likewise, an application creates a {@link SurfaceView} with a secure surface + * by calling {@link SurfaceView#setSecure} before attaching the secure view to + * its containing window. + * </p><p> + * An application can use the absence of this flag as a hint that it should not create + * secure surfaces or protected buffers on this display because the content may + * not be visible. For example, if the flag is not set then the application may + * choose not to show content on this display, show an informative error message, + * select an alternate content stream or adopt a different strategy for decoding + * content that does not rely on secure surfaces or protected buffers. + * </p> + * + * @see #getFlags + */ + public static final int FLAG_SECURE = 1 << 1; + + /** * Internal method to create a display. * Applications should use {@link android.view.WindowManager#getDefaultDisplay()} * or {@link android.hardware.display.DisplayManager#getDisplay} @@ -182,6 +225,7 @@ public final class Display { * @return The display flags. * * @see #FLAG_SUPPORTS_PROTECTED_BUFFERS + * @see #FLAG_SECURE */ public int getFlags() { synchronized (this) { diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java index fb04150..ead5ff4 100644 --- a/core/java/android/view/DisplayInfo.java +++ b/core/java/android/view/DisplayInfo.java @@ -299,6 +299,9 @@ public final class DisplayInfo implements Parcelable { private static String flagsToString(int flags) { StringBuilder result = new StringBuilder(); + if ((flags & Display.FLAG_SECURE) != 0) { + result.append(", FLAG_SECURE"); + } if ((flags & Display.FLAG_SUPPORTS_PROTECTED_BUFFERS) != 0) { result.append(", FLAG_SUPPORTS_PROTECTED_BUFFERS"); } diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java index 59f941d..1c613245 100644 --- a/core/java/android/view/HardwareRenderer.java +++ b/core/java/android/view/HardwareRenderer.java @@ -1526,30 +1526,6 @@ public abstract class HardwareRenderer { } @Override - void destroyLayers(View view) { - if (view != null && isEnabled() && checkCurrent() != SURFACE_STATE_ERROR) { - if (mCanvas != null) { - mCanvas.clearLayerUpdates(); - } - destroyHardwareLayer(view); - GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS); - } - } - - private static void destroyHardwareLayer(View view) { - view.destroyLayer(true); - - if (view instanceof ViewGroup) { - ViewGroup group = (ViewGroup) view; - - int count = group.getChildCount(); - for (int i = 0; i < count; i++) { - destroyHardwareLayer(group.getChildAt(i)); - } - } - } - - @Override boolean safelyRun(Runnable action) { boolean needsContext = true; if (isEnabled() && checkCurrent() != SURFACE_STATE_ERROR) needsContext = false; @@ -1574,6 +1550,35 @@ public abstract class HardwareRenderer { } @Override + void destroyLayers(final View view) { + if (view != null) { + safelyRun(new Runnable() { + @Override + public void run() { + if (mCanvas != null) { + mCanvas.clearLayerUpdates(); + } + destroyHardwareLayer(view); + GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS); + } + }); + } + } + + private static void destroyHardwareLayer(View view) { + view.destroyLayer(true); + + if (view instanceof ViewGroup) { + ViewGroup group = (ViewGroup) view; + + int count = group.getChildCount(); + for (int i = 0; i < count; i++) { + destroyHardwareLayer(group.getChildAt(i)); + } + } + } + + @Override void destroyHardwareResources(final View view) { if (view != null) { safelyRun(new Runnable() { diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 0d16dd3..9008521 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -385,7 +385,27 @@ public class SurfaceView extends View { mLayout.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; } } - + + /** + * Control whether the surface view's content should be treated as secure, + * preventing it from appearing in screenshots or from being viewed on + * non-secure displays. + * + * <p>Note that this must be set before the surface view's containing + * window is attached to the window manager. + * + * <p>See {@link android.view.Display#FLAG_SECURE} for details. + * + * @param isSecure True if the surface view is secure. + */ + public void setSecure(boolean isSecure) { + if (isSecure) { + mLayout.flags |= WindowManager.LayoutParams.FLAG_SECURE; + } else { + mLayout.flags &= ~WindowManager.LayoutParams.FLAG_SECURE; + } + } + /** * Hack to allow special layering of windows. The type is one of the * types in WindowManager.LayoutParams. This is a hack so: diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 01923e2..3b31ff6 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -628,8 +628,13 @@ public interface WindowManager extends ViewManager { @Deprecated public static final int FLAG_DITHER = 0x00001000; - /** Window flag: don't allow screen shots while this window is - * displayed. Maps to Surface.SECURE. */ + /** Window flag: Treat the content of the window as secure, preventing + * it from appearing in screenshots or from being viewed on non-secure + * displays. + * + * <p>See {@link android.view.Display#FLAG_SECURE} for more details about + * secure surfaces and secure displays. + */ public static final int FLAG_SECURE = 0x00002000; /** Window flag: a special mode where the layout parameters are used diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml index a333187..9389579 100644 --- a/core/res/res/values-es-rUS/strings.xml +++ b/core/res/res/values-es-rUS/strings.xml @@ -1381,12 +1381,9 @@ <string name="display_manager_hdmi_display_name" msgid="1555264559227470109">"Pantalla HDMI"</string> <string name="display_manager_overlay_display_name" msgid="5142365982271620716">"Superposición #<xliff:g id="ID">%1$d</xliff:g>"</string> <string name="display_manager_overlay_display_title" msgid="652124517672257172">"<xliff:g id="NAME">%1$s</xliff:g>: <xliff:g id="WIDTH">%2$d</xliff:g> x <xliff:g id="HEIGHT">%3$d</xliff:g>, <xliff:g id="DPI">%4$d</xliff:g> ppp"</string> - <!-- no translation found for wifi_display_notification_title (2223050649240326557) --> - <skip /> - <!-- no translation found for wifi_display_notification_message (4498802012464170685) --> - <skip /> - <!-- no translation found for wifi_display_notification_disconnect (6183754463561153372) --> - <skip /> + <string name="wifi_display_notification_title" msgid="2223050649240326557">"Se conectó la pantalla inalámbrica"</string> + <string name="wifi_display_notification_message" msgid="4498802012464170685">"Esta pantalla se muestra en otro dispositivo."</string> + <string name="wifi_display_notification_disconnect" msgid="6183754463561153372">"Desconectar"</string> <string name="kg_emergency_call_label" msgid="684946192523830531">"Llamada de emergencia"</string> <string name="kg_forgot_pattern_button_text" msgid="8852021467868220608">"¿Olvidaste el patrón?"</string> <string name="kg_wrong_pattern" msgid="1850806070801358830">"Patrón incorrecto"</string> diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml index 4d24fcb..855f461 100644 --- a/core/res/res/values-ru/strings.xml +++ b/core/res/res/values-ru/strings.xml @@ -1382,7 +1382,7 @@ <string name="display_manager_overlay_display_name" msgid="5142365982271620716">"Наложение № <xliff:g id="ID">%1$d</xliff:g>"</string> <string name="display_manager_overlay_display_title" msgid="652124517672257172">"<xliff:g id="NAME">%1$s</xliff:g>: <xliff:g id="WIDTH">%2$d</xliff:g> х <xliff:g id="HEIGHT">%3$d</xliff:g>, <xliff:g id="DPI">%4$d</xliff:g> тчк/дюйм"</string> <string name="wifi_display_notification_title" msgid="2223050649240326557">"Беспроводной проектор подключен"</string> - <string name="wifi_display_notification_message" msgid="4498802012464170685">"Изображение проецируется на другое устройство"</string> + <string name="wifi_display_notification_message" msgid="4498802012464170685">"Изображение передается на другое устройство"</string> <string name="wifi_display_notification_disconnect" msgid="6183754463561153372">"Отключить"</string> <string name="kg_emergency_call_label" msgid="684946192523830531">"Экстренный вызов"</string> <string name="kg_forgot_pattern_button_text" msgid="8852021467868220608">"Забыли графический ключ?"</string> diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml index 8783b0b..b0c363b 100644 --- a/core/res/res/values-zh-rCN/strings.xml +++ b/core/res/res/values-zh-rCN/strings.xml @@ -1381,8 +1381,8 @@ <string name="display_manager_hdmi_display_name" msgid="1555264559227470109">"HDMI 屏幕"</string> <string name="display_manager_overlay_display_name" msgid="5142365982271620716">"叠加视图 #<xliff:g id="ID">%1$d</xliff:g>"</string> <string name="display_manager_overlay_display_title" msgid="652124517672257172">"<xliff:g id="NAME">%1$s</xliff:g>:<xliff:g id="WIDTH">%2$d</xliff:g>x<xliff:g id="HEIGHT">%3$d</xliff:g>,<xliff:g id="DPI">%4$d</xliff:g> dpi"</string> - <string name="wifi_display_notification_title" msgid="2223050649240326557">"无线显示设备已连接"</string> - <string name="wifi_display_notification_message" msgid="4498802012464170685">"此屏幕显示在另一台设备上"</string> + <string name="wifi_display_notification_title" msgid="2223050649240326557">"已连接到无线显示设备"</string> + <string name="wifi_display_notification_message" msgid="4498802012464170685">"此屏幕的内容正显示在另一台设备上"</string> <string name="wifi_display_notification_disconnect" msgid="6183754463561153372">"断开连接"</string> <string name="kg_emergency_call_label" msgid="684946192523830531">"紧急呼救"</string> <string name="kg_forgot_pattern_button_text" msgid="8852021467868220608">"忘记了图案"</string> |
