Loading Android.bp +2 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. java_library_static { android_library { name: "launcher-aosp-tapl", static_libs: [ "androidx.annotation_annotation", Loading @@ -27,5 +27,6 @@ java_library_static { "src/com/android/launcher3/util/SecureSettingsObserver.java", "src/com/android/launcher3/TestProtocol.java", ], manifest: "tests/tapl/AndroidManifest.xml", platform_apis: true, } AndroidManifest-common.xml +8 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,14 @@ android:writePermission="${packageName}.permission.WRITE_SETTINGS" android:readPermission="${packageName}.permission.READ_SETTINGS" /> <provider android:name="com.android.launcher3.TestInformationProvider" android:authorities="${packageName}.TestInfo" android:readPermission="android.permission.WRITE_SECURE_SETTINGS" android:writePermission="android.permission.WRITE_SECURE_SETTINGS" android:exported="true"> </provider> <!-- The content provider for exposing various launcher grid options. TODO: Enable when all apps columns are correct Loading src/com/android/launcher3/TestInformationProvider.java 0 → 100644 +66 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 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 com.android.launcher3; import android.content.ContentProvider; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; public class TestInformationProvider extends ContentProvider { @Override public boolean onCreate() { return true; } @Override public int update(Uri uri, ContentValues contentValues, String s, String[] strings) { return 0; } @Override public int delete(Uri uri, String s, String[] strings) { return 0; } @Override public Uri insert(Uri uri, ContentValues contentValues) { return null; } @Override public String getType(Uri uri) { return null; } @Override public Cursor query(Uri uri, String[] strings, String s, String[] strings1, String s1) { return null; } @Override public Bundle call(String method, String arg, Bundle extras) { if (TestProtocol.IS_TEST_INFO_ENABLED.equals(method)) { final Bundle response = new Bundle(); response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, Utilities.IS_RUNNING_IN_TEST_HARNESS); return response; } return null; } } src/com/android/launcher3/TestProtocol.java +3 −0 Original line number Diff line number Diff line Loading @@ -30,4 +30,7 @@ public final class TestProtocol { public static final int OVERVIEW_STATE_ORDINAL = 2; public static final int ALL_APPS_STATE_ORDINAL = 3; public static final int BACKGROUND_APP_STATE_ORDINAL = 4; public static final String IS_TEST_INFO_ENABLED = "is-test-info-enabled"; public static final String TEST_INFO_RESPONSE_FIELD = "response"; } tests/tapl/AndroidManifest.xml 0 → 100644 +26 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** ** Copyright 2019, 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. */ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.launcher3.tapl" > <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/> </manifest> Loading
Android.bp +2 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. java_library_static { android_library { name: "launcher-aosp-tapl", static_libs: [ "androidx.annotation_annotation", Loading @@ -27,5 +27,6 @@ java_library_static { "src/com/android/launcher3/util/SecureSettingsObserver.java", "src/com/android/launcher3/TestProtocol.java", ], manifest: "tests/tapl/AndroidManifest.xml", platform_apis: true, }
AndroidManifest-common.xml +8 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,14 @@ android:writePermission="${packageName}.permission.WRITE_SETTINGS" android:readPermission="${packageName}.permission.READ_SETTINGS" /> <provider android:name="com.android.launcher3.TestInformationProvider" android:authorities="${packageName}.TestInfo" android:readPermission="android.permission.WRITE_SECURE_SETTINGS" android:writePermission="android.permission.WRITE_SECURE_SETTINGS" android:exported="true"> </provider> <!-- The content provider for exposing various launcher grid options. TODO: Enable when all apps columns are correct Loading
src/com/android/launcher3/TestInformationProvider.java 0 → 100644 +66 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 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 com.android.launcher3; import android.content.ContentProvider; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; public class TestInformationProvider extends ContentProvider { @Override public boolean onCreate() { return true; } @Override public int update(Uri uri, ContentValues contentValues, String s, String[] strings) { return 0; } @Override public int delete(Uri uri, String s, String[] strings) { return 0; } @Override public Uri insert(Uri uri, ContentValues contentValues) { return null; } @Override public String getType(Uri uri) { return null; } @Override public Cursor query(Uri uri, String[] strings, String s, String[] strings1, String s1) { return null; } @Override public Bundle call(String method, String arg, Bundle extras) { if (TestProtocol.IS_TEST_INFO_ENABLED.equals(method)) { final Bundle response = new Bundle(); response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, Utilities.IS_RUNNING_IN_TEST_HARNESS); return response; } return null; } }
src/com/android/launcher3/TestProtocol.java +3 −0 Original line number Diff line number Diff line Loading @@ -30,4 +30,7 @@ public final class TestProtocol { public static final int OVERVIEW_STATE_ORDINAL = 2; public static final int ALL_APPS_STATE_ORDINAL = 3; public static final int BACKGROUND_APP_STATE_ORDINAL = 4; public static final String IS_TEST_INFO_ENABLED = "is-test-info-enabled"; public static final String TEST_INFO_RESPONSE_FIELD = "response"; }
tests/tapl/AndroidManifest.xml 0 → 100644 +26 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /* ** ** Copyright 2019, 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. */ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.launcher3.tapl" > <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/> </manifest>