Loading packages/SystemUI/plugin/ExamplePlugin/AndroidManifest.xml +9 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,15 @@ <uses-permission android:name="com.android.systemui.permission.PLUGIN" /> <application> <service android:name=".SampleOverlayPlugin"> <activity android:name=".PluginSettings" android:label="@string/plugin_label"> <intent-filter> <action android:name="com.android.systemui.action.PLUGIN_SETTINGS" /> </intent-filter> </activity> <service android:name=".SampleOverlayPlugin" android:label="@string/plugin_label"> <intent-filter> <action android:name="com.android.systemui.action.PLUGIN_OVERLAY" /> </intent-filter> Loading packages/SystemUI/plugin/ExamplePlugin/res/layout/plugin_settings.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ** Copyright 2016, 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. --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:textAppearance="?android:attr/textAppearanceLarge" android:text="@string/plugin_settings_here" android:gravity="center" /> packages/SystemUI/plugin/ExamplePlugin/res/values/strings.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /** * Copyright (c) 2016, 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:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="plugin_settings_here" translatable="false">Plugin settings go here</string> <string name="plugin_label" translatable="false">Overlay Plugin</string> </resources> packages/SystemUI/plugin/ExamplePlugin/src/com/android/systemui/plugin/testoverlayplugin/PluginSettings.java 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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.systemui.plugin.testoverlayplugin; import android.annotation.Nullable; import android.app.Activity; import android.os.Bundle; /** * DO NOT Reference Plugin interfaces here, this runs in the plugin APK's process * and is only for modifying settings. */ public class PluginSettings extends Activity { @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.plugin_settings); } } packages/SystemUI/plugin/src/com/android/systemui/plugins/PluginInstanceManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Handler; import android.os.Looper; Loading Loading @@ -163,6 +162,7 @@ public class PluginInstanceManager<T extends Plugin> extends BroadcastReceiver { switch (msg.what) { case PLUGIN_CONNECTED: if (DEBUG) Log.d(TAG, "onPluginConnected"); PluginPrefs.setHasPlugins(mContext); PluginInfo<T> info = (PluginInfo<T>) msg.obj; info.mPlugin.onCreate(mContext, info.mPluginContext); mListener.onPluginConnected(info.mPlugin); Loading Loading
packages/SystemUI/plugin/ExamplePlugin/AndroidManifest.xml +9 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,15 @@ <uses-permission android:name="com.android.systemui.permission.PLUGIN" /> <application> <service android:name=".SampleOverlayPlugin"> <activity android:name=".PluginSettings" android:label="@string/plugin_label"> <intent-filter> <action android:name="com.android.systemui.action.PLUGIN_SETTINGS" /> </intent-filter> </activity> <service android:name=".SampleOverlayPlugin" android:label="@string/plugin_label"> <intent-filter> <action android:name="com.android.systemui.action.PLUGIN_OVERLAY" /> </intent-filter> Loading
packages/SystemUI/plugin/ExamplePlugin/res/layout/plugin_settings.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ** Copyright 2016, 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. --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:textAppearance="?android:attr/textAppearanceLarge" android:text="@string/plugin_settings_here" android:gravity="center" />
packages/SystemUI/plugin/ExamplePlugin/res/values/strings.xml 0 → 100644 +24 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /** * Copyright (c) 2016, 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:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="plugin_settings_here" translatable="false">Plugin settings go here</string> <string name="plugin_label" translatable="false">Overlay Plugin</string> </resources>
packages/SystemUI/plugin/ExamplePlugin/src/com/android/systemui/plugin/testoverlayplugin/PluginSettings.java 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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.systemui.plugin.testoverlayplugin; import android.annotation.Nullable; import android.app.Activity; import android.os.Bundle; /** * DO NOT Reference Plugin interfaces here, this runs in the plugin APK's process * and is only for modifying settings. */ public class PluginSettings extends Activity { @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.plugin_settings); } }
packages/SystemUI/plugin/src/com/android/systemui/plugins/PluginInstanceManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Handler; import android.os.Looper; Loading Loading @@ -163,6 +162,7 @@ public class PluginInstanceManager<T extends Plugin> extends BroadcastReceiver { switch (msg.what) { case PLUGIN_CONNECTED: if (DEBUG) Log.d(TAG, "onPluginConnected"); PluginPrefs.setHasPlugins(mContext); PluginInfo<T> info = (PluginInfo<T>) msg.obj; info.mPlugin.onCreate(mContext, info.mPluginContext); mListener.onPluginConnected(info.mPlugin); Loading