summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/java/android/provider/CalendarContract.java58
-rw-r--r--core/java/android/util/FinitePool.java21
-rw-r--r--services/java/com/android/server/accessibility/AccessibilityManagerService.java8
-rw-r--r--tests/BiDiTests/res/layout/view_padding.xml156
-rw-r--r--tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java2
-rw-r--r--tests/BiDiTests/src/com/android/bidi/BiDiTestViewPadding.java17
6 files changed, 245 insertions, 17 deletions
diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java
index 98d9c8f..1a24716 100644
--- a/core/java/android/provider/CalendarContract.java
+++ b/core/java/android/provider/CalendarContract.java
@@ -648,7 +648,21 @@ public final class CalendarContract {
}
/**
- * Fields and helpers for interacting with Attendees.
+ * Fields and helpers for interacting with Attendees. Each row of this table
+ * represents a single attendee or guest of an event. Calling
+ * {@link #query(ContentResolver, long)} will return a list of attendees for
+ * the event with the given eventId. Both apps and sync adapters may write
+ * to this table. There are six writable fields and all of them except
+ * {@link #ATTENDEE_NAME} must be included when inserting a new attendee.
+ * They are:
+ * <ul>
+ * <li>{@link #EVENT_ID}</li>
+ * <li>{@link #ATTENDEE_NAME}</li>
+ * <li>{@link #ATTENDEE_EMAIL}</li>
+ * <li>{@link #ATTENDEE_RELATIONSHIP}</li>
+ * <li>{@link #ATTENDEE_TYPE}</li>
+ * <li>{@link #ATTENDEE_STATUS}</li>
+ * </ul>
*/
public static final class Attendees implements BaseColumns, AttendeesColumns, EventsColumns {
@@ -1446,7 +1460,8 @@ public final class CalendarContract {
/**
* Fields and helpers for interacting with Instances. An instance is a
* single occurrence of an event including time zone specific start and end
- * days and minutes.
+ * days and minutes. The instances table is not writable and only provides a
+ * way to query event occurrences.
*/
public static final class Instances implements BaseColumns, EventsColumns, CalendarsColumns {
@@ -1867,7 +1882,17 @@ public final class CalendarContract {
}
/**
- * Fields and helpers for accessing reminders for an event.
+ * Fields and helpers for accessing reminders for an event. Each row of this
+ * table represents a single reminder for an event. Calling
+ * {@link #query(ContentResolver, long)} will return a list of reminders for
+ * the event with the given eventId. Both apps and sync adapters may write
+ * to this table. There are three writable fields and all of them must be
+ * included when inserting a new reminder. They are:
+ * <ul>
+ * <li>{@link #EVENT_ID}</li>
+ * <li>{@link #MINUTES}</li>
+ * <li>{@link #METHOD}</li>
+ * </ul>
*/
public static final class Reminders implements BaseColumns, RemindersColumns, EventsColumns {
private static final String REMINDERS_WHERE = CalendarContract.Reminders.EVENT_ID + "=?";
@@ -1968,7 +1993,14 @@ public final class CalendarContract {
/**
* Fields and helpers for accessing calendar alerts information. These
- * fields are for tracking which alerts have been fired.
+ * fields are for tracking which alerts have been fired. Scheduled alarms
+ * will generate an intent using {@link #EVENT_REMINDER_ACTION}. Apps that
+ * receive this action may update the {@link #STATE} for the reminder when
+ * they have finished handling it. Apps that have their notifications
+ * disabled should not modify the table to ensure that they do not conflict
+ * with another app that is generating a notification. In general, apps
+ * should not need to write to this table directly except to update the
+ * state of a reminder.
*/
public static final class CalendarAlerts implements BaseColumns,
CalendarAlertsColumns, EventsColumns, CalendarsColumns {
@@ -2140,9 +2172,11 @@ public final class CalendarContract {
/**
* Schedules an alarm intent with the system AlarmManager that will
- * cause the Calendar provider to recheck alarms. This is used to wake
- * the Calendar alarm handler when an alarm is expected or to do a
- * periodic refresh of alarm data.
+ * notify listeners when a reminder should be fired. The provider will
+ * keep scheduled reminders up to date but apps may use this to
+ * implement snooze functionality without modifying the reminders table.
+ * Scheduled alarms will generate an intent using
+ * {@link #EVENT_REMINDER_ACTION}.
*
* @param context A context for referencing system resources
* @param manager The AlarmManager to use or null
@@ -2232,7 +2266,13 @@ public final class CalendarContract {
/**
* Fields for accessing the Extended Properties. This is a generic set of
* name/value pairs for use by sync adapters or apps to add extra
- * information to events.
+ * information to events. There are three writable columns and all three
+ * must be present when inserting a new value. They are:
+ * <ul>
+ * <li>{@link #EVENT_ID}</li>
+ * <li>{@link #NAME}</li>
+ * <li>{@link #VALUE}</li>
+ * </ul>
*/
public static final class ExtendedProperties implements BaseColumns,
ExtendedPropertiesColumns, EventsColumns {
@@ -2266,6 +2306,8 @@ public final class CalendarContract {
/**
* Columns from the EventsRawTimes table
+ *
+ * @hide
*/
protected interface EventsRawTimesColumns {
/**
diff --git a/core/java/android/util/FinitePool.java b/core/java/android/util/FinitePool.java
index 4ae21ad..b30f2bf 100644
--- a/core/java/android/util/FinitePool.java
+++ b/core/java/android/util/FinitePool.java
@@ -20,6 +20,8 @@ package android.util;
* @hide
*/
class FinitePool<T extends Poolable<T>> implements Pool<T> {
+ private static final String LOG_TAG = "FinitePool";
+
/**
* Factory used to create new pool objects
*/
@@ -77,15 +79,16 @@ class FinitePool<T extends Poolable<T>> implements Pool<T> {
}
public void release(T element) {
- if (element.isPooled()) {
- throw new IllegalArgumentException("Element already in the pool.");
- }
- if (mInfinite || mPoolCount < mLimit) {
- mPoolCount++;
- element.setNextPoolable(mRoot);
- element.setPooled(true);
- mRoot = element;
+ if (!element.isPooled()) {
+ if (mInfinite || mPoolCount < mLimit) {
+ mPoolCount++;
+ element.setNextPoolable(mRoot);
+ element.setPooled(true);
+ mRoot = element;
+ }
+ mManager.onReleased(element);
+ } else {
+ Log.w(LOG_TAG, "Element is already in pool: " + element);
}
- mManager.onReleased(element);
}
}
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index ec59da6..a9dfb22 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -441,6 +441,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
if (oldService != null) {
tryRemoveServiceLocked(oldService);
}
+ // This API is intended for testing so enable accessibility to make
+ // sure clients can start poking with the window content.
+ Settings.Secure.putInt(mContext.getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_ENABLED, 1);
+ // Also disable all accessibility services to avoid interference
+ // with the tests.
+ Settings.Secure.putString(mContext.getContentResolver(),
+ Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, "");
}
AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();
accessibilityServiceInfo.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
diff --git a/tests/BiDiTests/res/layout/view_padding.xml b/tests/BiDiTests/res/layout/view_padding.xml
new file mode 100644
index 0000000..1652d04
--- /dev/null
+++ b/tests/BiDiTests/res/layout/view_padding.xml
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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:id="@+id/view_padding"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <FrameLayout android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <FrameLayout
+ android:layout_width="300dp"
+ android:layout_height="300dp"
+ android:layout_gravity="top|left"
+ android:background="#FF888888"
+ android:paddingTop="20dip"
+ android:paddingLeft="40dip"
+ android:paddingBottom="30dip"
+ android:paddingRight="50dip">
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="top|left"
+ android:background="#FF0000FF">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="bottom|right"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="300dp"
+ android:layout_height="300dp"
+ android:layout_gravity="top|center_horizontal"
+ android:background="#FF888888"
+ android:paddingTop="20dip"
+ android:paddingLeft="40dip"
+ android:paddingBottom="30dip"
+ android:paddingRight="50dip"
+ android:layoutDirection="inherit">
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="top|left"
+ android:background="#FF0000FF">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="bottom|right"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="300dp"
+ android:layout_height="300dp"
+ android:layout_gravity="top|right"
+ android:background="#FF888888"
+ android:paddingTop="20dip"
+ android:paddingLeft="40dip"
+ android:paddingBottom="30dip"
+ android:paddingRight="50dip"
+ android:layoutDirection="ltr">
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="top|left"
+ android:background="#FF0000FF">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="bottom|right"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="300dp"
+ android:layout_height="300dp"
+ android:layout_gravity="bottom|left"
+ android:background="#FF888888"
+ android:paddingTop="20dip"
+ android:paddingLeft="40dip"
+ android:paddingBottom="30dip"
+ android:paddingRight="50dip"
+ android:layoutDirection="rtl">
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="top|left"
+ android:background="#FF0000FF">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="bottom|right"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="300dp"
+ android:layout_height="300dp"
+ android:layout_gravity="bottom|center_horizontal"
+ android:background="#FF888888"
+ android:paddingTop="20dip"
+ android:paddingLeft="40dip"
+ android:paddingBottom="30dip"
+ android:paddingRight="50dip"
+ android:layoutDirection="locale">
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="top|left"
+ android:background="#FF0000FF">
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:layout_gravity="bottom|right"
+ android:background="#FF00FF00">
+ </FrameLayout>
+ </FrameLayout>
+
+ </FrameLayout>
+
+</FrameLayout>
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
index a3a0041..0bed7ce 100644
--- a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java
@@ -119,6 +119,8 @@ public class BiDiTestActivity extends Activity {
addItem(result, "Table RTL", BiDiTestTableLayoutRtl.class, R.id.table_layout_rtl);
addItem(result, "Table LOC", BiDiTestTableLayoutLocale.class, R.id.table_layout_locale);
+ addItem(result, "ViewPadding", BiDiTestViewPadding.class, R.id.view_padding);
+
return result;
}
} \ No newline at end of file
diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestViewPadding.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestViewPadding.java
new file mode 100644
index 0000000..6bb410a
--- /dev/null
+++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestViewPadding.java
@@ -0,0 +1,17 @@
+// Copyright 2011 Google Inc. All Rights Reserved.
+package com.android.bidi;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public class BiDiTestViewPadding extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.view_padding, container, false);
+ }
+}