Merge "packages/screensavers/Basic: Set LOCAL_SDK_VERSION where possible." am: 6269ad665f am: eb7744a6da
am: d5ae525b42

Change-Id: I1059fc2b2d8a9fd8247644099e825b5421da0d2b
diff --git a/res/values-as/strings.xml b/res/values-as/strings.xml
new file mode 100644
index 0000000..57c38e9
--- /dev/null
+++ b/res/values-as/strings.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_name" msgid="6121278918841215202">"ডে\'ড্ৰিমৰ প্ৰাথমিক সংস্কৰণ"</string>
+    <string name="color_dream_name" msgid="9063813186991472050">"ৰং"</string>
+</resources>
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000..5c0ad62
--- /dev/null
+++ b/res/values-en-rCA/strings.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_name" msgid="6121278918841215202">"Basic Daydreams"</string>
+    <string name="color_dream_name" msgid="9063813186991472050">"Colours"</string>
+</resources>
diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml
new file mode 100644
index 0000000..a0f9676
--- /dev/null
+++ b/res/values-en-rXC/strings.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_name" msgid="6121278918841215202">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‎‏‎‎‏‏‏‏‎‎‏‏‎‎‏‎‎‏‏‎‏‎‏‏‏‏‏‎‏‎‏‎‏‎‎‎‏‎‎‏‏‏‏‎‎‎‏‎‏‎‎‎‏‏‏‎‎‎‏‎‎Basic Daydreams‎‏‎‎‏‎"</string>
+    <string name="color_dream_name" msgid="9063813186991472050">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‏‏‎‏‏‏‎‎‏‎‎‏‎‎‏‎‎‎‏‎‎‎‎‏‎‎‏‎‎‏‎‎‏‎‎‏‎‎‏‎‎‎‎‎‏‎‏‏‏‏‎‏‏‎‏‏‎‎‏‎‎Colors‎‏‎‎‏‎"</string>
+</resources>
diff --git a/res/values-ml/strings.xml b/res/values-ml/strings.xml
index b24c43b..735b00a 100644
--- a/res/values-ml/strings.xml
+++ b/res/values-ml/strings.xml
@@ -16,6 +16,6 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="6121278918841215202">"അടിസ്ഥാന ഡേഡ്രീം"</string>
+    <string name="app_name" msgid="6121278918841215202">"അടിസ്ഥാന Daydreams"</string>
     <string name="color_dream_name" msgid="9063813186991472050">"നിറങ്ങൾ"</string>
 </resources>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
new file mode 100644
index 0000000..6dd4b1e
--- /dev/null
+++ b/res/values-or/strings.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_name" msgid="6121278918841215202">"ସାଧାରଣ ଡେ-ଡ୍ରିମ୍‌"</string>
+    <string name="color_dream_name" msgid="9063813186991472050">"ରଙ୍ଗଗୁଡିକ"</string>
+</resources>
diff --git a/res/values-si/strings.xml b/res/values-si/strings.xml
index 6b71627..2213767 100644
--- a/res/values-si/strings.xml
+++ b/res/values-si/strings.xml
@@ -16,6 +16,6 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="6121278918841215202">"මූලික දවල් හීන"</string>
+    <string name="app_name" msgid="6121278918841215202">"මූලික ඩෙ-ඩ්‍රීම්"</string>
     <string name="color_dream_name" msgid="9063813186991472050">"වර්ණ"</string>
 </resources>
diff --git a/res/values-uz/strings.xml b/res/values-uz/strings.xml
index 593e1d2..e1d392f 100644
--- a/res/values-uz/strings.xml
+++ b/res/values-uz/strings.xml
@@ -16,6 +16,6 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="6121278918841215202">"Tush ko\'rish hotati standart ekrlan lavhalari"</string>
+    <string name="app_name" msgid="6121278918841215202">"Standart ekran lavhalari"</string>
     <string name="color_dream_name" msgid="9063813186991472050">"Ranglar"</string>
 </resources>
diff --git a/src/com/android/dreams/basic/Colors.java b/src/com/android/dreams/basic/Colors.java
index aaacfcd..9a75146 100644
--- a/src/com/android/dreams/basic/Colors.java
+++ b/src/com/android/dreams/basic/Colors.java
@@ -16,10 +16,10 @@
 
 package com.android.dreams.basic;
 
-import android.graphics.SurfaceTexture;
 import android.service.dreams.DreamService;
 import android.util.Log;
-import android.view.TextureView;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
 import android.os.Handler;
 import android.os.HandlerThread;
 
@@ -29,7 +29,7 @@
  * This dream performs its rendering using OpenGL on a separate rendering thread.
  * </p>
  */
-public class Colors extends DreamService implements TextureView.SurfaceTextureListener {
+public class Colors extends DreamService implements SurfaceHolder.Callback {
     static final String TAG = Colors.class.getSimpleName();
     static final boolean DEBUG = false;
 
@@ -38,7 +38,7 @@
         Log.v(TAG, String.format(fmt, args));
     }
 
-    private TextureView mTextureView;
+    private SurfaceView mSurfaceView;
 
     // The handler thread and handler on which the GL renderer is running.
     private HandlerThread mRendererHandlerThread;
@@ -53,8 +53,8 @@
 
         setInteractive(false);
 
-        mTextureView = new TextureView(this);
-        mTextureView.setSurfaceTextureListener(this);
+        mSurfaceView = new SurfaceView(this);
+        mSurfaceView.getHolder().addCallback(this);
 
         if (mRendererHandlerThread == null) {
             mRendererHandlerThread = new HandlerThread(TAG);
@@ -69,13 +69,13 @@
         setInteractive(false);
         setLowProfile(true);
         setFullscreen(true);
-        setContentView(mTextureView);
+        setContentView(mSurfaceView);
     }
 
     @Override
-    public void onSurfaceTextureAvailable(final SurfaceTexture surface,
-            final int width, final int height) {
-        LOG("onSurfaceTextureAvailable(%s, %d, %d)", surface, width, height);
+    public void surfaceCreated(SurfaceHolder holder) {
+        LOG("surfaceCreated(%s, %d, %d)", holder.getSurface(),
+                holder.getSurfaceFrame().width(), holder.getSurfaceFrame().height());
 
         mRendererHandler.post(new Runnable() {
             @Override
@@ -83,16 +83,16 @@
                 if (mRenderer != null) {
                     mRenderer.stop();
                 }
-                mRenderer = new ColorsGLRenderer(surface, width, height);
+                mRenderer = new ColorsGLRenderer(holder.getSurface(),
+                        holder.getSurfaceFrame().width(), holder.getSurfaceFrame().height());
                 mRenderer.start();
             }
         });
     }
 
     @Override
-    public void onSurfaceTextureSizeChanged(SurfaceTexture surface,
-            final int width, final int height) {
-        LOG("onSurfaceTextureSizeChanged(%s, %d, %d)", surface, width, height);
+    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
+        LOG("surfaceChanged(%s, %d,  %d, %d)", holder.getSurface(), format, width, height);
 
         mRendererHandler.post(new Runnable() {
             @Override
@@ -105,8 +105,8 @@
     }
 
     @Override
-    public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
-        LOG("onSurfaceTextureDestroyed(%s)", surface);
+    public void surfaceDestroyed(SurfaceHolder holder) {
+        LOG("surfaceDestroyed(%s)", holder.getSurface());
 
         mRendererHandler.post(new Runnable() {
             @Override
@@ -124,12 +124,5 @@
         } catch (InterruptedException e) {
             LOG("Error while waiting for renderer", e);
         }
-
-        return true;
-    }
-
-    @Override
-    public void onSurfaceTextureUpdated(SurfaceTexture surface) {
-        LOG("onSurfaceTextureUpdated(%s)", surface);
     }
 }
diff --git a/src/com/android/dreams/basic/ColorsGLRenderer.java b/src/com/android/dreams/basic/ColorsGLRenderer.java
index 91e4432..6c4b466 100644
--- a/src/com/android/dreams/basic/ColorsGLRenderer.java
+++ b/src/com/android/dreams/basic/ColorsGLRenderer.java
@@ -20,6 +20,7 @@
 import android.graphics.SurfaceTexture;
 import android.util.Log;
 import android.view.Choreographer;
+import android.view.Surface;
 import android.os.SystemClock;
 
 import javax.microedition.khronos.egl.EGL10;
@@ -54,7 +55,7 @@
         Log.v(TAG, String.format(fmt, args));
     }
 
-    private final SurfaceTexture mSurface;
+    private final Surface mSurface;
     private int mWidth;
     private int mHeight;
 
@@ -70,7 +71,7 @@
     private EGLContext mEglContext;
     private EGLSurface mEglSurface;
 
-    public ColorsGLRenderer(SurfaceTexture surface, int width, int height) {
+    public ColorsGLRenderer(Surface surface, int width, int height) {
         mSurface = surface;
         mWidth = width;
         mHeight = height;